{
  "openapi": "3.1.0",
  "info": {
    "title": "HRM API",
    "version": "1.1.0",
    "description": "HRM — сервис, подключённый к порталу Битрикс24 и расширяющий его функции: план найма, отклики, справочники и люди портала. Операции ниже работают с ОДНИМ порталом, и параметра «портал» нет ни у одной из них — портал берётся из предъявленного ключа.\n\nАутентификация — заголовок `Authorization: Bearer <ключ>`. Ключ выпускает человек на странице ключей; ключ действует ЕГО правами и видит ровно один портал — тот, в котором выпущен.\n\nОтвет всегда приходит конвертом: либо `{\"data\": ...}`, либо `{\"error\": {...}}`, и никогда оба сразу. Разборщик на всё API нужен один.\n\nПовторять запрос или нет, решает `error.retryable`, а не HTTP-код: под одним кодом прячутся разные исходы, и различает их `error.code`. При `retryable: false` тот же запрос даст тот же ответ."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v1/survey-forms": {
      "get": {
        "operationId": "appSurveyForms",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Формы обратной связи",
        "description": "Список строк без содержимого формы. Требует survey_form · view; портал и уровень own/all проверяются на каждой странице. Неизвестные, повторные и неверные параметры — 400 bad_request. Курсор привязан к сортировке; неверный курсор — 422 survey_invalid. По умолчанию updatedAt desc. Параметр folder выбирает корень или одну папку.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "forms": [],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_folder_gone. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_folder_gone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_folder_gone",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1020
            },
            "description": "Поиск по названию."
          },
          {
            "name": "creatorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(system|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            },
            "description": "Автор формы: публичный UUID пользователя или метка system — формы без автора (предустановки HRM, creator_id = 0)."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "ready",
                "archived"
              ]
            },
            "description": "Статус."
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "only",
                "exclude"
              ]
            },
            "description": "Архив: по умолчанию исключён."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "updatedAt",
                "title",
                "state"
              ]
            },
            "description": "Поле сортировки."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление."
          },
          {
            "name": "folder",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "root или UUID папки",
              "maxLength": 36
            },
            "description": "Папка: root — только анкеты вне папок, UUID — анкеты этой папки; без параметра — все анкеты плоским списком. Неверный UUID — 422 survey_invalid, удалённая папка — 409 survey_folder_gone."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Непрозрачный nextCursor прошлой страницы; пустая строка означает конец."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Размер страницы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveyFormCreate",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Создать форму",
        "description": "Создаёт незавершённый черновик revision=1 в корне или в папке из параметра folderId. Требует survey_form · edit и view; автор — пользователь сессии или владелец ключа. Ответ совпадает с GET карточки.",
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "revision": 1,
                    "state": "draft",
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "surveyCount": 0,
                    "creatorId": "51b397bd-ad28-46c8-9e03-742907207805",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "folderId": "",
                    "folderTitle": "",
                    "systemAuthor": false,
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "normDefaults": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        },
                        {
                          "min": 0,
                          "max": 10,
                          "normFrom": 7,
                          "criticalBelow": 5,
                          "redFlagTo": 3
                        }
                      ],
                      "shares": {
                        "normFrom": 625,
                        "criticalBelow": 500,
                        "redFlagTo": 250
                      },
                      "enps": {
                        "normFrom": 20,
                        "criticalBelow": 0
                      }
                    },
                    "anonymousDefault": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request, survey_norm_null. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request",
              "survey_norm_null"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_form_archived, survey_command_conflict, survey_question_key_changed, survey_closed, survey_already_started, survey_folder_gone. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_form_archived",
              "survey_command_conflict",
              "survey_question_key_changed",
              "survey_closed",
              "survey_already_started",
              "survey_folder_gone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_revision_conflict",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 32 MiB. Превышение количества элементов коллекций — 422 survey_invalid (too_many), до выделения типизированных массивов.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCreateForm"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "folderId",
            "in": "query",
            "required": false,
            "description": "Публичный UUID папки, в которой завести анкету; без параметра анкета создаётся в корне. Папку проверяет и блокирует та же транзакция, что вставляет анкету: удалённая папка — 409 survey_folder_gone.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-forms/{id}": {
      "get": {
        "operationId": "appSurveyForm",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Карточка формы",
        "description": "Требует survey_form · view. Чужой портал и строка вне уровня дают 404 not_found.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "revision": 1,
                    "state": "draft",
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "surveyCount": 0,
                    "creatorId": "51b397bd-ad28-46c8-9e03-742907207805",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "folderId": "",
                    "folderTitle": "",
                    "systemAuthor": false,
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "normDefaults": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        },
                        {
                          "min": 0,
                          "max": 10,
                          "normFrom": 7,
                          "criticalBelow": 5,
                          "redFlagTo": 3
                        }
                      ],
                      "shares": {
                        "normFrom": 625,
                        "criticalBelow": 500,
                        "redFlagTo": 250
                      },
                      "enps": {
                        "normFrom": 20,
                        "criticalBelow": 0
                      }
                    },
                    "anonymousDefault": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appSurveyFormSave",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Сохранить форму",
        "description": "Требует survey_form · edit и view над строкой в одной транзакции. revision, content и ready обязательны. При stale revision — 409 survey_revision_conflict; невалидная ready не изменяет сохранённую форму. Архив запрещает изменение; изменение вида вопроса под прежним key — 409 survey_question_key_changed. Ответ совпадает с GET. Присланная norm проверяется против нового содержимого; без поля сохранённая норма не теряется.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "revision": 1,
                    "state": "draft",
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "surveyCount": 0,
                    "creatorId": "51b397bd-ad28-46c8-9e03-742907207805",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "folderId": "",
                    "folderTitle": "",
                    "systemAuthor": false,
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "normDefaults": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        },
                        {
                          "min": 0,
                          "max": 10,
                          "normFrom": 7,
                          "criticalBelow": 5,
                          "redFlagTo": 3
                        }
                      ],
                      "shares": {
                        "normFrom": 625,
                        "criticalBelow": 500,
                        "redFlagTo": 250
                      },
                      "enps": {
                        "normFrom": 20,
                        "criticalBelow": 0
                      }
                    },
                    "anonymousDefault": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request, survey_norm_null. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request",
              "survey_norm_null"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_form_archived, survey_command_conflict, survey_question_key_changed, survey_closed, survey_already_started. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_form_archived",
              "survey_command_conflict",
              "survey_question_key_changed",
              "survey_closed",
              "survey_already_started"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_revision_conflict",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 32 MiB. Превышение количества элементов коллекций — 422 survey_invalid (too_many), до выделения типизированных массивов.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySaveForm"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-forms/{id}/copy": {
      "post": {
        "operationId": "appSurveyFormCopy",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Копировать форму",
        "description": "Требует survey_form · edit и view. Новая форма — draft revision=1; форма, вопросы, варианты, критерии и категории получают новые UUID. commandKey идемпотентен для автора и операции: повтор возвращает текущую GET-карточку созданной формы, другой UUID исходной формы при том же ключе — survey_command_conflict.",
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "revision": 1,
                    "state": "draft",
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "surveyCount": 0,
                    "creatorId": "51b397bd-ad28-46c8-9e03-742907207805",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "folderId": "",
                    "folderTitle": "",
                    "systemAuthor": false,
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "normDefaults": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        },
                        {
                          "min": 0,
                          "max": 10,
                          "normFrom": 7,
                          "criticalBelow": 5,
                          "redFlagTo": 3
                        }
                      ],
                      "shares": {
                        "normFrom": 625,
                        "criticalBelow": 500,
                        "redFlagTo": 250
                      },
                      "enps": {
                        "normFrom": 20,
                        "criticalBelow": 0
                      }
                    },
                    "anonymousDefault": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_form_archived, survey_command_conflict, survey_question_key_changed, survey_closed, survey_already_started. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_form_archived",
              "survey_command_conflict",
              "survey_question_key_changed",
              "survey_closed",
              "survey_already_started"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_revision_conflict",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCopyForm"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-forms/{id}/archive": {
      "post": {
        "operationId": "appSurveyFormArchive",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Архивировать форму",
        "description": "Требует survey_form · edit и view над строкой. revision защищает от устаревшей записи. commandKey идемпотентен для автора и операции: повтор возвращает текущую карточку; изменение аргументов под прежним ключом — 409 survey_command_conflict. Архив блокирует дальнейшее редактирование.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "revision": 2,
                    "state": "archived",
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "surveyCount": 0,
                    "creatorId": "51b397bd-ad28-46c8-9e03-742907207805",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "folderId": "",
                    "folderTitle": "",
                    "systemAuthor": false,
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "normDefaults": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        },
                        {
                          "min": 0,
                          "max": 10,
                          "normFrom": 7,
                          "criticalBelow": 5,
                          "redFlagTo": 3
                        }
                      ],
                      "shares": {
                        "normFrom": 625,
                        "criticalBelow": 500,
                        "redFlagTo": 250
                      },
                      "enps": {
                        "normFrom": 20,
                        "criticalBelow": 0
                      }
                    },
                    "anonymousDefault": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_form_archived, survey_command_conflict, survey_question_key_changed, survey_closed, survey_already_started. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_form_archived",
              "survey_command_conflict",
              "survey_question_key_changed",
              "survey_closed",
              "survey_already_started"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_revision_conflict",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyArchiveForm"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/connect/authorize": {
      "get": {
        "operationId": "connectAuthorize",
        "summary": "Старт auth-code flow",
        "description": "Принимает запрос клиента, проверяет client_id, code_challenge и redirect_uri, заводит поток в connect_flow и редиректит браузер на страницу согласия (RFC 6749 § 4.1.1). Пока redirect_uri не признан своим — HTML-ошибка; после признания — отказ уходит редиректом с ?error=… (RFC 6749 § 4.1.2.1). Успех — всегда 302, тела нет. Отказы без redirect_uri: {error, error_description} голым JSON без конверта data (спека § 14). x-public: true — ручку вызывает браузер на стороне клиента Desktop, аутентификации HRM не требует.",
        "responses": {
          "302": {
            "description": "Редирект на страницу согласия или на redirect_uri с error."
          },
          "400": {
            "description": "Ошибка клиента в форме RFC 6749: invalid_request, invalid_client.",
            "x-error-codes": [
              "invalid_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов с этого адреса. Форма RFC: {error: \"rate_limited\", error_description: ...}.",
            "x-error-codes": [
              "rate_limited"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка.",
            "x-error-codes": [
              "server_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подключение"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/connect/device/authorize": {
      "post": {
        "operationId": "connectDeviceAuthorize",
        "summary": "Старт device flow",
        "description": "Старт device authorization flow (RFC 8628 § 3.1 и § 3.2). Принимает client_id, code_challenge (S256), code_challenge_method в теле form-urlencoded. Заводит поток в connect_flow, выдаёт device_code, user_code и адреса верификации. Ответ 200 — голый объект по RFC 8628 § 3.2 без конверта data: {device_code, user_code, verification_uri, verification_uri_complete, expires_in, interval}. Отказы: {error, error_description} (RFC 8628). x-public: true — вызывается Desktop без аутентификации HRM (спека § 11.1, § 14).",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id",
                  "code_challenge",
                  "code_challenge_method"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "code_challenge": {
                    "type": "string"
                  },
                  "code_challenge_method": {
                    "type": "string",
                    "enum": [
                      "S256"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Поток заведён; клиент опрашивает /api/connect/token через interval секунд",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "device_code",
                    "user_code",
                    "verification_uri",
                    "verification_uri_complete",
                    "expires_in",
                    "interval"
                  ],
                  "properties": {
                    "device_code": {
                      "type": "string",
                      "description": "Непрозрачный токен для поллинга"
                    },
                    "user_code": {
                      "type": "string",
                      "description": "Код пользователя, отображаемый на экране"
                    },
                    "verification_uri": {
                      "type": "string",
                      "description": "Адрес страницы ввода кода"
                    },
                    "verification_uri_complete": {
                      "type": "string",
                      "description": "Адрес с предзаполненным user_code"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Срок жизни кода в секундах"
                    },
                    "interval": {
                      "type": "integer",
                      "description": "Минимальный интервал между поллингами в секундах"
                    }
                  }
                },
                "example": {
                  "device_code": "hrm_dc_7f3a91c4b2e54d8a9f0e1c2b3d4e5f6a",
                  "user_code": "WDJB-MJHT",
                  "verification_uri": "https://hrm.example.com/connect/device",
                  "verification_uri_complete": "https://hrm.example.com/connect/device?user_code=WDJB-MJHT",
                  "expires_in": 1800,
                  "interval": 5
                }
              }
            }
          },
          "400": {
            "description": "Ошибка клиента в форме RFC 8628.",
            "x-error-codes": [
              "invalid_request",
              "invalid_client"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов с этого адреса. Форма RFC: {error: \"rate_limited\", error_description: ...}.",
            "x-error-codes": [
              "rate_limited"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка.",
            "x-error-codes": [
              "server_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подключение"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/connect/token": {
      "post": {
        "operationId": "connectToken",
        "summary": "Выдача ключа API (поллинг device flow или обмен auth-code)",
        "description": "Выдача ключа API: поллинг device flow (RFC 8628 § 3.4) или обмен auth-code (RFC 6749 § 4.1.3). Принимает grant_type (urn:ietf:params:oauth:grant-type:device_code или authorization_code), client_id, секрет обмена и code_verifier PKCE. Успех 200 — голый объект {api_key} без конверта data (спека § 11.5, § 14). Отказы — форма RFC 6749 § 5.2: {error, error_description}. Cache-Control: no-store на всех ответах (RFC 6749 § 5.1). x-public: true — вызывается Desktop без аутентификации HRM.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "device_code": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ключ API выдан; Cache-Control: no-store",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "api_key"
                  ],
                  "properties": {
                    "api_key": {
                      "type": "string",
                      "description": "Ключ API в формате hrm_…"
                    }
                  }
                },
                "example": {
                  "api_key": "hrm_v1_7f3a91c4b2e54d8a9f0e1c2b3d4e5f6a"
                }
              }
            }
          },
          "400": {
            "description": "Ошибка клиента в форме RFC 6749 § 5.2. Коды: authorization_pending, slow_down, access_denied, expired_token, invalid_grant, unsupported_grant_type, invalid_request. Ответ authorization_pending у ожидающего device-потока может нести hrm_hint: limit_reached — человек пытался подтвердить код и упёрся в предел ключей; поток жив, опрос продолжается.",
            "x-error-codes": [
              "invalid_request",
              "invalid_grant",
              "expired_token",
              "authorization_pending",
              "slow_down",
              "access_denied",
              "unsupported_grant_type",
              "invalid_client"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    },
                    "hrm_hint": {
                      "type": "string",
                      "enum": [
                        "limit_reached"
                      ],
                      "description": "Подсказка HRM сверх формы RFC. Приходит только вместе с authorization_pending у ожидающего device-потока, когда человек пытался подтвердить код и упёрся в предел ключей. Поток жив: продолжайте опрос и предложите человеку освободить ключ на странице «Ключи» и подтвердить тот же код."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов: ведро по адресу или по exchange_hash. Форма RFC: {error: \"rate_limited\", error_description: ...}. Клиент обязан уважать Retry-After.",
            "x-error-codes": [
              "rate_limited"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка.",
            "x-error-codes": [
              "server_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подключение"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "discoveryDocument",
        "summary": "OAuth 2.0 Authorization Server Metadata (RFC 8414)",
        "description": "Документ обнаружения сервера авторизации по RFC 8414 § 3. Путь прибит к корню самим RFC и не может лежать под /api/ — проксируется отдельно в nginx. Не требует аутентификации. Ответ 200 — голый объект RFC 8414 § 3.2 без конверта data. Поле scopes_supported отсутствует намеренно: скопов у сервиса нет, пустой массив соврал бы про их существование (спека § 10). x-public: true — читается клиентом Desktop при обнаружении сервера.",
        "responses": {
          "200": {
            "description": "Метаданные сервера авторизации по RFC 8414",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "issuer",
                    "authorization_endpoint",
                    "token_endpoint",
                    "device_authorization_endpoint",
                    "grant_types_supported",
                    "response_types_supported",
                    "code_challenge_methods_supported",
                    "token_endpoint_auth_methods_supported"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string"
                    },
                    "authorization_endpoint": {
                      "type": "string"
                    },
                    "token_endpoint": {
                      "type": "string"
                    },
                    "device_authorization_endpoint": {
                      "type": "string"
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "issuer": "https://hrm.example.com",
                  "authorization_endpoint": "https://hrm.example.com/api/connect/authorize",
                  "token_endpoint": "https://hrm.example.com/api/connect/token",
                  "device_authorization_endpoint": "https://hrm.example.com/api/connect/device/authorize",
                  "grant_types_supported": [
                    "authorization_code",
                    "urn:ietf:params:oauth:grant-type:device_code"
                  ],
                  "response_types_supported": [
                    "code"
                  ],
                  "code_challenge_methods_supported": [
                    "S256"
                  ],
                  "token_endpoint_auth_methods_supported": [
                    "none"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Внутренняя ошибка сервера.",
            "x-error-codes": [
              "server_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "error_description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Подключение"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies": {
      "get": {
        "operationId": "appVacancies",
        "tags": [
          "План найма"
        ],
        "summary": "План найма: список вакансий",
        "description": "Страница вакансий портала, свежие сверху. Без параметра stage приходят вакансии всех этапов одной лентой; разбивки по этапам в ответе нет — за каждым этапом идёт свой запрос со своим stage.\n\nТребует права vacancy · view, и выдача СУЖАЕТСЯ уровнем вызывающего: «только свои» отдаёт вакансии, где он автор, интервьюер, рекрутер или заказчик; «свой отдел» добавляет вакансии его отдела и подразделений; «все» отдаёт портал целиком. Какой уровень достался вызывающему, сказано в grants ответа GET /api/v1/me — по нему и надо решать, а не по числу строк в ответе.\n\nПараметр awaiting=me оставляет заявки, ждущие решения вызывающего. Точное их число отдаёт GET /api/v1/approvals/awaiting-count: страница ограничена пределом и её длина ответила бы «столько или больше».\n\nЛента разбора откликов: applications=active оставляет вакансии, у которых есть активный отклик в области application · view вызывающего, а sort=lastApplication упорядочивает их по свежести последнего такого отклика. Сколько их всего, отдаёт поле open ответа GET /api/v1/vacancies/counts с тем же отбором.\n\nПоля условий заявки список не отдаёт: их возвращает карточка.",
        "parameters": [
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "Код одного этапа, open — все этапы, кроме completed, или группа плана: requests — draft и approval, approved — new, preparation, screening и completed (отклонённые — код этапа rejected). Без параметра — все этапы.",
            "schema": {
              "$ref": "#/components/schemas/VacancyStageFilter"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока НАЗВАНИЯ ДОЛЖНОСТИ, и только его. По обоснованию для кадрового департамента не ищем: это внутренний текст, и он попал бы в выдачу по случайному совпадению, показав вилку тому, кто искал другое. Не длиннее названия должности (255 символов после обрезки пробелов); длиннее — 400 invalid_value с details.field = q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. Непрозрачный, чтобы форму курсора можно было сменить, не ломая контракт.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Ось сортировки страницы.`createdAt` — по дате создания (умолчание, свежие сверху); `updatedAt` — по дате последней правки; `alpha` — по названию должности; `lastApplication` — по дате создания последнего активного отклика, видимого вызывающему (более свежие отклики в найме или отказе и вне его области порядка не меняют), ничьи — по вакансии. `lastApplication` работает только с `applications=active` и без `mineFirst`: иначе сервер отвечает 400 `invalid_value` (поле `sort` или `mineFirst`). Курсор пары `(ось, id)` собирается сервером; смена оси инвалидирует курсор — сервер отвечает 400 `bad_request`.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "updatedAt",
                "alpha",
                "lastApplication"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "description": "Направление сортировки. `desc` — сегодняшнее умолчание (свежие сверху); `asc` переворачивает и порядок, и компаратор курсора.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "mineFirst",
            "in": "query",
            "required": false,
            "description": "«Мои сверху»: `true` — строки, где вызывающий стоит интервьюером, идут перед прочими. Работает только с `sort=createdAt`; с другими осями сервер отвечает 400 `invalid_value` (поле `mineFirst`). Требует индекс `ix_vacancy_interviewer_id`.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "responsible",
            "in": "query",
            "required": false,
            "description": "`public_id` пользователя-интервьюера: страница отдаст только вакансии, где он назначен. Отсутствие или пустая строка — фильтр не применяется. Неизвестный идентификатор отвечает 400 `invalid_value` (поле `responsible`).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "description": "Оставить только заявки, ждущие решения вызывающего: у них есть шаг круга согласования в состоянии pending, где он значится решающим. Единственное значение — me. «Ждут решения вон того» — другой вопрос и другое право, и параметром списка он не открывается.",
            "schema": {
              "type": "string",
              "enum": [
                "me"
              ]
            }
          },
          {
            "name": "applications",
            "in": "query",
            "required": false,
            "description": "Отбор ленты разбора откликов. Единственное значение — active: только вакансии, у которых есть отклик на активном этапе (new, interview, offer) в области application · view вызывающего. Без права видеть отклики сервер отвечает 403 `forbidden`, иное значение — 400 `invalid_value` (поле `applications`).",
            "schema": {
              "type": "string",
              "enum": [
                "active"
              ]
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "description": "Отбор по сохранённому сценарию до пагинации и подсчёта. Без параметра область общего API сохраняется.",
            "schema": {
              "$ref": "#/components/schemas/VacancyScenario"
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "description": "Отбор по архиву: `exclude` — без архивных вакансий, `only` — только архивные, `all` — все (умолчание). Без параметра список отдаёт и архив: клиент, синхронизирующий строки, не теряет их молча, а отличает архивные по archivedAt. Рабочий список — `archived=exclude`. Иное значение — 400 `invalid_value` (поле `archived`); значения различают регистр.",
            "schema": {
              "$ref": "#/components/schemas/VacancyArchivedFilter",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница плана найма",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "vacancies": [
                      {
                        "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                        "position": "Оператор станка ЧПУ",
                        "headcount": 3,
                        "openReason": "расширение штата",
                        "desiredStartDate": "2026-10-01",
                        "deadline": "2026-09-25",
                        "salaryMin": "90000.00",
                        "salaryMax": "130000.00",
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "currency": "RUB",
                        "justification": "В октябре запускается третья смена, закрывать её сегодня некем.",
                        "department": null,
                        "departmentName": null,
                        "departmentMissing": false,
                        "interviewer": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "stage": "preparation",
                        "closeReason": null,
                        "allowedStages": [
                          "screening",
                          "completed"
                        ],
                        "createdAt": "2026-09-08T09:12:03Z",
                        "activeApplications": 7,
                        "recruiter": {
                          "id": "2e8b6c14-9f3a-4d71-a5c0-8b7e1d4f6a29",
                          "name": "Кравцова Елена Игоревна"
                        },
                        "company": {
                          "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                          "name": "Технологии Роста",
                          "archived": false
                        },
                        "number": 112,
                        "publishedAt": "2026-09-10T08:00:00Z",
                        "author": {
                          "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                          "name": "Лебедев Андрей Николаевич"
                        },
                        "customer": {
                          "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                          "name": "Лебедев Андрей Николаевич"
                        },
                        "completedAt": null,
                        "archivedAt": null,
                        "request": null,
                        "scenario": "regular"
                      },
                      {
                        "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                        "position": "Сварщик",
                        "headcount": 1,
                        "openReason": "замена уволившегося",
                        "desiredStartDate": null,
                        "deadline": null,
                        "salaryMin": "70000.00",
                        "salaryMax": null,
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "currency": "RUB",
                        "justification": null,
                        "department": null,
                        "departmentName": null,
                        "departmentMissing": false,
                        "interviewer": null,
                        "stage": "new",
                        "closeReason": null,
                        "allowedStages": [
                          "preparation",
                          "screening",
                          "completed"
                        ],
                        "createdAt": "2026-09-11T14:47:51Z",
                        "activeApplications": 0,
                        "recruiter": null,
                        "company": {
                          "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                          "name": "Технологии Роста",
                          "archived": false
                        },
                        "number": 113,
                        "publishedAt": null,
                        "author": {
                          "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                          "name": "Лебедев Андрей Николаевич"
                        },
                        "customer": {
                          "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                          "name": "Лебедев Андрей Николаевич"
                        },
                        "completedAt": null,
                        "archivedAt": null,
                        "request": null,
                        "scenario": "regular"
                      }
                    ],
                    "nextCursor": "eyJwIjoiOWQ0MGM3YjItZTgxYS00ZjM2LWI1YzktMDcyYWQzZTE2Zjg1In0"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Этап не разобрался, курсор не разобрался или ни на что не указывает — код bad_request. Значение параметра не принято (q длиннее предела, sort или dir вне списка, responsible не найден, awaiting не me, applications не active, sort=lastApplication без applications=active, mineFirst с осью кроме createdAt, archived не из exclude, only, all) — код invalid_value, details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "Неизвестный сценарий",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "invalid_value"
            ]
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Завести вакансию",
        "description": "Заводит вакансию. Должность берётся ТОЛЬКО из строк справочника, доступных для заявки (подсказки — GET /api/v1/job-positions): название вне справочника, недоступное или архивное отвергается — 400 invalid_value с details.field = positionTitle; справочник должностей эта операция не пополняет, его ведёт человек с правом job_position · edit. Причина открытия заводится в справочнике причин той же транзакцией, если её там ещё нет, и остаётся в нём навсегда.\n\nЭтап. Без поля stage вакансия рождается черновиком (draft) и дальше уходит только отправкой на согласование. Поле stage без templateId заводит её сразу в рабочем этапе — preparation, screening или completed (последний только с closeReasonTitle) — при праве vacancy · edit на уровне «все»; у ключа уровень считается после его потолка. Ниже — 403 forbidden с details.field = stage, а черновик тем же уровнем заводится. approval, rejected и new при заведении не принимаются: в них попадают только действием процесса — 400 invalid_value с details.field = stage. publication не является допустимым этапом создания — 400 invalid_value с details.field = stage. С templateId этап — только draft: любой другой — 400 invalid_value с details.field = stage на любом уровне, раньше проверки closeReasonTitle и самого шаблона; в работу вакансия по шаблону уходит маршрутом согласования. Поля stage и closeReasonTitle проверяются раньше уровня правки: 400 по ним приходит первым, а 403 по уровню — следом. При заведении на любом этапе, в том числе при импорте, publishedAt остаётся NULL до первого подтверждённого размещения; сам этап не доказывает публикацию. Рекрутер при заведении не назначается.\n\nПрофиль компании, который вакансия покажет соискателю, выбирается полем companyId той же транзакцией; без него действует профиль портала по умолчанию.\n\nПо шаблону. С полем templateId (выбор — GET /api/v1/vacancy-templates/choice) должность, число людей, срок, вилка, интервьюер, профиль компании, бриф и профиль кандидата берутся из шаблона, поверх — присланные поля; positionTitle, headcount и openReasonTitle становятся необязательными, этап — только черновик (см. «Этап»). Должность, отличная от шаблонной, отвергается на любом уровне прав. При праве vacancy · edit на уровне all режимы и аудитория шаблона не действуют: годится любой не архивный шаблон с доступной должностью, отдел — любой живой, не прислан — не заполняется. Ниже all — те же проверки, что у заявки: шаблон виден по отделам вызывающего, присланное поле с режимом fixed или hidden, отличное от значения шаблона, — 400 invalid_value с details.field, вилка режима hidden отвергается на самом присутствии ключа, число людей — не выше потолка шаблона, вилка range — в границах шаблона, отдел — из отделов вызывающего в аудитории (при нескольких обязателен). Причина открытия ниже all — из списка причин шаблона, у шаблона без списка — существующая причина портала или готовая формулировка; при all — любая, как без шаблона. Не прислана при одной причине в списке — берётся она. Признак скрытой вилки копируется в вакансию всегда (salaryHidden).\n\nТребует права vacancy · edit: без него отказ приходит до разбора тела.\n\nТело заведения вакансии не принимает поля условий заявки; их можно передать при правке вакансии. Ответ содержит необязательные поля условий заявки и `termsUnreadable`; ключу API поля приходят без `files[].id`, `observers[].name` и `observers[].active`. `salaryComment` скрыт вместе с вилкой.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заведённая вакансия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vacancy"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "c1e7a3f5-926b-48d0-af13-4e6b7c802d59",
                    "number": 115,
                    "position": "Бухгалтер",
                    "headcount": 1,
                    "openReason": "новое подразделение или проект",
                    "desiredStartDate": "2026-11-02",
                    "deadline": null,
                    "salaryMin": "80000.00",
                    "salaryMax": "95000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "justification": "Обособленное подразделение в Твери открывается 1 ноября.",
                    "department": null,
                    "departmentName": null,
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "company": {
                      "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                      "name": "Технологии Роста",
                      "archived": false
                    },
                    "stage": "draft",
                    "closeReason": null,
                    "allowedStages": [],
                    "createdAt": "2026-09-13T07:30:12Z",
                    "publishedAt": null,
                    "activeApplications": 0,
                    "author": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "customer": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "completedAt": null,
                    "archivedAt": null,
                    "request": {
                      "submittedAt": null,
                      "awaiting": [],
                      "awaitingTotal": 0,
                      "rejection": null
                    },
                    "scenario": "regular",
                    "marketReview": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Поле не прошло проверку — код invalid_value, details.field называет какое. По companyId — неразборный адрес, профиль другого портала или профиля с таким адресом нет; details.reason у этого отказа нет: причина одна — профиль недоступен. По templateId — шаблон неразборный, чужой, неизвестный, архивный, с недоступной должностью или (ниже vacancy · edit = all) вне аудитории вызывающего. С шаблоном ниже all — ещё поле, расходящееся с режимом fixed или hidden, число людей выше потолка, граница вилки вне границ range, отдел не из допустимых (department) и причина не из допустимых (openReasonTitle). По stage — этап вне списка заведения, а с templateId — любой этап, кроме draft, на любом уровне.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacancyCreateForbidden"
          },
          "409": {
            "description": "Выбранный профиль компании в архиве — код company_archived: вакансия выбирает только активный профиль.",
            "x-error-codes": [
              "company_archived",
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Создание массовых вакансий пока выключено: blue_collar_disabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "blue_collar_disabled"
            ]
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/job-positions/directory": {
      "get": {
        "operationId": "appJobPositionDirectory",
        "tags": [
          "Справочники"
        ],
        "summary": "Справочник должностей",
        "description": "ВСЕ строки справочника портала, включая недоступные для заявки и архивные — в отличие от подсказок GET /api/v1/job-positions, которые отдают только то, по чему сейчас можно завести заявку. Архивную строку надо видеть, чтобы разархивировать.\n\nТребует права job_position · view.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока названия.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Строки справочника",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/JobPositionListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "positions": [
                      {
                        "title": "Оператор станка ЧПУ",
                        "available": true,
                        "archived": false,
                        "createdAt": "2026-09-23T09:00:00Z"
                      },
                      {
                        "title": "Курьер",
                        "available": false,
                        "archived": true,
                        "createdAt": "2026-08-01T12:30:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appJobPositionCreate",
        "tags": [
          "Справочники"
        ],
        "summary": "Завести должность",
        "description": "Заводит строку справочника явно. Форма вакансии строк больше не заводит: набранное название, которого нет в справочнике, отвергается.\n\nСтрока адресуется НАЗВАНИЕМ — идентификатора у неё нет, нормальная форма названия уникальна в портале.\n\nТребует права job_position · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobPositionCreateRequest"
              },
              "example": {
                "title": "Оператор станка ЧПУ"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Должность заведена."
          },
          "400": {
            "description": "invalid_value — название пустое, длиннее допустимого или не разбирается (details.field = title). bad_request — тело не разбирается.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "already_exists — должность с таким названием в портале уже есть.",
            "x-error-codes": [
              "already_exists"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appJobPositionPatch",
        "tags": [
          "Справочники"
        ],
        "summary": "Правка должности",
        "description": "Переименовывает строку (newTitle), меняет её доступность для заявки и нахождение в архиве. Все три поля необязательны, но тело без единого из них отвергается: иначе опечатка в имени поля выглядела бы как применённая правка.\n\nПравка идёт целиком или никак: если новое название занято, признаки из того же тела тоже не применяются.\n\nСтрока адресуется НАЗВАНИЕМ (title). После переименования её адрес — новое название; вакансии и заявки по этой должности показывают новое название сразу. Новое название нормализуется так же, как при заведении; побайтно то же название — не переименование.\n\nТребует права job_position · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobPositionPatchRequest"
              },
              "example": {
                "title": "Курьер",
                "newTitle": "Курьер-водитель",
                "available": false,
                "archived": true
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Правка применена."
          },
          "400": {
            "description": "invalid_value — ни newTitle, ни available, ни archived не переданы; название строки не разбирается (details.field = title); новое название пустое или длиннее допустимого (details.field = newTitle). bad_request — тело не разбирается.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — должности с таким названием в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "already_exists — название занято в портале, в том числе архивной строкой.",
            "x-error-codes": [
              "already_exists"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appJobPositionDelete",
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить должность",
        "description": "Удаляет строку справочника, на которую не заведено ни одной вакансии и ни одного шаблона вакансии, — в том числе архивную. Удаление необратимо: вернуть строку можно только заведя её заново. Должность, на которую заведены вакансии или шаблоны вакансий, не удаляется — отправьте её в архив правкой PATCH /api/v1/job-positions/directory с archived: true.\n\nСтрока адресуется НАЗВАНИЕМ в параметре title.\n\nТребует права job_position · edit.",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": true,
            "description": "Название удаляемой строки. Сравнивается в нормальной форме, как при заведении.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Должность удалена."
          },
          "400": {
            "description": "invalid_value — название не передано или не разбирается (details.field = title).",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — должности с таким названием в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "position_in_use — на должность заведены вакансии или шаблоны вакансий; удалить её нельзя, её отправляют в архив.",
            "x-error-codes": [
              "position_in_use"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/job-positions/directory/route": {
      "put": {
        "operationId": "appPositionRoute",
        "tags": [
          "Справочники"
        ],
        "summary": "Маршрут должности",
        "description": "Каким маршрутом идёт заявка по этой должности. Поле routeId ОБЯЗАТЕЛЬНО, и null в нём значит «снять привязку» — тогда действует маршрут портала по умолчанию.\n\nСвоя операция, а не поле в правке признаков должности: полю пришлось бы различать «не трогай», «поставь» и «сними».\n\nТребует права job_position · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PositionRouteRequest"
              },
              "example": {
                "title": "Оператор станка ЧПУ",
                "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Маршрут должности задан или снят."
          },
          "400": {
            "description": "invalid_value — адрес маршрута не разбирается (details.field = routeId) или название должности пусто (details.field = title). bad_request — тело не разбирается.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — должности или маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "route_archived — маршрут в архиве: новой привязкой он не становится. route_type_mismatch — маршрут согласует объекты другого типа (objectType не `vacancy_request`). Уже стоящая привязка остаётся, и повтор того же значения ошибкой не считается.",
            "x-error-codes": [
              "route_archived",
              "route_type_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes": {
      "get": {
        "operationId": "appApprovalRoutes",
        "tags": [
          "Справочники"
        ],
        "summary": "Маршруты согласования",
        "description": "Шаблоны маршрутов портала БЕЗ шагов: список отвечает на «какие маршруты есть», а раскладку отдаёт карточка. У строки — первые участники с их числом, места использования и признак архива.\n\nБез параметров — прежний полный ответ: все маршруты портала, включая архивные, по названию, без страниц (`nextCursor` — null); страницы включает `limit`. Значение параметра вне допустимого (например, `limit` больше 50 или неизвестный `status`) отклоняется ответом 400; раньше такие значения молча игнорировались.\n\nИмена людей (участники вида `user` и `b24_user`, «Изменил») отдаются только вызывающему с правом approval_route · edit и сессией по куке; ключу API и тому, у кого есть лишь approval_route · view, приходит тот же идентификатор с `name` = null. Название отдела и собственной роли отдаётся всем.\n\nТребует права approval_route · view.",
        "responses": {
          "200": {
            "description": "Маршруты портала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRouteListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "routes": [
                      {
                        "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                        "title": "Найм инженеров",
                        "mode": "sequential",
                        "isDefault": true,
                        "createdAt": "2026-09-23T10:00:00Z",
                        "steps": [],
                        "updatedAt": "2026-10-14T08:30:00Z",
                        "updatedBy": {
                          "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                          "name": "Петрова Анна Сергеевна"
                        },
                        "archivedAt": null,
                        "stepCount": 2,
                        "version": 3,
                        "participants": [
                          {
                            "kind": "b24_user",
                            "userId": null,
                            "b24UserId": 501,
                            "b24DeptId": null,
                            "roleCode": null,
                            "roleId": null,
                            "name": "Иванов Иван"
                          },
                          {
                            "kind": "b24_dept_head",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": 77,
                            "roleCode": null,
                            "roleId": null,
                            "name": "Отдел разработки"
                          }
                        ],
                        "participantCount": 2,
                        "usage": {
                          "positions": 4,
                          "templates": 1,
                          "hadRounds": true
                        },
                        "objectType": "vacancy_request",
                        "hasParallel": false,
                        "hasConditions": false
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Значение параметра не принято (q длиннее предела, status, mode, objectType, structure, isDefault, participant, role, sort, dir или limit вне допустимого, cursor без limit) — код invalid_value, details.field называет параметр. Курсор не разобрался, принадлежит другому порядку (оси или направлению) или ни на что не указывает — код bad_request.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока НАЗВАНИЯ маршрута, и только его. Не длиннее названия маршрута (255 символов после обрезки пробелов); длиннее — 400 invalid_value с details.field = q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Только действующие (`active`) или только архивные (`archived`). Без параметра — все.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Прежний отбор по устройству: `parallel` — маршруты с параллельной группой (как structure=parallel), `sequential` — без неё. При заданном structure уступает ему.",
            "schema": {
              "type": "string",
              "enum": [
                "sequential",
                "parallel"
              ]
            }
          },
          {
            "name": "objectType",
            "in": "query",
            "required": false,
            "description": "Только маршруты этого типа объекта — ключ из GET /api/v1/approval-routes/object-types. Неизвестный тип — 400 invalid_value, details.field = objectType.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "structure",
            "in": "query",
            "required": false,
            "description": "Устройство: `parallel` — есть параллельная группа, `conditions` — есть шаг с условием, `sequential` — ни того, ни другого.",
            "schema": {
              "type": "string",
              "enum": [
                "parallel",
                "conditions",
                "sequential"
              ]
            }
          },
          {
            "name": "isDefault",
            "in": "query",
            "required": false,
            "description": "`true` — только умолчание портала, `false` — все прочие. Без параметра — без отбора.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "participant",
            "in": "query",
            "required": false,
            "description": "Только маршруты, где в шагах стоит этот человек: идентификатор пользователя Битрикс24 (целое больше нуля). Находит и шаг вида `b24_user`, и шаг вида `user` с человеком HRM, у которого тот же идентификатор Б24.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "description": "Только маршруты, где в шагах стоит эта роль портала: её адрес (roleId участника). Роль, которой в портале нет, даёт пустой список, а не отказ.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Ось сортировки: `title` — по названию (умолчание, по возрастанию), `updatedAt` — по времени последней правки (по убыванию), `stepCount` — по числу шагов (по убыванию). Курсор привязан к оси; смена оси инвалидирует курсор — 400 bad_request.",
            "schema": {
              "type": "string",
              "enum": [
                "title",
                "updatedAt",
                "stepCount"
              ],
              "default": "title"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "description": "Направление сортировки; без параметра — умолчание оси.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Размер страницы, от 1 до 50. Без параметра страниц нет: приходят все маршруты, `nextCursor` — null.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы; принимается только вместе с `limit` (без него — 400 invalid_value, details.field = cursor). Непрозрачный. Не разбирается, принадлежит другому порядку (другой оси сортировки или другому `dir`) или ни на что не указывает — 400 bad_request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appApprovalRouteCreate",
        "tags": [
          "Справочники"
        ],
        "summary": "Завести маршрут",
        "description": "Устарела: маршрут целиком пишут POST /api/v1/approval-routes/full и PUT /api/v1/approval-routes/{id}. Ручка живёт до выпуска сужения (ADR 2026-10-29).\n\nЗаводит шаблон БЕЗ шагов: раскладку кладёт следом PUT .../steps.\n\nТребует права approval_route · edit.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRouteCreateRequest"
              },
              "example": {
                "title": "Найм инженеров",
                "mode": "sequential"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Маршрут заведён; шаги кладутся следом.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRoute"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "title": "Найм инженеров",
                    "mode": "sequential",
                    "isDefault": false,
                    "createdAt": "2026-09-23T10:00:00Z",
                    "steps": [],
                    "updatedAt": "2026-10-14T08:30:00Z",
                    "updatedBy": {
                      "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": "Петрова Анна Сергеевна"
                    },
                    "archivedAt": null,
                    "stepCount": 0,
                    "version": 1,
                    "objectType": "vacancy_request",
                    "hasParallel": false,
                    "hasConditions": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — название пустое или длиннее допустимого (details.field = title), либо режим не из словаря (details.field = mode). bad_request — тело не разбирается.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}": {
      "get": {
        "operationId": "appApprovalRoute",
        "tags": [
          "Справочники"
        ],
        "summary": "Маршрут со шагами",
        "description": "Маршрут целиком: поля, версия, шаги в порядке прохождения с участниками и условиями. Шаг несёт и прежние поля (kind, userId, …) — субъект старой модели.\n\nПодпись участника-человека (`user`, `b24_user`) и имя в updatedBy отдаются только вызывающему с правом approval_route · edit и сессией по куке; ключу API и смотрящему с одним approval_route · view приходит тот же идентификатор с label = null. Названия должностей и причин в условиях — внешняя форма значения; удалённая должность — `{\"missing\": true}`.\n\nШаги ответа годятся для записи как есть: и в PUT /api/v1/approval-routes/{id}, и в прежнюю PUT .../steps.\n\nТребует права approval_route · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Маршрут со шагами",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRoute"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "title": "Найм инженеров",
                    "mode": "sequential",
                    "isDefault": true,
                    "createdAt": "2026-09-23T10:00:00Z",
                    "steps": [
                      {
                        "kind": "author_dept_head",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": null,
                        "groupNo": 1,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "author_dept_head",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": null,
                            "roleCode": null,
                            "label": null
                          }
                        ],
                        "conditions": []
                      },
                      {
                        "kind": "role",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": "hr",
                        "groupNo": 2,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "role",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8",
                            "roleCode": "hr",
                            "label": null
                          }
                        ],
                        "conditions": []
                      }
                    ],
                    "updatedAt": "2026-10-14T08:30:00Z",
                    "updatedBy": {
                      "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": "Петрова Анна Сергеевна"
                    },
                    "archivedAt": null,
                    "stepCount": 2,
                    "version": 3,
                    "objectType": "vacancy_request",
                    "hasParallel": false,
                    "hasConditions": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appApprovalRouteDelete",
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить маршрут",
        "description": "Удаляет маршрут, на который нет ссылок: ни должностей и шаблонов вакансий (в том числе архивных), ни кругов согласования. Маршрут с историей кругов только архивируется — удалить его нельзя никогда. Маршрут по умолчанию не удаляется.\n\nВ отказе route_in_use details называет, где маршрут держат: positions — должностей, templates — шаблонов, hadRounds — были ли круги; те же числа показывает список. Если отказ пришёл без details, ссылка появилась в момент удаления или сервер уступил параллельной операции: retryable = true, повтор покажет числа.\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Маршрут удалён."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "route_in_use — на маршрут есть ссылки (details: positions, templates, hadRounds; без details — ссылка появилась в момент удаления, retryable = true). route_is_default — маршрут служит умолчанием портала.",
            "x-error-codes": [
              "route_in_use",
              "route_is_default"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appApprovalRouteReplace",
        "tags": [
          "Справочники"
        ],
        "summary": "Заменить маршрут целиком",
        "description": "Заменяет название и шаги маршрута целиком одной транзакцией, если версия в теле совпала с хранимой; ответ — маршрут с новой версией. Тип объекта задан при создании и не меняется. Архивный маршрут правится: архив запрещает новые привязки, а не правку.\n\nШаги из ответа GET {id} годятся как есть («прочитал — записал»): прежние поля шага и подписи участников игнорируются, значение `{\"missing\": true}` (удалённая должность) отбрасывается из любого списка условия, строка из одних таких пометок — целиком, currency в денежном значении игнорируется (валюту ставит сервер).\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRouteReplaceRequest"
              },
              "example": {
                "title": "Найм инженеров",
                "version": 3,
                "steps": [
                  {
                    "groupNo": 1,
                    "rule": "any",
                    "members": [
                      {
                        "kind": "author_dept_head"
                      }
                    ]
                  },
                  {
                    "groupNo": 2,
                    "rule": "any",
                    "members": [
                      {
                        "kind": "role",
                        "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8"
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Маршрут заменён.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRoute"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "title": "Найм инженеров",
                    "mode": "sequential",
                    "isDefault": true,
                    "createdAt": "2026-09-23T10:00:00Z",
                    "steps": [
                      {
                        "kind": "author_dept_head",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": null,
                        "groupNo": 1,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "author_dept_head",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": null,
                            "roleCode": null,
                            "label": null
                          }
                        ],
                        "conditions": []
                      },
                      {
                        "kind": "role",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": "hr",
                        "groupNo": 2,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "role",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8",
                            "roleCode": "hr",
                            "label": null
                          }
                        ],
                        "conditions": []
                      }
                    ],
                    "updatedAt": "2026-10-14T08:30:00Z",
                    "updatedBy": {
                      "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": "Петрова Анна Сергеевна"
                    },
                    "archivedAt": null,
                    "stepCount": 2,
                    "version": 4,
                    "objectType": "vacancy_request",
                    "hasParallel": false,
                    "hasConditions": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — форма маршрута неверна; details.field — путь до места: title, objectType, steps (нет шагов, больше 32 или больше 200 значений во всех условиях), steps[2].groupNo (шаги группы не подряд), steps[1].rule, steps[1].title, steps[2].members (нет участников или больше 20), steps[2].members[0] (вид без своей ссылки, повтор, ссылка не из портала, роль «Сотрудник», any_dept_head при rule = all), steps[1].conditions[0] (поле не из каталога, оператор, больше двух строк на поле), steps[1].conditions[0].value (форма значения, ссылка не из портала). Чужая и несуществующая ссылка неотличимы. bad_request — тело не разбирается или больше 4 МиБ.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "route_conflict — версия в теле не совпала с хранимой: маршрут изменили в другом окне. Перечитайте его и повторите правку.",
            "x-error-codes": [
              "route_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}/steps": {
      "put": {
        "operationId": "appApprovalRouteSteps",
        "tags": [
          "Справочники"
        ],
        "summary": "Заменить раскладку шагов",
        "description": "Устарела: маршрут целиком пишут POST /api/v1/approval-routes/full и PUT /api/v1/approval-routes/{id}. Ручка живёт до выпуска сужения (ADR 2026-10-29).\n\nЗаменяет раскладку ЦЕЛИКОМ — отсюда PUT, а не PATCH: частичной правки у шагов нет, их переставляют и вставляют между.\n\nНомера шагов отдельным полем НЕ передаются: порядок в массиве и есть порядок шагов.\n\nШаги из ответа GET {id} годятся как есть: читаются только прежние поля (kind, userId, b24UserId, b24DeptId, roleCode), поля новой формы (groupNo, rule, title, members, conditions) игнорируются. Каждый шаг становится шагом с одним участником, группы — по mode маршрута. Маршрут, который уже хранится в новой форме (несколько участников, «нужны все», условия, название шага, собственная роль, смешанные группы), этой операцией не правится — 409 route_feature_unavailable; его пишет PUT /api/v1/approval-routes/{id}.\n\nТребует права approval_route · edit.",
        "deprecated": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRouteStepsRequest"
              },
              "example": {
                "steps": [
                  {
                    "kind": "author_dept_head",
                    "userId": null,
                    "b24UserId": null,
                    "b24DeptId": null,
                    "roleCode": null
                  },
                  {
                    "kind": "role",
                    "userId": null,
                    "b24UserId": null,
                    "b24DeptId": null,
                    "roleCode": "hr"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Раскладка заменена."
          },
          "400": {
            "description": "invalid_value — раскладка пуста или длиннее 32 шагов, вид субъекта не из словаря, вид не совпал с заполненными полями или человек шага не найден (details.field = steps). bad_request — тело не разбирается или больше 4 МиБ.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "route_feature_unavailable — маршрут хранится в новой форме, которую старая модель не выражает: перезапись срезала бы её. Маршрут правится PUT /api/v1/approval-routes/{id}.",
            "x-error-codes": [
              "route_feature_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}/default": {
      "post": {
        "operationId": "appApprovalRouteDefault",
        "tags": [
          "Справочники"
        ],
        "summary": "Сделать маршрутом по умолчанию",
        "description": "Маршрут портала по умолчанию действует для должностей, у которых своего нет. Прежнее умолчание снимается той же операцией: в портале оно ровно одно, и это держит база.\n\nАрхивный маршрут умолчанием стать не может.\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Маршрут стал умолчанием портала; прежнее снято."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "route_archived — архивный маршрут умолчанием не становится: сначала верните его из архива.",
            "x-error-codes": [
              "route_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/submit": {
      "post": {
        "operationId": "appSubmitVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Отправить заявку на согласование",
        "description": "Заводит круг согласования по маршруту должности, а при его отсутствии — по маршруту портала по умолчанию. Заявка переходит на этап approval; если все шаги рождены пропущенными (выше заказчика и автора по оргструктуре согласовать некому), круг согласован отправкой и заявка сразу на этапе new, а при заявке по шаблону с рекрутером, заданным на заявке или шаблоном, — на этапе preparation (дальше — по процессу шаблона). Вакансия без шаблона остаётся на new.\n\nКруг — СНИМОК: шаги копируются из шаблона, а субъекты переводятся в конкретных людей ЗДЕСЬ, до первой записи. Поэтому правка шаблона идущий круг не трогает, а шаг, который не находит ни одного решающего, ОТКАЗЫВАЕТ отправку целиком: круг, который некому пройти, оставил бы заявку стоять молча.\n\nОтказ черновика не портит — его правят и отправляют снова.\n\nТребует права vacancy · edit или vacancy_request · edit. По правке вакансий заявка открывается уровнем, как у PATCH /api/v1/vacancies/{id}; по правке заявок — только своя заявка, поданная по шаблону (вызывающий — автор, у вакансии есть шаблон). Вне обеих дорог — 404 not_found, как у несуществующей.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Круг заведён. Заявка ушла на согласование — или, если все шаги пропущены, уже согласована; этап перечитать."
          },
          "400": {
            "description": "Коды ответа: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Запрос отклонён",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "404": {
            "description": "not_found — заявки с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "stage_forbidden — заявка не черновик. route_missing — маршрут согласования не задан ни у шаблона, ни у должности, ни у портала. step_unresolved — шаг маршрута не находит ни одного решающего; номер шага и его субъект названы в message. step_crowded — шаг резолвится в слишком многих; номер шага, его субъект, число решающих и предел названы в message. vacancy_archived — заявка в архиве: на согласование она не уходит, пока её не вернут (POST /api/v1/vacancies/{id}/restore). Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "stage_forbidden",
              "route_missing",
              "step_unresolved",
              "step_crowded",
              "vacancy_archived",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/rework": {
      "post": {
        "operationId": "appReworkVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Вернуть отклонённую заявку в доработку",
        "description": "Переводит заявку из rejected в draft. Круги предыдущих отправок остаются как есть — это и есть история согласования, — а следующая отправка заводит НОВЫЙ круг со следующим номером.\n\nТребует права vacancy · edit или vacancy_request · edit. По правке вакансий заявка открывается уровнем, как у PATCH /api/v1/vacancies/{id}; по правке заявок — только своя заявка, поданная по шаблону (вызывающий — автор, у вакансии есть шаблон). Вне обеих дорог — 404 not_found, как у несуществующей.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Заявка вернулась в черновик."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — заявки с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "stage_forbidden — заявка не отклонена; дорабатывать нечего. vacancy_archived — заявка в архиве: в доработку она не возвращается, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "stage_forbidden",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/archive": {
      "post": {
        "operationId": "appVacancyArchive",
        "tags": [
          "План найма"
        ],
        "summary": "Убрать вакансию или заявку в архив",
        "description": "Убирает строку в архив: она не удаляется и читается по id как прежде, а момент архива приходит в поле archivedAt. Архив — признак строки, а не этап: stage не меняется, и allowedStages у архивной строки пуст. Пока строка в архиве, операции, меняющие её содержимое и этап, отвечают 409 vacancy_archived; снятие размещений с площадок работает. Вернуть — POST /api/v1/vacancies/{id}/restore.\n\nВ архив уходят черновик (draft), отклонённая заявка (rejected) и завершённая вакансия (completed) обычного сценария (scenario = regular), и только без активных откликов, офферов в работе и встреч. Повтор над строкой, которая уже в архиве, холостой: ответ тот же 204, момент архива не двигается, записи в журнале нет.\n\nТребует права vacancy · edit или vacancy_request · edit. По правке вакансий строка открывается уровнем, как у PATCH /api/v1/vacancies/{id}; по правке заявок — только своя заявка, поданная по шаблону (вызывающий — автор, у вакансии есть шаблон), и только на этапе draft или rejected: завершённую убирает в архив и возвращает правка вакансий. Право судится раньше холостого повтора. Вне обеих дорог — 404 not_found, как у несуществующей.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии или заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Строка в архиве: убрана сейчас или уже была там."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacancyArchiveForbidden"
          },
          "404": {
            "description": "not_found — строки с таким адресом нет либо её не открывает ни правка вакансий своего уровня, ни граница своей заявки.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "archive_stage_forbidden — заявка на согласовании (approval): в архив — после решения по ней. archive_requires_completion — вакансия в работе (new, preparation, screening): сначала закройте её. archive_scenario_forbidden — массовая вакансия (scenario = mass) в архив не убирается. archive_has_active_work — у вакансии остались активные отклики, офферы в работе (отправленные и не истёкшие, принятые без выхода) или встречи.",
            "x-error-codes": [
              "archive_stage_forbidden",
              "archive_requires_completion",
              "archive_scenario_forbidden",
              "archive_has_active_work"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/restore": {
      "post": {
        "operationId": "appVacancyRestore",
        "tags": [
          "План найма"
        ],
        "summary": "Вернуть вакансию или заявку из архива",
        "description": "Возвращает строку из архива на тот же этап, на котором она туда ушла: черновик снова правится и отправляется, отклонённую можно доработать, завершённую — переоткрыть обычным переводом этапа. archivedAt снова null. Этап сверх права своей заявки не проверяется. Повтор над строкой вне архива холостой: ответ тот же 204, записи в журнале нет.\n\nТребует права vacancy · edit или vacancy_request · edit. По правке вакансий строка открывается уровнем, как у PATCH /api/v1/vacancies/{id}; по правке заявок — только своя заявка, поданная по шаблону (вызывающий — автор, у вакансии есть шаблон), и только на этапе draft или rejected: завершённую убирает в архив и возвращает правка вакансий. Право судится раньше холостого повтора. Вне обеих дорог — 404 not_found, как у несуществующей.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии или заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Строка вне архива: возвращена сейчас или в архиве не была."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacancyArchiveForbidden"
          },
          "404": {
            "description": "not_found — строки с таким адресом нет либо её не открывает ни правка вакансий своего уровня, ни граница своей заявки.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/decision": {
      "post": {
        "operationId": "appDecideVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Согласовать или отклонить заявку",
        "description": "Закрывает ОДИН шаг круга — тот, чей номер назван в position, — при условии что вызывающий значится его решающим и шаг ждёт решения. Последовательный маршрут открывает следующий шаг, параллельный ждёт остальных; закрытие последнего переводит заявку в new. Отказ на любом шаге останавливает круг немедленно: оставшиеся шаги помечаются skipped, заявка уходит в rejected.\n\nОтказ обязан нести причину: «Отклонена» без текста не даёт автору ничего, а доработка — единственный путь дальше.\n\nДва решающих, нажавших одновременно, закрывают шаг ОДИН раз: опоздавший получает not_approver, а не молча переписывает чужое решение.\n\nТребует права vacancy · view — а не edit. Право решать уровнем не выражается вовсе: его даёт строка решающего в шаге, и проверяет её сервер. Требовать здесь edit значило бы требовать от согласующего права ПРАВИТЬ заявку, которого у него может не быть и не должно быть.\n\nОтказ not_approver приходит четыреста девятым, а не 403: право смотреть заявку у вызывающего есть — иначе он получил бы 404, — а не позволяет ему состояние шага. «Вы не решающий» и «вас опередили» наружу при этом не различаются намеренно: различение рассказало бы о чужом решении раньше, чем его покажет экран. expectedRound при наличии проверяется атомарно с решением: устаревший круг получает not_approver. Причина после обрезки краёв ограничена 2000 Unicode символами.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Шаг закрыт; круг продвинут или завершён."
          },
          "400": {
            "description": "invalid_value — отказ без причины (поле comment) либо номер шага меньше единицы (поле position). expectedRound меньше 1 (expectedRound) или причина длиннее 2000 Unicode символов после обрезки (comment).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "404": {
            "description": "not_found — заявки с таким адресом нет, она вне уровня смотрящего, либо идущего круга у неё нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "stage_forbidden — заявка не на согласовании. not_approver — решение по текущему шагу вызывающему не принадлежит: он не значится решающим этого шага, либо шаг уже закрыт чужим решением. approval_already_decided — в шаге «Нужны все» (rule = all) вызывающий уже принял решение, а шаг ждёт решений остальных. vacancy_archived — заявка в архиве: решение по ней не принимается, пока её не вернут (POST /api/v1/vacancies/{id}/restore). Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "stage_forbidden",
              "not_approver",
              "approval_already_decided",
              "vacancy_archived",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/approval": {
      "get": {
        "operationId": "appVacancyApproval",
        "tags": [
          "План найма"
        ],
        "summary": "Круг согласования заявки",
        "description": "Последний круг заявки со всеми шагами: кто решил, когда и с какой причиной. Номер круга значим — переотправка после отказа заводит следующий, а шаги предыдущего остаются историей.\n\nНазвание маршрута приходит КОПИЕЙ, снятой при отправке: шаблон с тех пор могли переименовать или вывести из обращения.\n\nСписка решающих в ответе нет: на шаге может стоять «носители роли», и показать их поимённо значило бы выдать состав роли тому, кому справочник людей закрыт. Своё право вызывающий узнаёт полем canDecide. Участники шага (members) — вид по снимку отправки; имя человека и subject.person — только если вызывающему этот человек виден по праву portal_user · view. В шаге «Нужны все» (rule = all) decisions называет уже решивших строкой decidedBy — это согласующие этого круга, правило и форма те же, что у decidedBy шага, идентификатора человека нет. Условия шага (conditions) приходят под маской вилки: если вилка скрыта от вызывающего, денежные строки вырезаны и conditionsMasked = true.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Круг согласования",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyApproval"
                    }
                  }
                },
                "example": {
                  "data": {
                    "round": 2,
                    "mode": "sequential",
                    "route": "Найм в производство",
                    "outcome": null,
                    "startedAt": "2026-09-23T08:40:11Z",
                    "finishedAt": null,
                    "steps": [
                      {
                        "position": 1,
                        "kind": "author_dept_head",
                        "state": "approved",
                        "decidedBy": "Одинцова Мария",
                        "decidedAt": "2026-09-23T09:02:47Z",
                        "comment": null,
                        "canDecide": false,
                        "skipReason": null,
                        "groupNo": 1,
                        "rule": "any",
                        "title": "Руководитель",
                        "members": [
                          {
                            "kind": "author_dept_head",
                            "name": "Производство",
                            "roleCode": null
                          }
                        ],
                        "conditions": [],
                        "conditionsMasked": false,
                        "decisions": [],
                        "actorCount": 1
                      },
                      {
                        "position": 2,
                        "kind": "role",
                        "state": "pending",
                        "decidedBy": null,
                        "decidedAt": null,
                        "comment": null,
                        "canDecide": true,
                        "skipReason": null,
                        "groupNo": 2,
                        "rule": "all",
                        "title": "Финансовая служба",
                        "members": [
                          {
                            "kind": "role",
                            "name": null,
                            "roleCode": "hr"
                          },
                          {
                            "kind": "b24_user",
                            "name": null,
                            "roleCode": null
                          }
                        ],
                        "conditions": [
                          {
                            "field": "salary_max",
                            "op": "gte",
                            "value": {
                              "amount": "300000.00",
                              "currency": "RUB"
                            },
                            "actual": {
                              "amount": "320000.00",
                              "currency": "RUB"
                            },
                            "result": true
                          }
                        ],
                        "conditionsMasked": false,
                        "decisions": [
                          {
                            "decidedBy": "Петров Илья",
                            "state": "approved",
                            "decidedAt": "2026-09-23T09:40:02Z",
                            "comment": null
                          }
                        ],
                        "actorCount": 3
                      },
                      {
                        "position": 3,
                        "kind": "b24_dept_head",
                        "state": "skipped",
                        "decidedBy": null,
                        "decidedAt": null,
                        "comment": null,
                        "canDecide": false,
                        "skipReason": "no_head_above",
                        "groupNo": 3,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "b24_dept_head",
                            "name": "Головной офис",
                            "roleCode": null
                          }
                        ],
                        "conditions": [],
                        "conditionsMasked": false,
                        "decisions": [],
                        "actorCount": 0
                      },
                      {
                        "position": 4,
                        "kind": "user",
                        "state": "skipped",
                        "decidedBy": null,
                        "decidedAt": null,
                        "comment": null,
                        "canDecide": false,
                        "skipReason": "condition_false",
                        "groupNo": 4,
                        "rule": "any",
                        "title": "Безопасность",
                        "members": [
                          {
                            "kind": "user",
                            "name": null,
                            "roleCode": null
                          }
                        ],
                        "conditions": [
                          {
                            "field": "department",
                            "op": "in",
                            "value": [
                              {
                                "id": 17,
                                "name": "Продажи"
                              }
                            ],
                            "actual": {
                              "id": 9,
                              "name": "Производство"
                            },
                            "result": false
                          }
                        ],
                        "conditionsMasked": false,
                        "decisions": [],
                        "actorCount": 0
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — заявки с таким адресом нет, она вне уровня смотрящего, либо на согласование её не отправляли ни разу.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approvals/awaiting-count": {
      "get": {
        "operationId": "appAwaitingCount",
        "tags": [
          "План найма"
        ],
        "summary": "Сколько заявок и офферов ждёт моего решения",
        "description": "Число заявок, у которых есть шаг круга согласования в состоянии pending с вызывающим среди решающих. Тот же отбор, что у списка с awaiting=me, — но число ТОЧНОЕ: страница ограничена пределом, и её длина ответила бы «столько или больше».\n\nЗаявка считается один раз, даже когда вызывающий решает по двум её шагам сразу — так бывает в параллельном режиме.\n\nТребует права vacancy · view. Запросу по ключу доступа этого мало: заявки считаются по участию вызывающего, участие — свойство человека, а не ключа, и ключу счётчик открывает только уровень all у vacancy · view — и у владельца ключа, и в потолке ключа; иначе 403. При таком уровне число сходится со списком awaiting=me по тому же ключу.\n\nОфферы, ждущие решения вызывающего, — отдельным полем offers и только в сессии человека (кабинет или встраивание портала): решающего оффера открывает участие, а у ключа его нет — ключу поля нет. count по-прежнему считает только заявки.",
        "responses": {
          "200": {
            "description": "Сколько ждёт решения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AwaitingCount"
                    }
                  }
                },
                "example": {
                  "data": {
                    "count": 3,
                    "offers": 2
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/decisions": {
      "get": {
        "operationId": "appDecisionQueue",
        "tags": [
          "Отклики"
        ],
        "summary": "Решения по кандидатам: моя очередь",
        "description": "Очередь вызывающего: собеседования, по итогам которых решает он — заказчик вакансии отклика на момент брони (пока заказчик не назван — автор вакансии). Строка появляется в конце забронированного слота и стоит в очереди, пока решение не принято; дольше ждущие — первыми. Показываются только активные отклики на незавершённых вакансиях: отклик, ушедший в rejected или hired, и завершённая вакансия снимают вопрос сами. Ждущая строка исчезает не только при отмене собеседования, но и при отказе отклику: возврат в работу старый запрос не воскрешает.\n\nСтрока — выжимка отклика ровно под решение: имя кандидата, должность, вакансия с номером (vacancyId, vacancyNumber), источник, ссылка на резюме, время встречи и собеседующие, момент, с которого решение ждёт (availableAt), и у открывшейся строки — совет ИИ (aiAdvice): рекомендация сохранённой сводки решения и дробь портрета, без текста сводки. Контактов кандидата и заметки рекрутера здесь нет. Запросу по ключу доступа aiAdvice — null: сводка решения доступна только из кабинета. «Ждёт N дней» клиент считает от availableAt. Имя собеседующего берётся у пользователя сервиса с тем же b24UserId; у сотрудника Битрикс24, который в сервис не входил, name — null.\n\nСтраница — до 50 строк; nextCursor ведёт на следующую, null — страница последняя.\n\nТребует права vacancy · view, но не уровня: решающему уровень к вакансиям и откликам может быть не выдан вовсе, и очередь от этого не пустеет — строки отбираются по решающему, а не по уровню. Запросу по ключу доступа этого мало: строка решающего — свойство человека, а не ключа, и ключу очередь открывает только уровень all у application · view — и у владельца ключа, и в потолке ключа; иначе 403. Уровня ниже all не хватает, потому что строки отбираются не по уровню: очередь отдала бы ключу отклики, которых он не видит. Ключ, чей потолок не содержит vacancy · view, тоже получает 403.\n\nНеобязательный vacancy сужает выдачу на сервере до выбранной вакансии перед ограничением списка. Пустое или отсутствующее значение сохраняет прежнюю выдачу. Несуществующая и чужая порталу вакансия дают одинаковый пустой список. Фильтр не требует отдельного просмотра вакансии или отклика и не расширяет доступ к строкам. Курсор должен принадлежать выбранной вакансии и вызывающему; чужой, неизвестный или относящийся к другой вакансии — 400 bad_request. Решение или отмена последней строки между страницами не делает её курсор недействительным. Без vacancy прежние курсоры остаются допустимыми. Счётчик GET /api/v1/decisions/count остаётся общим для вызывающего и не сужается этим фильтром.\n\nНеобязательный view (ready | waiting | all, по умолчанию ready) выбирает открывшиеся, ждущие конца встречи или все строки; строка несёт readyAt и ready. Счётчик GET /api/v1/decisions/count по-прежнему считает только открывшиеся.",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. Непрозрачный, чтобы форму курсора можно было сменить, не ломая контракт. Курсор относится к тому виду (view) и той вакансии (vacancy), с которыми выдан; страница продолжается от границы, выданной вместе с ним, даже если встречу между страницами перенесли. После решения или отмены строки остаётся допустимым. Курсоры, выданные раньше, принимаются по-прежнему.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vacancy",
            "in": "query",
            "required": false,
            "description": "Public UUID вакансии. Сужает видимые строки до этой вакансии до ограничения списка; не меняет права. Не задан или пуст — прежний список без фильтра. Несуществующая или чужая порталу вакансия — пустой список. Неверный UUID — 400 invalid_value (details.field = vacancy).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "description": "Какие ждущие решения показать: ready — открывшиеся (по умолчанию, прежняя очередь), waiting — ждущие конца встречи, all — все. Ранние строки несут readyAt и ready: false; решение по ним сервер отвергает 409 decision_not_ready. Неизвестное значение — 400 invalid_value (details.field = view).",
            "schema": {
              "type": "string",
              "enum": [
                "ready",
                "waiting",
                "all"
              ],
              "default": "ready"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница очереди",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DecisionQueueResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "decisions": [
                      {
                        "interviewId": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                        "applicationId": "0199d4c1-e2f3-4a5b-8c7d-6e5f40312233",
                        "candidateName": "Иванов Иван Петрович",
                        "position": "Оператор станков с ЧПУ",
                        "source": "hh",
                        "resumeUrl": "https://hh.ru/resume/4f1c2d",
                        "availableAt": "2026-09-21T08:00:00Z",
                        "readyAt": "2026-09-21T08:00:00Z",
                        "ready": true,
                        "startsAt": "2026-09-21T07:00:00Z",
                        "endsAt": "2026-09-21T08:00:00Z",
                        "tz": "Europe/Kaliningrad",
                        "attendees": [
                          {
                            "b24UserId": 15,
                            "name": "Одинцова Мария Павловна"
                          },
                          {
                            "b24UserId": 17,
                            "name": null
                          }
                        ]
                      },
                      {
                        "interviewId": "0199d4c1-77aa-4b2c-9d3e-5f6a7b8c9d0e",
                        "applicationId": "0199d4c1-88bb-4c3d-8e4f-6a7b8c9d0e1f",
                        "candidateName": "Петрова Анна Сергеевна",
                        "position": "Оператор станков с ЧПУ",
                        "source": "hh",
                        "resumeUrl": null,
                        "availableAt": "2026-09-25T09:00:00Z",
                        "readyAt": "2026-09-25T09:00:00Z",
                        "ready": false,
                        "startsAt": "2026-09-25T08:00:00Z",
                        "endsAt": "2026-09-25T09:00:00Z",
                        "tz": "Europe/Kaliningrad",
                        "attendees": [
                          {
                            "b24UserId": 15,
                            "name": "Одинцова Мария Павловна"
                          },
                          {
                            "b24UserId": 17,
                            "name": null
                          }
                        ]
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный UUID vacancy или неизвестный view — invalid_value с details.field = vacancy или view; курсор не разобрался, неизвестен, выдан другому виду, вакансии или решающему — bad_request.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "неверное значение поля",
                    "retryable": false,
                    "details": {
                      "field": "vacancy"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/decisions/count": {
      "get": {
        "operationId": "appDecisionCount",
        "tags": [
          "Отклики"
        ],
        "summary": "Решения по кандидатам: числа по видам очереди",
        "description": "Точные числа строк очереди вызывающего (GET /api/v1/decisions): count — можно решать сейчас, waiting — ждут конца встречи, total — все ожидающие решения. nextReadyAt — ближайший конец встречи среди ожидающих; по нему экран перечитывает счётчики. Числа и момент вычислены на один срез и не зависят от предела страницы.\n\nПрава — как у очереди: vacancy · view без уровня, а запросу по ключу доступа — ещё и уровень all у application · view.\n\nБез vacancy счётчик общий для вызывающего. Строка, снятая отменой собеседования или отказом отклику, в числа не входит. С vacancy числа относятся только к этой вакансии тем же отбором, что у GET /api/v1/decisions?vacancy=.",
        "responses": {
          "200": {
            "description": "Числа по видам очереди",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DecisionCount"
                    }
                  }
                },
                "example": {
                  "data": {
                    "count": 2,
                    "waiting": 1,
                    "total": 3,
                    "nextReadyAt": "2026-10-30T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный UUID vacancy — invalid_value с details.field = vacancy.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "неверное значение поля",
                    "retryable": false,
                    "details": {
                      "field": "vacancy"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": false,
            "description": "Public UUID вакансии. Считает только строки очереди этой вакансии; не меняет права. Не задан или пуст — общий счётчик. Несуществующая или чужая порталу вакансия — 0. Неверный UUID — 400 invalid_value (details.field = vacancy).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/decisions/{interviewId}": {
      "post": {
        "operationId": "appDecide",
        "tags": [
          "Отклики"
        ],
        "summary": "Решить по кандидату после собеседования",
        "description": "Ответ заказчика вакансии по собеседованию: fit — подходит, another_meeting — нужна ещё встреча, unfit — не подходит. Комментарий обязателен у unfit и необязателен у остальных; длина — до 4000 знаков. unfit у отклика на new или interview в той же транзакции переводит его в rejected; у отклика на offer или в hired записывается только вердикт — отказывать ли ему, решает рекрутер. Отказ отклику (и этот, и любой другой) снимает его остальные ждущие запросы, решённые остаются; решение по отказанному отклику: ждущего запроса нет — 409 not_decider, запрос уже решён — 409 decision_taken. Вернув отклик в работу, старый запрос не воскресить.\n\nРешение одно на собеседование: следующий круг — это новое приглашение (POST /api/v1/interviews с applicationId), и его бронь заводит новый запрос. Решать можно только после конца забронированного слота.\n\nТребует права vacancy · view — а не права на отклик: видеть отклик и решать по кандидату — разные права. Запросу по ключу доступа этого мало: строка решающего — свойство человека, а не ключа, и ключу решение открывает только уровень all у application · edit — и у владельца ключа, и в потолке ключа; иначе 403. Такой ключ и без очереди вправе перевести в отказ любой отклик портала. Решает только тот, чьё решение ждёт, и сервер сверяет это в самой записи: два решения, отправленные одновременно, записывают одно, опоздавшее получает decision_taken. Отказы 409, а не 403: право на очередь у вызывающего есть, а не позволяет ему состояние запроса.",
        "parameters": [
          {
            "name": "interviewId",
            "in": "path",
            "required": true,
            "description": "public_id собеседования — тот же, что interviewId в строке очереди.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Решение записано."
          },
          "400": {
            "description": "Тело или interviewId не разобрались — код bad_request. invalid_value — вердикта нет в словаре (поле verdict) либо комментарий не годится: пуст у unfit или длиннее 4000 знаков (поле comment).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "decision_not_ready — забронированный слот ещё не кончился, решать рано. decision_taken — решение по этому собеседованию уже принято. not_decider — решение вызывающему не принадлежит: решает другой человек или запроса по этому собеседованию нет вовсе; эти два случая наружу не различаются намеренно. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения.",
            "x-error-codes": [
              "decision_not_ready",
              "decision_taken",
              "not_decider",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies": {
      "get": {
        "operationId": "appCompanies",
        "tags": [
          "Справочники"
        ],
        "summary": "Карточки компании портала",
        "description": "Все карточки в порядке названия, ВКЛЮЧАЯ архивные: экран хозяина показывает всё, иначе разархивировать было бы нечего.\n\nТребует права company_card · view.",
        "responses": {
          "200": {
            "description": "Карточки компании",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "companies": [
                      {
                        "id": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                        "title": "Ромашка Технолоджис",
                        "summary": "Производим оборудование для теплиц.",
                        "siteUrl": "https://romashka.example",
                        "city": "Калининград",
                        "industry": "Машиностроение",
                        "address": "ул. Тепличная, 5",
                        "headcount": "100–500",
                        "contactPhone": "+7 4012 000-000",
                        "contactEmail": "hr@romashka.example",
                        "logoFileUrl": "/api/v1/companies/8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c/logo?v=1791201600",
                        "isDefault": true,
                        "archived": false,
                        "createdAt": "2026-09-23T10:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateCompany",
        "tags": [
          "Справочники"
        ],
        "summary": "Завести карточку компании",
        "description": "Заводит профиль: обязательно только название, остальные поля принимает тем же запросом. Если это единственный активный профиль портала и умолчания ещё нет, он становится умолчанием сам.\n\nКод forbidden также у запроса ключом API с полем logoFileId: логотип привязывают только из кабинета.\n\nТребует права company_card · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Карточка заведена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Company"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                    "title": "Ромашка Технолоджис",
                    "summary": "Производим оборудование для теплиц.",
                    "description": "Производственная компания полного цикла: от чертежа до монтажа под ключ.",
                    "benefits": "ДМС после испытательного срока, гибкое начало дня, компенсация обучения.",
                    "siteUrl": "https://romashka.example",
                    "city": "Калининград",
                    "industry": "Машиностроение",
                    "address": "ул. Тепличная, 5",
                    "headcount": "100–500",
                    "contactPhone": "+7 4012 000-000",
                    "contactEmail": "hr@romashka.example",
                    "logoFileUrl": "/api/v1/companies/8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c/logo?v=1791201600",
                    "isDefault": true,
                    "archived": false,
                    "createdAt": "2026-09-23T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request — тело не разобралось или несёт лишний ключ, либо строковое поле пришло не строкой. Код invalid_value — значение поля не прошло проверку (§ 3.3–3.7 спеки профилей компании): details.field называет поле API, details.reason — одно из too_long, control_char, empty, bad_url, bad_contact. Причина file_rejected у поля logoFileId — файл не годится логотипом: его нет в портале, его загрузил другой человек, загрузка не подтверждена, он уже где-то привязан или это не картинка в пределе.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "У портала уже максимум профилей — код company_limit. details.reason: active — активных уже некуда добавить, уберите лишний в архив; total — профилей уже некуда добавить вовсе, включая архивные, удалите ненужный архивный профиль (DELETE /companies/{id}).",
            "x-error-codes": [
              "company_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies/{id}": {
      "get": {
        "operationId": "appCompany",
        "tags": [
          "Справочники"
        ],
        "summary": "Карточка компании",
        "description": "Требует права company_card · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка компании",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Company"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                    "title": "Ромашка Технолоджис",
                    "summary": "Производим оборудование для теплиц.",
                    "description": "Производственная компания полного цикла: от чертежа до монтажа под ключ.",
                    "benefits": "ДМС после испытательного срока, гибкое начало дня, компенсация обучения.",
                    "siteUrl": "https://romashka.example",
                    "city": "Калининград",
                    "industry": "Машиностроение",
                    "address": "ул. Тепличная, 5",
                    "headcount": "100–500",
                    "contactPhone": "+7 4012 000-000",
                    "contactEmail": "hr@romashka.example",
                    "logoFileUrl": "/api/v1/companies/8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c/logo?v=1791201600",
                    "isDefault": true,
                    "archived": false,
                    "createdAt": "2026-09-23T10:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — карточки с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appUpdateCompany",
        "tags": [
          "Справочники"
        ],
        "summary": "Правка карточки компании",
        "description": "Правка ЦЕЛИКОМ: пустая строка стирает значение поля.\n\nКод forbidden также у запроса ключом API с полем logoFileId: логотип привязывают только из кабинета.\n\nТребует права company_card · edit. Local save remains available while synchronization is stopped; local success is not external delivery confirmation. Existing grants, key ceilings and error envelope apply. Requests containing logoDraftUpdate require a cabinet cookie; bearer requests are rejected with forbidden. Requests omitting it keep the existing 204 response.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returned only for a cabinet cookie request containing logoDraftUpdate; null means no update was scheduled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "logoDraftUpdateId"
                      ],
                      "properties": {
                        "logoDraftUpdateId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "logoDraftUpdateId": null
                  }
                }
              }
            }
          },
          "204": {
            "description": "Карточка сохранена; logoDraftUpdate не передан."
          },
          "400": {
            "description": "Код bad_request — тело не разобралось, несёт лишний или отсутствующий ключ (правка целиком называет каждое поле), либо значение не того типа. Код invalid_value — значение поля не прошло проверку (§ 3.3–3.7 спеки профилей компании): details.field называет поле API, details.reason — одно из too_long, control_char, empty, bad_url, bad_contact. Причина file_rejected у поля logoFileId — файл не годится логотипом: его нет в портале, его загрузил другой человек, загрузка не подтверждена, он уже где-то привязан или это не картинка в пределе.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — карточки с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "company_logo_drafts_stale — cookie request supplied an outdated expectedLogoRevision.",
            "x-error-codes": [
              "company_logo_drafts_stale"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appDeleteCompany",
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить карточку компании",
        "description": "Удаляет архивный профиль, не выбранный ни у одной вакансии и ни у одного шаблона вакансии. Удаления у активного профиля нет: сначала — архив (POST .../archive). Если после удаления в портале остаётся ровно один активный профиль без умолчания, он получает отметку сам.\n\nТребует права company_card · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Профиль удалён."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — карточки с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "company_active — профиль ещё активен, удаляется только архивный: сначала уберите его в архив.\n\ncompany_in_use — профиль выбран у вакансии или шаблона вакансии и остаётся связан, пока они на него ссылаются.",
            "x-error-codes": [
              "company_active",
              "company_in_use"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies/{id}/default": {
      "post": {
        "operationId": "appCompanyDefault",
        "tags": [
          "Справочники"
        ],
        "summary": "Сделать карточкой по умолчанию",
        "description": "Карточка портала по умолчанию действует у вакансий, у которых своей не выбрано. Прежнее умолчание снимается той же операцией: активных умолчаний в портале не больше одного, но может не быть ни одного.\n\nТребует права company_card · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Карточка стала умолчанием портала; прежнее снято."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — карточки с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Архивный профиль умолчанием не станет — код company_archived: сначала верните его из архива (POST /companies/{id}/archive).",
            "x-error-codes": [
              "company_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies/{id}/archive": {
      "post": {
        "operationId": "appCompanyArchive",
        "tags": [
          "Справочники"
        ],
        "summary": "Убрать карточку в архив или вернуть",
        "description": "Архивная карточка не предлагается в пикере вакансии, но остаётся видимой у тех, где уже выбрана. Архивация профиля по умолчанию снимает отметку. Если после архивации или возврата из архива в портале остаётся ровно один активный профиль без умолчания, он получает отметку сам.\n\nТребует права company_card · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyArchiveRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Признак архива сохранён."
          },
          "400": {
            "description": "Код bad_request — тело не разобралось, несёт лишний или отсутствующий ключ, либо archived не булево: у архивации нет состояния «не задано».",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — карточки с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "У портала уже максимум активных профилей — код company_limit, details.reason всегда active: уберите другой профиль в архив, прежде чем возвращать этот.",
            "x-error-codes": [
              "company_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/company": {
      "put": {
        "operationId": "appVacancyCompany",
        "tags": [
          "План найма"
        ],
        "summary": "Выбрать профиль компании у вакансии",
        "description": "Чьё лицо показывать соискателю. null снимает выбор, и тогда действует профиль портала по умолчанию. Выбрать можно только активный профиль своего портала. Профиль, ушедший в архив, у вакансии остаётся, и повторный выбор его же — холостое действие; выбор, который ничего не меняет, отвечает 204, журнал не пишет и updated_at вакансии не двигает.\n\nПрофиль компании у шаблона всегда закреплён: у вакансии с шаблоном ниже права vacancy · edit на уровне all выбор, отличный от текущего, — 400 invalid_value с details.field = companyId; повтор текущего — холостое действие.\n\nТребует права vacancy · edit — а не company_card: это правка вакансии, а не ведение справочника, и рекрутеру право на справочник для неё не нужно.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyCompanyRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Профиль выбран либо выбор снят. Выбор, который ничего не меняет, — тоже 204."
          },
          "400": {
            "description": "bad_request — тело не разобралось: нет ключа companyId, лишний ключ или значение не строка и не null. invalid_value с details.field = companyId — неразборный адрес, профиль другого портала или профиля с таким адресом нет; details.reason у этого отказа нет. Тот же ответ — выбор, отличный от профиля вакансии с шаблоном, ниже vacancy · edit на уровне all.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — вакансии нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Профиль в архиве, а у вакансии стоит другой — код company_archived: архивный профиль заново не выбирается. Код vacancy_archived: вакансия в архиве — профиль у неё не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "company_archived",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/brief": {
      "get": {
        "operationId": "appVacancyBrief",
        "tags": [
          "План найма"
        ],
        "summary": "Бриф вакансии",
        "description": "То, что рекрутер снял с заказчика. Пустой бриф — законное состояние вакансии, а не отсутствие строки: чтение отвечает документом со всеми null, а не 404.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Бриф вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyBrief"
                    }
                  }
                },
                "example": {
                  "data": {
                    "tasks": null,
                    "conditions": null,
                    "schedule": null,
                    "hiringSteps": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — вакансии с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSaveVacancyBrief",
        "tags": [
          "План найма"
        ],
        "summary": "Сохранить: бриф вакансии",
        "description": "Запись ЦЕЛИКОМ: пустое поле стирает значение.\n\nВакансию с шаблоном (заведённую по templateId) ниже права vacancy · edit на уровне all судят режимы ТЕКУЩЕГО шаблона: присланное поле с режимом fixed, отличное от текущего значения вакансии, — 400 invalid_value с details.field; равное текущему — не нарушение, поэтому документ целиком присылают с закреплёнными полями как есть. Поле отказа — имя в теле: tasks, conditions, schedule, hiringSteps, workFormat.\n\nТребует права vacancy · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyBrief"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Сохранено."
          },
          "400": {
            "description": "bad_request — тело не разобралось. invalid_value с details.field — поле, закреплённое шаблоном вакансии и присланное отличным от текущего. Код validation_error: текст длиннее 10000 знаков — details.field и details.reason too_long.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — вакансии с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код vacancy_archived: вакансия в архиве — бриф не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/candidate-profile": {
      "get": {
        "operationId": "appVacancyCandidateProfile",
        "tags": [
          "План найма"
        ],
        "summary": "Профиль кандидата",
        "description": "Портрет того, кого ищут. Пустой профиль — законное состояние вакансии, как и пустой бриф.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Профиль кандидата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyCandidateProfile"
                    }
                  }
                },
                "example": {
                  "data": {
                    "experience": null,
                    "skills": null,
                    "education": null,
                    "stoppers": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — вакансии с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSaveVacancyCandidateProfile",
        "tags": [
          "План найма"
        ],
        "summary": "Сохранить: профиль кандидата",
        "description": "Запись ЦЕЛИКОМ: пустое поле стирает значение.\n\nВакансию с шаблоном (заведённую по templateId) ниже права vacancy · edit на уровне all судят режимы ТЕКУЩЕГО шаблона: присланное поле с режимом fixed, отличное от текущего значения вакансии, — 400 invalid_value с details.field; равное текущему — не нарушение, поэтому документ целиком присылают с закреплёнными полями как есть. Поле отказа — имя в теле: experience, skills, education, stoppers.\n\nТребует права vacancy · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyCandidateProfile"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Сохранено."
          },
          "400": {
            "description": "bad_request — тело не разобралось. invalid_value с details.field — поле, закреплённое шаблоном вакансии и присланное отличным от текущего. Код validation_error: текст длиннее 10000 знаков — details.field и details.reason too_long.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — вакансии с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код vacancy_archived: вакансия в архиве — профиль кандидата не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels": {
      "get": {
        "operationId": "appVacancyChannels",
        "tags": [
          "План найма"
        ],
        "summary": "Тексты вакансии по каналам",
        "description": "Строка на КАЖДЫЙ канал словаря, даже когда под него ещё не писали: экран обязан предложить пустой канал, и достраивать список на клиенте значило бы завести второй словарь каналов.\n\nexternalUrl площадок с публикацией через API (hh, avito) приходит только с правом публикации vacancy_publication · edit к вакансии; без него — null, и ключу API тоже. Это сужение прежнего обещания: раньше ссылка приходила всем с vacancy · view. Ссылка Telegram приходит, как прежде.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Тексты по каналам",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyChannelListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "channels": [
                      {
                        "channel": "telegram",
                        "headline": "Ищем оператора станка ЧПУ",
                        "body": "Третья смена, обучение за счёт компании.",
                        "state": "draft",
                        "publishedAt": null,
                        "externalUrl": null,
                        "limit": 4078,
                        "marks": true,
                        "source": "manual",
                        "paid": false,
                        "added": true,
                        "membershipRevision": 1,
                        "unsentChanges": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — вакансии с таким адресом нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/{channel}": {
      "put": {
        "operationId": "appSaveVacancyChannel",
        "tags": [
          "План найма"
        ],
        "summary": "Сохранить текст под канал",
        "description": "Публикацию не трогает: текст правят и до неё, и после, а отметка — отдельное событие.\n\nДлина тела сверяется с пределом канала (поле limit в списке): текст с превышением отвергается, иначе человек узнал бы о пределе на стороне площадки, вставив уже свёрстанное.\n\nУ площадок, чьё описание — разметка (hh, Авито), body — Markdown: сервер сам собирает из него HTML только из тегов площадки. Текст, который не разбирается в пределах разбора или пуст после него, отвергается 400 invalid_value с details.reason.\n\nТребует права vacancy · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "description": "Код канала.",
            "schema": {
              "type": "string",
              "enum": [
                "bitrix24",
                "telegram",
                "avito",
                "hh"
              ]
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется для канала telegram. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyChannelSaveRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Текст сохранён."
          },
          "400": {
            "description": "invalid_value — тело не разобралось либо текст длиннее предела канала; поле названо в details. Причины текста площадки в details.reason: markdown_too_complex — строка длиннее 16 КБ, слишком глубокая вложенность, слишком много символов разметки или адресов ссылок; markdown_empty — после разбора не осталось текста; markdown_invalid — текст не разобрался. channel_contacts — в заголовке или тексте поста Telegram телефон или почта: кандидаты откликаются через кнопку (details.field = body).",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "channel_contacts"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "404": {
            "description": "not_found — вакансии нет, она вне уровня смотрящего, либо код канала не из словаря.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "stale_form — версия участия отсутствует после restore или устарела; channel_removed — площадка скрыта. vacancy_archived — вакансия в архиве: текст площадки не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore); снятие публикаций работает. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "stale_form",
              "channel_removed",
              "common_headline_missing",
              "vacancy_archived",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/{channel}/publish": {
      "post": {
        "operationId": "appPublishVacancyChannel",
        "tags": [
          "План найма"
        ],
        "summary": "Отметить публикацию канала или снять её",
        "description": "ОТМЕЧАЕТ, а не публикует: человек размещает текст руками на стороне канала, а здесь фиксирует факт и ссылку. Каналы, которые публикуют сами, ручной отметки не принимают: Битрикс24 — ни в одну сторону (409 channel_published_by_api), Telegram с подключённым каналом бота — публикацию (409 telegram_publish_via_bot). Поле marks в списке каналов говорит, принимает ли канал отметку.\n\nПубликовать канал без текста нельзя: отметка утверждала бы, что размещение состоялось.\n\nСнятие уносит отметку целиком — строка, сохранившая время публикации, врала бы про то, что опубликована.\n\nНа закрытой вакансии новую публикацию не отмечают (409 channel_vacancy_closed); снять отметку можно — это ручное подтверждение снятия, дата первого размещения сохраняется.\n\nПубликацию площадки через API отметка не меняет (409 channel_published_by_api). Поверх неудачной отправки через API отметку ставят, только когда новая публикация недоступна из-за подключения, иначе — 409 channel_publish_available; снимают всегда.\n\nТребует права vacancy · edit. Следствие названо вслух: право править вакансию и право показать её миру — одно право.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "description": "Код канала.",
            "schema": {
              "type": "string",
              "enum": [
                "bitrix24",
                "telegram",
                "avito",
                "hh"
              ]
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется для канала telegram. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyChannelPublishRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Отметка публикации сохранена либо снята."
          },
          "400": {
            "description": "invalid_value — тело не разобралось.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "404": {
            "description": "not_found — вакансии нет, она вне уровня смотрящего, либо код канала не из словаря.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "channel_empty — у канала нет ни заголовка, ни текста: публиковать нечего; channel_published_by_api — вакансия опубликована на этой площадке через API (или отклонена ею): ручная отметка её не меняет ни в одну сторону; channel_publish_available — прошлая отправка через API не удалась, а публикация через API доступна: отметку (published = true) поверх неё не ставят, путь назад — опубликовать снова; снятие отметки (published = false) разрешено. Отметка поверх неудачной отправки ставится, только когда новая публикация недоступна из-за подключения: площадка не настроена, нет профиля компании или привязки, подключение надо переподключить; channel_vacancy_closed — вакансия закрыта: новую публикацию (published = true) не отмечают, снятие отметки (published = false) разрешено. stale_form — версия участия отсутствует после restore или устарела; channel_removed — площадка скрыта. telegram_post_live — у публикации Telegram живой пост; telegram_channel_lost — бот потерял права в канале, переподключите его; telegram_publish_via_bot — канал подключён, публикует Telegram-бот в блоке «Площадки». vacancy_archived — вакансия в архиве: новую публикацию (published = true) не отмечают, пока её не вернут (POST /api/v1/vacancies/{id}/restore); архивная завершённая отвечает им, а не channel_vacancy_closed; снятие отметки (published = false) разрешено. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "channel_empty",
              "channel_published_by_api",
              "telegram_post_live",
              "telegram_channel_lost",
              "telegram_publish_via_bot",
              "channel_vacancy_closed",
              "channel_publish_available",
              "stale_form",
              "channel_removed",
              "vacancy_archived",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-calls": {
      "get": {
        "operationId": "appListCustomerCalls",
        "tags": [
          "План найма"
        ],
        "summary": "Созвоны вакансии со звонками и разборами",
        "description": "Назначенные созвоны с заказчиком этой вакансии по началу, у каждого — звонки Follow-up, которые сервис забрал из чата встречи, и разбор каждого звонка в пункты брифа.\n\nСостояние созвона: waiting — сервис ещё ждёт звонков; unavailable — у портала нет Follow-up; relogin — вебхук назначившего протух или выпущен без нужных скоупов, и опрос стоит, пока тот не войдёт в сервис заново; no_calls — окно опроса закрыто, звонков не было; closed — закрыто со звонками.\n\nРазбор звонка: none — не запускали; running — идёт; done — готов, в items пункты; failed — не удался, код в reason. Пункт — предложение для поля брифа или профиля кандидата (field) с дословной цитатой из расшифровки (quote) и её таймкодом от начала звонка (at, ЧЧ:ММ:СС). truncated — расшифровка длиннее предела, и разобрано только начало.\n\nПолной расшифровки в ответе нет: наружу идут только пункты с цитатами. Идентификаторов Битрикс24 нет тоже.\n\nТребует права vacancy · view.\n\nСоздание и доставка участников представлены отдельными status, creationState, participants. У создающегося либо неопределённого созвона state отсутствует: Follow-up ещё не запущен.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Созвоны вакансии по началу; пустой список — созвонов не назначали.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "publicId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                        "startsAt": "2026-10-01T07:00:00Z",
                        "endsAt": "2026-10-01T07:45:00Z",
                        "tz": "Europe/Moscow",
                        "state": "closed",
                        "calls": [
                          {
                            "publicId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                            "startedAt": "2026-10-01T07:02:00Z",
                            "durationSeconds": 1830,
                            "analysis": {
                              "state": "done",
                              "reason": null,
                              "truncated": false,
                              "items": [
                                {
                                  "field": "schedule",
                                  "text": "Пятидневка, с 9 до 18.",
                                  "quote": "работаем пять через два, с девяти до шести",
                                  "at": "00:03:10"
                                }
                              ]
                            }
                          },
                          {
                            "publicId": "c42d9e1a-6b3f-4e70-8a25-f19b07d6c3e8",
                            "startedAt": "2026-10-01T07:40:00Z",
                            "durationSeconds": 95,
                            "analysis": {
                              "state": "failed",
                              "reason": "no_transcript",
                              "truncated": false,
                              "items": []
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateCustomerCall",
        "tags": [
          "План найма"
        ],
        "summary": "Назначить созвон с заказчиком вакансии",
        "description": "Создаёт встречу и связанный чат от имени исходного организатора. Участники — организатор, заказчик и доступный рекрутёр; совпадающие роли не дублируются. DESCRIPTION нового чата содержит подпись и постоянную ссылку на текущий план. Битрикс24 публикует описание первым сообщением. Требует vacancy · edit на эту вакансию. Неизвестный исход не разрешает создавать повторную встречу или чат.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Созвон назначен: встреча и чат встречи созданы.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCall"
                    }
                  }
                },
                "example": {
                  "data": {
                    "publicId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                    "startsAt": "2026-10-01T07:00:00Z",
                    "endsAt": "2026-10-01T07:45:00Z",
                    "tz": "Europe/Moscow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось (bad_request) или поле не прошло проверку — код validation_error, details.field называет какое: startsAt не в будущем, дальше года вперёд или не RFC 3339, durationMin вне 15–240 или не кратна 15, tz не зона IANA.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Состояние не позволяет назначить созвон, и коды различают почему.\n\nvacancy_not_ready — вакансия ещё не согласована или отклонена.\n\ncustomer_not_in_b24 — у заказчика нет учётной записи Битрикс24: ни встречи, ни чата с ним не создать.\n\nduplicate — у вызывающего уже есть созвон по этой вакансии на это время.\n\nb24_not_ready — у вызывающего нет живого личного вебхука со скоупами calendar и im; details.reason: scope_missing (вебхук выпущен до расширения набора) или webhook_dead (вебхука нет или он протух). Оба лечатся входом в сервис заново.\n\nvacancy_archived — вакансия в архиве: созвон по ней не назначается, пока её не вернут (POST /api/v1/vacancies/{id}/restore). Отказ — до календаря Битрикс24: встреча и чат не создаются.\n\ncreation_unknown — создание не подтверждено; details.publicId и details.creationState указывают исходную попытку. Перечитайте список: повторное создание запрещено. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "b24_not_ready",
              "customer_not_in_b24",
              "duplicate",
              "vacancy_archived",
              "vacancy_not_ready",
              "creation_unknown",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "502": {
            "description": "Код b24_unavailable: портал не создал встречу или чат встречи. Причина портала наружу не уходит. retryable: false — при отказе чата встреча могла остаться в календаре, и слепой повтор завёл бы вторую.",
            "x-error-codes": [
              "b24_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-followups/{followupId}/analysis": {
      "post": {
        "operationId": "appAnalyzeCallFollowup",
        "tags": [
          "План найма"
        ],
        "summary": "Разобрать звонок созвона в пункты брифа",
        "description": "Ставит звонок Follow-up в разбор: сервис фоном превращает расшифровку в пункты для полей брифа и профиля кандидата с проверенными цитатами. Ответ 202 без тела; итог — в GET /api/v1/vacancies/{id}/customer-calls, в analysis звонка.\n\nПока разбор идёт, повтор ничего не меняет и отвечает тем же 202. Разом у портала идёт один разбор: пока идёт разбор другого звонка, ответ — 409 analysis_busy, запустить можно после его итога. После done, failed или зависшего разбора повтор разбирает звонок заново, и прежний результат стирается.\n\nМодель — ИИ, подключённый к порталу. Не подключён — отказ запуска: 409 not_connected, разбор в очередь не ставится. Ключ отозван или исчерпана квота — это не отказ запуска, а итог разбора: failed с кодом в reason.\n\nТребует права vacancy · edit на эту вакансию.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "followupId",
            "in": "path",
            "required": true,
            "description": "publicId звонка из calls созвона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Звонок в разборе — поставлен сейчас или уже шёл."
          },
          "400": {
            "description": "Код bad_request: id или followupId не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо звонка нет у этой вакансии.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код analysis_busy: у портала уже идёт разбор другого звонка. Код not_connected: портал не подключён к ИИ — разбор не поставлен, подключите ИИ и повторите. Код vacancy_archived: вакансия в архиве — новый разбор звонка не ставится, пока её не вернут (POST /api/v1/vacancies/{id}/restore); разбор, поставленный до архива, дописывает итог, если календарь не подтвердил отмену встречи. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "analysis_busy",
              "not_connected",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_connected",
                    "message": "портал не подключён к вайбкоду",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/transcripts": {
      "get": {
        "operationId": "appListVacancyTranscripts",
        "tags": [
          "План найма"
        ],
        "summary": "Расшифровки созвонов вакансии",
        "description": "Расшифровки созвонов с заказчиком этой вакансии, новыми первыми: звонки Follow-up назначенных созвонов (source followup — начало и длительность звонка) и расшифровки, вставленные рекрутёром руками (source manual — день звонка). Текстов в списке нет: расшифровка целиком — GET /api/v1/vacancies/{id}/transcripts/{transcriptId}.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Расшифровки вакансии; пустой список — их нет.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranscriptListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                        "source": "followup",
                        "callDate": null,
                        "startedAt": "2026-09-28T07:02:00Z",
                        "durationSeconds": 1830
                      },
                      {
                        "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                        "source": "manual",
                        "callDate": "2026-09-25",
                        "startedAt": null,
                        "durationSeconds": 0
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appAddVacancyTranscript",
        "tags": [
          "План найма"
        ],
        "summary": "Добавить расшифровку созвона руками",
        "description": "Добавляет расшифровку созвона, вставленную рекрутёром: день звонка и текст. Текст хранится зашифрованным; в журнал вакансии пишется только день звонка.\n\nОтказ валидации — 400 validation_error с details.field и details.reason: text — empty (пусто или одни пробелы) или too_long (длиннее 60000 знаков); callDate — required (не прислан) или future (позже завтрашнего дня по UTC); transcripts — too_many (у вакансии уже 50 расшифровок, вставленных руками: удалите ненужную). callDate не в форме ГГГГ-ММ-ДД — bad_request.\n\nТекст уходит в модель как вставлен — с именами и контактами, если они в нём есть.\n\nТребует права vacancy · edit на эту вакансию.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Расшифровка добавлена.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TranscriptItem"
                    }
                  }
                },
                "example": {
                  "data": {
                    "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                    "source": "manual",
                    "callDate": "2026-09-25",
                    "startedAt": null,
                    "durationSeconds": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело не разобралось или callDate не дата. Код validation_error: поле не прошло проверку — details.field и details.reason.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "значение поля не принято",
                    "retryable": false,
                    "details": {
                      "field": "text",
                      "reason": "too_long"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код vacancy_archived: вакансия в архиве — расшифровки к ней не добавляются, пока её не вернут (POST /api/v1/vacancies/{id}/restore). Удаление расшифровки работает и на архиве.",
            "x-error-codes": [
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/transcripts/{transcriptId}": {
      "get": {
        "operationId": "appVacancyTranscript",
        "tags": [
          "План найма"
        ],
        "summary": "Расшифровка созвона целиком",
        "description": "Расшифровка целиком: у ручной — text, у звонка Follow-up — lines, реплики с таймкодом от начала звонка и ролью говорящего (recruiter — рекрутёр, организатор созвона; customer — заказчик; participant — прочие). Имён говорящих нет. Расшифровка, которую сервер не смог расшифровать (сменился ключ шифрования), приходит с text и lines null.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "description": "transcriptId из списка расшифровок вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Расшифровка.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Transcript"
                    }
                  }
                },
                "example": {
                  "data": {
                    "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                    "source": "followup",
                    "callDate": null,
                    "startedAt": "2026-09-28T07:02:00Z",
                    "durationSeconds": 1830,
                    "text": null,
                    "lines": [
                      {
                        "at": "00:00:05",
                        "role": "recruiter",
                        "text": "Какие задачи у человека?"
                      },
                      {
                        "at": "00:00:12",
                        "role": "customer",
                        "text": "Наладка станков с ЧПУ, две смены."
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id или transcriptId не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой расшифровки у вакансии нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appDeleteVacancyTranscript",
        "tags": [
          "План найма"
        ],
        "summary": "Удалить ручную расшифровку",
        "description": "Удаляет расшифровку, добавленную руками, — строкой, без следа текста; в журнал вакансии пишется день звонка. Расшифровку звонка Follow-up удалить нельзя: она приходит из созвона — 409 transcript_readonly. Версии брифа и портрета, собранные с ней, помечают её удалённой.\n\nТребует права vacancy · edit на эту вакансию.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "transcriptId",
            "in": "path",
            "required": true,
            "description": "transcriptId из списка расшифровок вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Удалена."
          },
          "400": {
            "description": "Код bad_request: id или transcriptId не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой расшифровки у вакансии нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код transcript_readonly: это расшифровка звонка Follow-up, она не удаляется.",
            "x-error-codes": [
              "transcript_readonly"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/brief/versions": {
      "get": {
        "operationId": "appBriefVersions",
        "tags": [
          "План найма"
        ],
        "summary": "Версии брифа",
        "description": "Версии брифа новыми первыми и адрес основной. Версия появляется при каждом сохранении текстов (source manual), удачной генерации (ai) и при первом сохранении документа, записанного до версий (import); хранится не больше 30, старейшие неосновные уходят. Текстов в списке нет — они в GET /api/v1/vacancies/{id}/brief/versions/{versionId}. У версии генерации — пожелания (prePrompt), расшифровки входа (deleted — расшифровки больше нет у вакансии), truncated — во вход вошло не всё, mainUnreadable — основной бриф был недоступен. Версия, которую сервер не смог расшифровать, — readable false, без этих полей.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Версии документа; пустой список и mainVersionId null — версий нет.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocVersionList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "mainVersionId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                    "items": [
                      {
                        "publicId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                        "number": 2,
                        "source": "ai",
                        "main": true,
                        "readable": true,
                        "createdAt": "2026-09-28T08:15:00Z",
                        "author": {
                          "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                          "name": "Смирнова Анна Сергеевна"
                        },
                        "prePrompt": "Укажи вилку из созвона.",
                        "transcripts": [
                          {
                            "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                            "source": "followup",
                            "date": "2026-09-28",
                            "deleted": false
                          },
                          {
                            "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                            "source": "manual",
                            "date": "2026-09-25",
                            "deleted": true
                          }
                        ],
                        "truncated": false,
                        "mainUnreadable": false
                      },
                      {
                        "publicId": "6e0f1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
                        "number": 1,
                        "source": "manual",
                        "main": false,
                        "readable": true,
                        "createdAt": "2026-09-20T10:00:00Z",
                        "author": {
                          "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                          "name": "Смирнова Анна Сергеевна"
                        },
                        "prePrompt": null,
                        "transcripts": [],
                        "truncated": false,
                        "mainUnreadable": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/brief/versions/{versionId}": {
      "get": {
        "operationId": "appBriefVersion",
        "tags": [
          "План найма"
        ],
        "summary": "Версия брифа с текстами",
        "description": "Версия брифа с текстами: fields — tasks, conditions, schedule, hiringSteps, пустое поле — null. Версия, которую сервер не смог расшифровать, — 409 version_unreadable.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "publicId версии из списка версий.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Версия.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocVersionDetail"
                    }
                  }
                },
                "example": {
                  "data": {
                    "publicId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                    "number": 2,
                    "source": "ai",
                    "main": true,
                    "readable": true,
                    "createdAt": "2026-09-28T08:15:00Z",
                    "author": {
                      "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                      "name": "Смирнова Анна Сергеевна"
                    },
                    "prePrompt": "Укажи вилку из созвона.",
                    "transcripts": [
                      {
                        "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                        "source": "followup",
                        "date": "2026-09-28",
                        "deleted": false
                      },
                      {
                        "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                        "source": "manual",
                        "date": "2026-09-25",
                        "deleted": true
                      }
                    ],
                    "truncated": false,
                    "mainUnreadable": false,
                    "fields": {
                      "tasks": "Наладка и обслуживание станков с ЧПУ.",
                      "conditions": null,
                      "schedule": "Две смены, 2/2.",
                      "hiringSteps": "Звонок, собеседование с мастером цеха."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id или versionId не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой версии у документа нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код version_unreadable: версию не удалось расшифровать (сменился ключ шифрования).",
            "x-error-codes": [
              "version_unreadable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/brief/versions/{versionId}/main": {
      "post": {
        "operationId": "appMakeBriefVersionMain",
        "tags": [
          "План найма"
        ],
        "summary": "Сделать версию брифа основной",
        "description": "Делает версию основной: её тексты становятся текстами документа, новая версия не создаётся. Регион, профессия и формат работы не меняются. Событие уходит в ленту вакансии. Вакансию с шаблоном ниже права vacancy · edit на уровне all судят режимы шаблона, как PUT документа: текст версии, отличный от закреплённого (fixed), — 400 invalid_value с details.field. Версия уже основная — 204 без записи.\n\nТребует права vacancy · edit на эту вакансию.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "publicId версии из списка версий.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Версия основная."
          },
          "400": {
            "description": "Код bad_request: id или versionId не идентификатор. Код invalid_value: текст версии расходится с полем, закреплённым шаблоном, — details.field.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой версии у документа нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код version_unreadable: версию не удалось расшифровать — основной её не сделать. Код vacancy_archived: вакансия в архиве — основная версия брифа не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "version_unreadable",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/brief/generation": {
      "get": {
        "operationId": "appBriefGeneration",
        "tags": [
          "План найма"
        ],
        "summary": "Генерация брифа: статус",
        "description": "Состояние фоновой генерации брифа: none — не запускали; running — идёт; done — готово, versionId — адрес версии, ставшей основной; failed — не удалось, код в reason. Зависшая генерация читается как failed с reason timeout. prePrompt — сохранённые пожелания рекрутёра (пустая строка — их нет): их подставляет форма следующего запуска.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Генерация документа.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocGeneration"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "done",
                    "reason": null,
                    "prePrompt": "Укажи вилку из созвона.",
                    "finishedAt": "2026-09-28T08:15:00Z",
                    "versionId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appStartBriefGeneration",
        "tags": [
          "План найма"
        ],
        "summary": "Обновить бриф с ИИ",
        "description": "Ставит фоновую генерацию брифа из данных вакансии, основного брифа и отмеченных расшифровок (transcripts — их transcriptId; пусто — без расшифровок). Пожелания (prePrompt) сохраняются у вакансии и уходят в модель отдельно от данных: формат, правила и предел поля главнее их. Ответ 202 без тела; статус — GET /api/v1/vacancies/{id}/brief/generation. Удачный итог — новая основная версия; поля, закреплённые шаблоном, берутся из шаблона, пустое поле ответа не стирает текущее.\n\nРазом у портала идёт одна генерация. Отказы запуска ничего не сохраняют: 409 generation_running — этот документ уже генерируется; generation_busy — идёт генерация другого документа портала; all_fields_fixed — шаблон закрепил все поля документа; not_connected — ИИ к порталу не подключён. Ключ отозван или исчерпана квота — не отказ запуска, а итог генерации: failed с кодом в reason.\n\nТребует права vacancy · edit на эту вакансию.\n\nПеред постановкой и HTTP, и команда запуска читают сохранённый живой факт подключения без секрета и без обращения к провайдеру; отсутствие даёт 409 not_connected. Сохранённый факт не предсказывает живые ошибки ключа, квоты или провайдера.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Генерация поставлена."
          },
          "400": {
            "description": "Код bad_request: тело не разобралось. Код validation_error: details.field и details.reason — prePrompt too_long (длиннее 2000 знаков), transcripts too_many (больше 20) или not_found (расшифровки нет у этой вакансии).",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "значение поля не принято",
                    "retryable": false,
                    "details": {
                      "field": "transcripts",
                      "reason": "not_found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код generation_running: генерация этого документа уже идёт. Код generation_busy: в портале идёт генерация другого документа. Код all_fields_fixed: шаблон закрепил все поля документа — обновлять нечего. Код not_connected: портал не подключён к ИИ. Код vacancy_archived: вакансия в архиве — генерация брифа не ставится, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "all_fields_fixed",
              "generation_busy",
              "generation_running",
              "not_connected",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "generation_busy",
                    "message": "в портале уже идёт генерация другого документа",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/candidate-profile/versions": {
      "get": {
        "operationId": "appCandidateProfileVersions",
        "tags": [
          "План найма"
        ],
        "summary": "Версии портрета кандидата",
        "description": "Версии портрета кандидата новыми первыми и адрес основной. Версия появляется при каждом сохранении текстов (source manual), удачной генерации (ai) и при первом сохранении документа, записанного до версий (import); хранится не больше 30, старейшие неосновные уходят. Текстов в списке нет — они в GET /api/v1/vacancies/{id}/candidate-profile/versions/{versionId}. У версии генерации — пожелания (prePrompt), расшифровки входа (deleted — расшифровки больше нет у вакансии), truncated — во вход вошло не всё, mainUnreadable — основной бриф был недоступен. Версия, которую сервер не смог расшифровать, — readable false, без этих полей.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Версии документа; пустой список и mainVersionId null — версий нет.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocVersionList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "mainVersionId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                    "items": [
                      {
                        "publicId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                        "number": 2,
                        "source": "ai",
                        "main": true,
                        "readable": true,
                        "createdAt": "2026-09-28T08:15:00Z",
                        "author": {
                          "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                          "name": "Смирнова Анна Сергеевна"
                        },
                        "prePrompt": "Укажи вилку из созвона.",
                        "transcripts": [
                          {
                            "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                            "source": "followup",
                            "date": "2026-09-28",
                            "deleted": false
                          },
                          {
                            "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                            "source": "manual",
                            "date": "2026-09-25",
                            "deleted": true
                          }
                        ],
                        "truncated": false,
                        "mainUnreadable": false
                      },
                      {
                        "publicId": "6e0f1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
                        "number": 1,
                        "source": "manual",
                        "main": false,
                        "readable": true,
                        "createdAt": "2026-09-20T10:00:00Z",
                        "author": {
                          "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                          "name": "Смирнова Анна Сергеевна"
                        },
                        "prePrompt": null,
                        "transcripts": [],
                        "truncated": false,
                        "mainUnreadable": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/candidate-profile/versions/{versionId}": {
      "get": {
        "operationId": "appCandidateProfileVersion",
        "tags": [
          "План найма"
        ],
        "summary": "Версия портрета кандидата с текстами",
        "description": "Версия портрета кандидата с текстами: fields — experience, skills, education, stoppers, пустое поле — null. Версия, которую сервер не смог расшифровать, — 409 version_unreadable.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "publicId версии из списка версий.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Версия.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocVersionDetail"
                    }
                  }
                },
                "example": {
                  "data": {
                    "publicId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d",
                    "number": 2,
                    "source": "ai",
                    "main": true,
                    "readable": true,
                    "createdAt": "2026-09-28T08:15:00Z",
                    "author": {
                      "id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
                      "name": "Смирнова Анна Сергеевна"
                    },
                    "prePrompt": "Укажи вилку из созвона.",
                    "transcripts": [
                      {
                        "transcriptId": "8b1e4c07-2f9a-4d63-a5e8-71c0d9b3e2f4",
                        "source": "followup",
                        "date": "2026-09-28",
                        "deleted": false
                      },
                      {
                        "transcriptId": "5d2a7f10-9c4e-4b31-8e62-0a7b3c9d1f58",
                        "source": "manual",
                        "date": "2026-09-25",
                        "deleted": true
                      }
                    ],
                    "truncated": false,
                    "mainUnreadable": false,
                    "fields": {
                      "experience": "От трёх лет на станках с ЧПУ.",
                      "skills": "Чтение чертежей, Fanuc.",
                      "education": null,
                      "stoppers": "Без допуска к работе на высоте."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id или versionId не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой версии у документа нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код version_unreadable: версию не удалось расшифровать (сменился ключ шифрования).",
            "x-error-codes": [
              "version_unreadable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/candidate-profile/versions/{versionId}/main": {
      "post": {
        "operationId": "appMakeCandidateProfileVersionMain",
        "tags": [
          "План найма"
        ],
        "summary": "Сделать версию портрета кандидата основной",
        "description": "Делает версию основной: её тексты становятся текстами документа, новая версия не создаётся. Регион, профессия и формат работы не меняются. Событие уходит в ленту вакансии. Вакансию с шаблоном ниже права vacancy · edit на уровне all судят режимы шаблона, как PUT документа: текст версии, отличный от закреплённого (fixed), — 400 invalid_value с details.field. Версия уже основная — 204 без записи.\n\nТребует права vacancy · edit на эту вакансию.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "description": "publicId версии из списка версий.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Версия основная."
          },
          "400": {
            "description": "Код bad_request: id или versionId не идентификатор. Код invalid_value: текст версии расходится с полем, закреплённым шаблоном, — details.field.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет или она вне уровня вызывающего, либо такой версии у документа нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код version_unreadable: версию не удалось расшифровать — основной её не сделать. Код vacancy_archived: вакансия в архиве — основная версия профиля кандидата не меняется, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "version_unreadable",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/candidate-profile/generation": {
      "get": {
        "operationId": "appCandidateProfileGeneration",
        "tags": [
          "План найма"
        ],
        "summary": "Генерация портрета кандидата: статус",
        "description": "Состояние фоновой генерации портрета кандидата: none — не запускали; running — идёт; done — готово, versionId — адрес версии, ставшей основной; failed — не удалось, код в reason. Зависшая генерация читается как failed с reason timeout. prePrompt — сохранённые пожелания рекрутёра (пустая строка — их нет): их подставляет форма следующего запуска.\n\nТребует права vacancy · view и уровня на эту вакансию. Участие в маршруте согласования (согласующий видит заявку, её бриф и портрет) этих данных не открывает: без уровня ответ 403, вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Генерация документа.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocGeneration"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "done",
                    "reason": null,
                    "prePrompt": "Укажи вилку из созвона.",
                    "finishedAt": "2026-09-28T08:15:00Z",
                    "versionId": "1a2b3c4d-5e6f-4a7b-9c8d-7e6f5a4b3c2d"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appStartCandidateProfileGeneration",
        "tags": [
          "План найма"
        ],
        "summary": "Обновить портрет с ИИ",
        "description": "Ставит фоновую генерацию портрета кандидата из данных вакансии, основного брифа и отмеченных расшифровок (transcripts — их transcriptId; пусто — без расшифровок). Пожелания (prePrompt) сохраняются у вакансии и уходят в модель отдельно от данных: формат, правила и предел поля главнее их. Ответ 202 без тела; статус — GET /api/v1/vacancies/{id}/candidate-profile/generation. Удачный итог — новая основная версия; поля, закреплённые шаблоном, берутся из шаблона, пустое поле ответа не стирает текущее.\n\nРазом у портала идёт одна генерация. Отказы запуска ничего не сохраняют: 409 generation_running — этот документ уже генерируется; generation_busy — идёт генерация другого документа портала; all_fields_fixed — шаблон закрепил все поля документа; not_connected — ИИ к порталу не подключён. Ключ отозван или исчерпана квота — не отказ запуска, а итог генерации: failed с кодом в reason.\n\nТребует права vacancy · edit на эту вакансию.\n\nПеред постановкой и HTTP, и команда запуска читают сохранённый живой факт подключения без секрета и без обращения к провайдеру; отсутствие даёт 409 not_connected. Сохранённый факт не предсказывает живые ошибки ключа, квоты или провайдера.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Генерация поставлена."
          },
          "400": {
            "description": "Код bad_request: тело не разобралось. Код validation_error: details.field и details.reason — prePrompt too_long (длиннее 2000 знаков), transcripts too_many (больше 20) или not_found (расшифровки нет у этой вакансии).",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "значение поля не принято",
                    "retryable": false,
                    "details": {
                      "field": "transcripts",
                      "reason": "not_found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня вызывающего. Участие в маршруте согласования этих данных не открывает.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код generation_running: генерация этого документа уже идёт. Код generation_busy: в портале идёт генерация другого документа. Код all_fields_fixed: шаблон закрепил все поля документа — обновлять нечего. Код not_connected: портал не подключён к ИИ. Код vacancy_archived: вакансия в архиве — генерация профиля кандидата не ставится, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "all_fields_fixed",
              "generation_busy",
              "generation_running",
              "not_connected",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "generation_busy",
                    "message": "в портале уже идёт генерация другого документа",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/units": {
      "get": {
        "operationId": "appVacancyUnits",
        "tags": [
          "План найма"
        ],
        "summary": "Сетка единиц вакансии",
        "description": "Единицы найма вакансии по тонам: hired — вышли на работу (отклики в hired); offerAccepted — оформление (принятые офферы откликов на этапе offer); offerSent — оффер отправлен (отправленные офферы с неистёкшим сроком у откликов на этапе offer); free — headcount минус три тона выше, не меньше нуля. Своей таблицы у единиц нет: числа вычисляются на момент запроса.\n\nСетка — факт вакансии: уровень вызывающего к откликам её не сужает, иначе она показала бы «свободна» там, где человек уже вышел. Имён в ней нет — только числа.\n\nvacancyFilled — вакансия заполнена и её можно завершить, то же условие, что у ответа отметки выхода; closeReason — причина «наняли» на базовом языке установки, пустая, пока vacancyFilled false.\n\nТребует права vacancy · view; вакансия вне уровня вызывающего отвечает 404, как несуществующая.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Сетка единиц",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyUnits"
                    }
                  }
                },
                "example": {
                  "data": {
                    "headcount": 5,
                    "hired": 2,
                    "offerAccepted": 1,
                    "offerSent": 1,
                    "free": 1,
                    "vacancyFilled": false,
                    "closeReason": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет или она вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "appMe",
        "tags": [
          "Кабинет"
        ],
        "summary": "Текущий пользователь",
        "description": "Кто вызывает и где: человек, которому принадлежит ключ, портал этого ключа и роли человека в ЭТОМ портале. Другого способа узнать свой портал и свои права у вызывающего нет — параметра «портал» нет ни у одной операции.\n\nЕдинственная операция, ответ которой зависит от способа входа. Под ключом API поле platformAdmin ВСЕГДА false: платформенная роль читается по учётной записи входа, а у ключа её нет. Фактом о выпустившем ключ это значение не является.",
        "responses": {
          "200": {
            "description": "Пользователь, портал, роли, платформенный флаг",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MeResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "user": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "lastName": "Одинцова",
                      "firstName": "Мария",
                      "middleName": "Павловна",
                      "avatarUrl": "https://acme.bitrix24.ru/upload/main/3f1/avatar.jpg",
                      "timeZone": "Europe/Moscow",
                      "timeZoneSource": "auto"
                    },
                    "portal": {
                      "id": "a72e5b10-93c4-4f6d-8b21-0d7e9a3c5f48",
                      "domain": "acme.bitrix24.ru",
                      "currency": "RUB"
                    },
                    "roles": [
                      "portal_admin"
                    ],
                    "platformAdmin": false,
                    "workItemsScope": "v1.zD7d6EQS28wnAacbwaUJMNV-KNARrHb1HzF6W4W-ziA",
                    "cabinetMode": "full",
                    "features": {
                      "blueCollarEnabled": false,
                      "vacationSchedule": "on"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessRestricted"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/batch": {
      "post": {
        "operationId": "appBatch",
        "tags": [
          "Пакет"
        ],
        "summary": "Исполнить пакет вызовов",
        "description": "До 50 (умолчание, не больше 100) вызовов операций этого API одним запросом. Вызовы исполняются по очереди, в порядке массива calls, тем же сервисом, что и одиночные запросы: права, проверка тела, портал и журнал у каждого вызова свои — ровно те, что у операции, вызванной одиночно. Итог вызова кладётся под его id в results (data успеха; у 2xx без тела — null) или в errors (отказ операции с её status, code, retryable и details). Своего права у пакета нет.\n\nВсем пакетом, до первого вызова, сервис отвечает только на то, что видно без исполнения: тело не JSON — 400 bad_request; тело больше 1 МиБ — 413 payload_too_large; пакет пуст, вызовов больше предела, id негоден или повторён, метод не из GET, POST, PATCH, PUT, DELETE, путь не под /api/v1/, часть пути до «?» неканоническая (двойной слэш, сегменты . и .., слэш в конце, «%» или «#»; пробелы и управляющие символы — во всём пути), query не разбирается, тело у GET — 400 validation_error с причиной в error.details.reason и id вызова в error.details.id. Сам путь в отказ не попадает. Сюда же 401, 403, 429 и 503. Всё остальное — отказ отдельного вызова: пакет отвечает 200, а вызов попадает в errors.\n\nВес. Пакет по ключу стоит ⌈N / k⌉ единиц ведра ключа, где N — число вызовов, а k — вызовов на единицу, по умолчанию 10: единица за сам запрос и остаток после разбора тела. Вызовов в пакете по ключу — не больше меньшего из предела пакета (по умолчанию 50) и k на каждую единицу полного ведра. Не хватило единиц — 429 до первого вызова. У пакета под кукой ведра ключа нет, предел — тот же предел пакета. k, предел пакета и само ведро ключа — умолчания: для тарифа или портала их может переопределить платформа, и предел, в который упёрся пакет, называет error.details.limit. Одновременно у одного человека не больше двух пакетов, у сервиса — своя доля пакетов на всех; сверх — 429 rate_limited с Retry-After, ни один вызов не исполнен.\n\nСрок. Вызовы исполняются не дольше 20 секунд и так, чтобы ответ пакета успел уйти до предела сервера на запрос. Не начатые к сроку вызовы попадают в skipped, summary.stopped — deadline; вызов, прерванный сроком и не ответивший успехом, — batch_call_interrupted: исход его неизвестен, повторять вслепую нельзя, сначала найдите заведённое. Если срока меньше секунды ещё до первого вызова, весь пакет получает 503 unavailable с retryable: true и Retry-After — повторите пакет целиком. При перезапуске сервиса идущий вызов прерывается, не начатые — skipped со stopped: shutdown; отправьте их следующим пакетом.\n\nРазмеры. Тело пакета — до 1 МиБ, тело вызова после подстановки ссылок — до 1 МиБ, data всех вызовов в ответе — до 4 МиБ вместе: вызов, чей ответ не поместился, получает batch_response_too_large, хотя операция могла исполниться. Не начатые после него вызовы не исполняются — они в skipped, summary.stopped — response_limit (при halt: true — halt); так же, если предел исчерпан ровно. Отправьте их следующим пакетом. Крупные чтения — не в пакете записей.\n\nhalt: true останавливает пакет на первом вызове с отказом: остальные — skipped, stopped — halt. Без halt пакет исполняет все вызовы, и успех бывает частичным: повтор пакета целиком задублирует уже заведённое. Повторяют только skipped и отказы с retryable: true.\n\nСсылки. {{id}} или {{id.поле.0.поле}} — значение из data прежнего вызова этого пакета: поле объекта или номер элемента массива, до 8 шагов. В пути ссылка — только целый сегмент, значение — строка или целое из латиницы, цифр, «_» и «-», до 128 знаков, и подстановка не может сменить операцию вызова. В query ссылок нет. В теле строка, целиком равная ссылке, заменяется значением со своим типом — строкой, числом или логическим; ссылка внутри текста остаётся текстом, ключи объектов не трогаются. Строка тела, целиком вида {{…}}, — всегда ссылка, экранирования нет: не по грамматике — batch_ref_invalid, на незнакомый id — batch_ref_forward. Значение из данных ровно такого вида (например, заметка «{{не заполнено}}») отправляйте одиночным запросом. До 32 ссылок на вызов.\n\nСсылкой — только шаги, которым от прежнего ответа нужен лишь id: вакансия, затем отклики на неё. Шаги, зависящие от содержимого ответа, — правку контактов и перевод этапа после сверки имени — отправляют следующим пакетом, прочитав results: заведение отвечает 201, halt его не остановит, и правка ушла бы в чужой отклик.\n\nПакет вызывает только публичные операции этого API. Операция не из публичного контракта — batch_not_public, путь без операции — batch_route_not_found, пакет внутри пакета — batch_nested. Операции, которые после отмены продолжают работу дольше, чем пакет может ждать, вызываются только одиночно — batch_not_batchable; сегодня это назначение созвона с заказчиком (POST /api/v1/vacancies/{id}/customer-calls). Так же — batch_not_batchable — отказывают операции, чей успешный ответ — файл, а не JSON (печатные формы Т-13, Т-7, Т-6, Т-6а): ответ вызова пакет принимает только JSON-конвертом.\n\nОтказы вызова, которые отдаёт сам пакет, и их status (они же — x-batch-call-codes): batch_ref_forward — 400, ссылка на вызов, который идёт позже, на сам вызов или на id, которого в пакете нет; batch_ref_failed — 400, ссылка на вызов, упавший или пропущенный; batch_ref_invalid — 400, ссылка не по грамматике, не целым сегментом пути или в query; поля нет; значение — объект, массив или null; значение в пути не строка и не целое из [A-Za-z0-9_-]{1,128}; подстановка меняет операцию вызова; batch_ref_budget — 400, ответы, на которые ссылается пакет, слишком велики для разбора: разбейте пакет мельче; batch_nested — 400, пакет внутри пакета; batch_not_batchable — 400, операция вызывается только одиночным запросом; batch_not_public — 403, операция не из публичного контракта; batch_route_not_found — 404, у метода и пути вызова нет операции; payload_too_large — 413, тело вызова после подстановки ссылок больше 1 МиБ; batch_response_too_large — 502, ответ вызова не поместился в предел ответа пакета; операция могла исполниться; batch_unsupported_response — 502, ответ операции не в JSON-конверте; batch_call_interrupted — 504, вызов прерван сроком пакета или перезапуском сервиса, не ответив успехом; исход неизвестен. У всех retryable: false. Прочие коды в errors — от самой операции.",
        "x-batch-call-codes": [
          {
            "code": "batch_ref_forward",
            "status": 400,
            "description": "ссылка на вызов, который идёт позже, на сам вызов или на id, которого в пакете нет"
          },
          {
            "code": "batch_ref_failed",
            "status": 400,
            "description": "ссылка на вызов, упавший или пропущенный"
          },
          {
            "code": "batch_ref_invalid",
            "status": 400,
            "description": "ссылка не по грамматике, не целым сегментом пути или в query; поля нет; значение — объект, массив или null; значение в пути не строка и не целое из [A-Za-z0-9_-]{1,128}; подстановка меняет операцию вызова"
          },
          {
            "code": "batch_ref_budget",
            "status": 400,
            "description": "ответы, на которые ссылается пакет, слишком велики для разбора: разбейте пакет мельче"
          },
          {
            "code": "batch_nested",
            "status": 400,
            "description": "пакет внутри пакета"
          },
          {
            "code": "batch_not_batchable",
            "status": 400,
            "description": "операция вызывается только одиночным запросом"
          },
          {
            "code": "batch_not_public",
            "status": 403,
            "description": "операция не из публичного контракта"
          },
          {
            "code": "batch_route_not_found",
            "status": 404,
            "description": "у метода и пути вызова нет операции"
          },
          {
            "code": "payload_too_large",
            "status": 413,
            "description": "тело вызова после подстановки ссылок больше 1 МиБ"
          },
          {
            "code": "batch_response_too_large",
            "status": 502,
            "description": "ответ вызова не поместился в предел ответа пакета; операция могла исполниться"
          },
          {
            "code": "batch_unsupported_response",
            "status": 502,
            "description": "ответ операции не в JSON-конверте"
          },
          {
            "code": "batch_call_interrupted",
            "status": 504,
            "description": "вызов прерван сроком пакета или перезапуском сервиса, не ответив успехом; исход неизвестен"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              },
              "example": {
                "halt": true,
                "calls": [
                  {
                    "id": "row2-vacancy",
                    "method": "POST",
                    "path": "/api/v1/vacancies",
                    "body": {
                      "positionTitle": "Сварщик",
                      "headcount": 2,
                      "openReasonTitle": "Расширение штата"
                    }
                  },
                  {
                    "id": "row2-a1",
                    "method": "POST",
                    "path": "/api/v1/applications",
                    "body": {
                      "vacancyId": "{{row2-vacancy.id}}",
                      "lastName": "Соколова",
                      "firstName": "Ирина",
                      "contact": {
                        "kind": "phone",
                        "value": "8 903 123-45-67"
                      }
                    }
                  },
                  {
                    "id": "row2-a2",
                    "method": "POST",
                    "path": "/api/v1/applications",
                    "body": {
                      "vacancyId": "{{row2-vacancy.id}}",
                      "lastName": "Ким",
                      "firstName": "Артём",
                      "contact": {
                        "kind": "phone",
                        "value": "+7 916 000-11-22"
                      }
                    }
                  },
                  {
                    "id": "row2-a3",
                    "method": "POST",
                    "path": "/api/v1/applications",
                    "body": {
                      "vacancyId": "{{row2-vacancy.id}}",
                      "lastName": "Орлов",
                      "firstName": "Павел",
                      "contact": {
                        "kind": "email",
                        "value": "orlov@example.ru"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Итог пакета: data успешных вызовов и отказы по id вызова, не исполненные вызовы и сводка. Ответ 200 не значит, что исполнились все вызовы, — смотрите summary.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BatchResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "results": {
                      "row2-vacancy": {
                        "id": "c1e7a3f5-926b-48d0-af13-4e6b7c802d59",
                        "number": 115,
                        "position": "Бухгалтер",
                        "headcount": 1,
                        "openReason": "новое подразделение или проект",
                        "desiredStartDate": "2026-11-02",
                        "deadline": null,
                        "salaryMin": "80000.00",
                        "salaryMax": "95000.00",
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "currency": "RUB",
                        "justification": "Обособленное подразделение в Твери открывается 1 ноября.",
                        "department": null,
                        "departmentName": null,
                        "departmentMissing": false,
                        "interviewer": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "recruiter": null,
                        "company": {
                          "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                          "name": "Технологии Роста",
                          "archived": false
                        },
                        "stage": "draft",
                        "closeReason": null,
                        "allowedStages": [],
                        "createdAt": "2026-09-13T07:30:12Z",
                        "publishedAt": null,
                        "activeApplications": 0,
                        "scenario": "regular"
                      },
                      "row2-a1": {
                        "id": "e4b8c1d7-2a95-4f3e-8d06-b7c3a9f1e582",
                        "candidate": {
                          "id": "7f3d2b9c-5e61-4a08-9c47-d2e8b1a6f035",
                          "name": "Соколова Ирина Андреевна",
                          "contacts": [
                            {
                              "kind": "phone",
                              "value": "8 903 123-45-67"
                            }
                          ]
                        },
                        "vacancy": {
                          "id": "c1e7a3f5-926b-48d0-af13-4e6b7c802d59",
                          "position": "Сварщик"
                        },
                        "stage": "new",
                        "hiredOn": null,
                        "historicalOn": null,
                        "fit": "high",
                        "fitBot": "high",
                        "fitHuman": null,
                        "score": 92,
                        "scoreSource": "ai",
                        "reviewStatus": "fit",
                        "allowedStages": [
                          "interview"
                        ],
                        "formStages": [
                          "offer",
                          "hired",
                          "rejected"
                        ],
                        "responsible": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "resumeUrl": "https://disk.example.ru/resume/sokolova.pdf",
                        "note": null,
                        "createdAt": "2026-09-15T10:41:27Z",
                        "source": "hh",
                        "decision": null,
                        "nextInterviewAt": null,
                        "journey": {
                          "phase": "review",
                          "step": "application",
                          "steps": [
                            "application",
                            "interview",
                            "decision",
                            "offer",
                            "hired"
                          ]
                        },
                        "type": "unspecified",
                        "submittedBy": null,
                        "submittedSnapshot": null,
                        "rejection": null,
                        "step": "review",
                        "state": {
                          "code": "review",
                          "kind": "turn",
                          "since": "2026-09-15T10:41:27Z",
                          "marks": []
                        },
                        "decider": null,
                        "decisionState": null,
                        "liveInvite": null,
                        "verdict": "fit",
                        "verdictSource": "ai",
                        "rejectedFrom": null,
                        "stageEnteredAt": "2026-09-15T10:41:27Z"
                      }
                    },
                    "errors": {
                      "row2-a2": {
                        "status": 409,
                        "code": "already_applied",
                        "message": "этот человек уже откликался на эту вакансию",
                        "retryable": false
                      }
                    },
                    "skipped": [
                      "row2-a3"
                    ],
                    "summary": {
                      "total": 4,
                      "succeeded": 2,
                      "failed": 1,
                      "skipped": 1,
                      "stopped": "halt"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Пакет негоден ещё до исполнения — код validation_error: error.details.reason называет причину — calls_empty (вызовов нет), calls_over_limit (больше предела; сам предел — в error.details.limit), id_invalid, id_duplicate, method_invalid, body_on_get, path_outside_contour, path_not_canonical, query_invalid; error.details.id — id негодного вызова. Ни один вызов не исполнен.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/BatchForbidden"
          },
          "413": {
            "description": "Тело пакета больше 1 МиБ — код payload_too_large; предел в байтах — в error.details.limitBytes. Ни один вызов не исполнен.",
            "x-error-codes": [
              "payload_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Срока запроса не хватает, чтобы начать пакет, — код unavailable, retryable: true. Ни один вызов не исполнен: повторите пакет целиком через Retry-After секунд, то же число — в error.details.retryAfterSec.",
            "x-error-codes": [
              "unavailable"
            ],
            "headers": {
              "Retry-After": {
                "description": "Через сколько секунд повторить пакет.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}": {
      "get": {
        "operationId": "appVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Карточка вакансии",
        "description": "Одна вакансия портала — та же форма, что в списке. allowedStages приходит рассчитанным: правило переходов клиент не копирует, а показывает то, что пришло.\n\nТребует права vacancy · view.\n\nПоля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Вакансия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vacancy"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                    "position": "Оператор станка ЧПУ",
                    "headcount": 3,
                    "openReason": "расширение штата",
                    "desiredStartDate": "2026-10-01",
                    "deadline": "2026-09-25",
                    "salaryMin": "90000.00",
                    "salaryMax": "130000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "justification": "В октябре запускается третья смена, закрывать её сегодня некем.",
                    "department": null,
                    "departmentName": null,
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "stage": "preparation",
                    "closeReason": null,
                    "allowedStages": [
                      "screening",
                      "completed"
                    ],
                    "createdAt": "2026-09-08T09:12:03Z",
                    "activeApplications": 7,
                    "recruiter": {
                      "id": "2e8b6c14-9f3a-4d71-a5c0-8b7e1d4f6a29",
                      "name": "Кравцова Елена Игоревна"
                    },
                    "company": {
                      "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                      "name": "Технологии Роста",
                      "archived": false
                    },
                    "number": 112,
                    "publishedAt": "2026-09-10T08:00:00Z",
                    "author": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "customer": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "completedAt": null,
                    "archivedAt": null,
                    "request": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appPatchVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Править поля вакансии",
        "description": "Частичная правка: присылаются ТОЛЬКО меняемые поля. «Ключа нет» и «прислали null» значат разное — первое «не трогай», второе «сотри».\n\nВакансия с шаблоном: должность не меняется ни на каком уровне прав — positionTitle, отличная от текущей, даёт 400 invalid_value с details.field = positionTitle. Вакансию с шаблоном (заведённую по templateId) ниже права vacancy · edit на уровне all судят режимы ТЕКУЩЕГО шаблона: присланное поле с режимом fixed или hidden, отличное от текущего значения вакансии, — 400 invalid_value с details.field; равное текущему — не нарушение. Вилку со скрытым режимом автор вакансии не присылает вовсе: ключ salaryMin или salaryMax отвергается при любом значении. Причина открытия ниже all — по правилу шаблона, как при заведении: 400 invalid_value с details.field = openReasonTitle.\n\nЭтап и причину завершения этой ручкой не меняют: смена этапа — не правка поля, а переход с проверкой и записью в журнал, для него есть POST /api/v1/vacancies/{id}/stage. Присланные сюда, они дают invalid_value.\n\nТребует права vacancy · edit.\n\nЧисло единиц headcount не опускается ниже числа уже вышедших на работу: такая правка отвечает headcount_below_hired — но только когда новое значение ниже и вышедших, и прежнего headcount, поэтому правка, поднимающая число единиц, проходит и на старых данных.\n\nПринимает поля условий заявки: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `observerIds`, с пределами, как у шаблона. Ключ API не присылает `fileIds` (400). Поля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой. Отказы полей условий — 400 invalid_value с полем в details.field и причиной details.reason: invalid, too_long, too_many, duplicate, ref_rejected или file_rejected. `salaryComment`, присланный тем, кому вилка скрыта, — 400 invalid_value с полем salaryComment.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Вакансия после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vacancy"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                    "position": "Оператор станка ЧПУ",
                    "headcount": 4,
                    "openReason": "расширение штата",
                    "desiredStartDate": "2026-10-01",
                    "deadline": "2026-09-25",
                    "salaryMin": "90000.00",
                    "salaryMax": "145000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "justification": "В октябре запускается третья смена, закрывать её сегодня некем.",
                    "department": null,
                    "departmentName": null,
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "stage": "preparation",
                    "closeReason": null,
                    "allowedStages": [
                      "screening",
                      "completed"
                    ],
                    "createdAt": "2026-09-08T09:12:03Z",
                    "activeApplications": 7,
                    "recruiter": {
                      "id": "2e8b6c14-9f3a-4d71-a5c0-8b7e1d4f6a29",
                      "name": "Кравцова Елена Игоревна"
                    },
                    "company": {
                      "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                      "name": "Технологии Роста",
                      "archived": false
                    },
                    "number": 112,
                    "publishedAt": "2026-09-10T08:00:00Z",
                    "author": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "customer": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "completedAt": null,
                    "archivedAt": null,
                    "request": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Поле не прошло проверку — код invalid_value, details.field называет какое. У вакансии с шаблоном — ещё смена должности на любом уровне прав, а ниже vacancy · edit = all — поле, расходящееся с режимом fixed или hidden текущего шаблона, число людей выше его потолка, граница вилки вне границ range и причина открытия не из допустимых. Условия заявки: details.reason называет причину — invalid (код вне словаря, пустая строка кода, пояс вне tzdata), too_long (текст длиннее maxLength), too_many (набор больше maxItems), duplicate (повтор в наборе languages, fileIds или observerIds), ref_rejected (юрлицо недействующее или чужое, наблюдатель вне снимка Битрикс24 или ушёл), file_rejected (файл не годится или адрес не разбирается). Без details.reason — поле закреплено режимом шаблона (наблюдатели — всегда), неразборный legalEntityId, marketReview: null, salaryComment от того, кому вилка скрыта (с любым значением), и fileIds, присланный ключом API (с любым значением, null тоже).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код headcount_below_hired: новое число единиц ниже числа уже вышедших на работу и ниже прежнего headcount. 409, а не 400: тело законно, а состояние вакансии не позволяет. Код vacancy_archived: вакансия в архиве — её поля не правятся, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "headcount_below_hired",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/stage": {
      "post": {
        "operationId": "appMoveVacancy",
        "tags": [
          "План найма"
        ],
        "summary": "Перевести вакансию на другой этап",
        "description": "Ответ — вакансия целиком, а не 204: вместе с этапом меняется и allowedStages, поэтому перечитывать её после перевода не нужно.\n\nПроверка перехода стоит на сервере в любом случае: allowedStages — подсказка вызывающему, а не защита.\n\nТребует права vacancy · edit.\n\nПеревод в completed закрывает только вакансию без живых предметов: ни активного отклика, ни живого оффера (sent и не истёкший, или accepted у ещё не вышедшего кандидата), ни живой встречи (pending, не истёкшая и с ещё не начавшимся предложенным слотом; pending с идущей бронью; booked с концом выбранного слота в будущем). Иначе — 409 completion_required, и ничего не записано. Документированный путь: урегулировать каждый предмет публичными операциями appRejectApplication (POST /api/v1/applications/{id}/reject), appWithdrawOffer (POST /api/v1/offers/{id}/withdraw), appCancelInterview (POST /api/v1/interviews/{id}/cancel) и повторить перевод.\n\nВыход из completed принимает необязательное reopenReason — объяснение переоткрытия, оно хранится в журнале закрытия. Отказы и переносы закрытия переоткрытие не отменяет.\n\nПоля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyStageRequest"
              },
              "examples": {
                "close": {
                  "summary": "Закрыть вакансию",
                  "value": {
                    "fromStage": "screening",
                    "stage": "completed",
                    "closeReasonTitle": "наняли"
                  }
                },
                "reopen": {
                  "summary": "Переоткрыть с объяснением",
                  "value": {
                    "fromStage": "completed",
                    "stage": "screening",
                    "reopenReason": "Заказчик открыл вторую смену"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Вакансия после перевода",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Vacancy"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                    "position": "Оператор станка ЧПУ",
                    "headcount": 4,
                    "openReason": "расширение штата",
                    "desiredStartDate": "2026-10-01",
                    "deadline": "2026-09-25",
                    "salaryMin": "90000.00",
                    "salaryMax": "145000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "justification": "В октябре запускается третья смена, закрывать её сегодня некем.",
                    "department": null,
                    "departmentName": null,
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "stage": "completed",
                    "closeReason": "наняли",
                    "allowedStages": [
                      "preparation",
                      "screening"
                    ],
                    "createdAt": "2026-09-08T09:12:03Z",
                    "activeApplications": 0,
                    "recruiter": {
                      "id": "2e8b6c14-9f3a-4d71-a5c0-8b7e1d4f6a29",
                      "name": "Кравцова Елена Игоревна"
                    },
                    "company": {
                      "id": "5d8c1f3e-2a47-4b9c-8e61-3f0a7b2c9d14",
                      "name": "Технологии Роста",
                      "archived": false
                    },
                    "number": 112,
                    "publishedAt": "2026-09-10T08:00:00Z",
                    "author": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "customer": {
                      "id": "7a2d4e91-3c5b-4f08-b6e1-9d0c2a8f5e37",
                      "name": "Лебедев Андрей Николаевич"
                    },
                    "completedAt": "2026-09-29T15:20:00Z",
                    "archivedAt": null,
                    "request": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Причина завершения не к месту или отсутствует — код invalid_value с details.field = closeReasonTitle. Объяснение переоткрытия прислано не к выходу из completed или длиннее 1000 символов — код invalid_value с details.field = reopenReason. Тело не разобралось — код bad_request.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "invalid_value": {
                    "value": {
                      "error": {
                        "code": "invalid_value",
                        "message": "значение поля не принято",
                        "retryable": false,
                        "details": {
                          "field": "reopenReason"
                        }
                      }
                    }
                  },
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "тело запроса не разобралось",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Переход запрещён — код stage_forbidden. 409, а не 400: тело законно, а состояние вакансии не позволяет. Код completion_required: перевод в completed, пока у вакансии остаются активный отклик, живой оффер или живая встреча; урегулируйте их операциями appRejectApplication, appWithdrawOffer, appCancelInterview и повторите перевод. Ничего не записано. Код vacancy_archived: вакансия в архиве — этап не меняется, переоткрытие тоже, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "stage_forbidden",
              "completion_required",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "stage_forbidden": {
                    "value": {
                      "error": {
                        "code": "stage_forbidden",
                        "message": "переход между этапами запрещён",
                        "retryable": false
                      }
                    }
                  },
                  "completion_required": {
                    "value": {
                      "error": {
                        "code": "completion_required",
                        "message": "у вакансии остались активные отклики, офферы или встречи",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/job-positions": {
      "get": {
        "operationId": "appJobPositions",
        "tags": [
          "Справочники"
        ],
        "summary": "Подсказки должностей",
        "description": "Строки справочника должностей портала, по которым сейчас можно завести заявку: доступные и неархивные. Заготовок в коде у должностей нет — их неоткуда взять.\n\nПоиск — по подстроке названия без учёта регистра. Ответ — не больше 20 строк по алфавиту, без курсора и без признака обрезки: список, в который упёрся предел, уточняйте запросом q. Снять справочник целиком этой операцией нельзя — полный список отдаёт GET /api/v1/job-positions/directory под правом job_position · view.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока названия. Курсора у ручки нет намеренно: список, из которого выбирают глазами, листать некуда — человек уточняет запрос, а не жмёт «показать ещё».",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Названия должностей",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TitleListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "titles": [
                      "Бухгалтер",
                      "Водитель погрузчика",
                      "Оператор станка ЧПУ",
                      "Сварщик"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-reasons": {
      "get": {
        "operationId": "appVacancyReasons",
        "tags": [
          "Справочники"
        ],
        "summary": "Подсказки причин",
        "description": "Строки справочника причин портала И ещё не выбранные заготовки из кода. Заготовки приходят на БАЗОВОМ языке установки, а не языке вкладки: выбранная заготовка становится строкой базы клиента, и выбирай её по языку вкладки — содержимое справочника зависело бы от того, кто первым нажал.\n\nПоиск — по подстроке названия без учёта регистра. Ответ — не больше 20 строк, без курсора и без признака обрезки: список, в который упёрся предел, уточняйте запросом q.\n\nТребует права vacancy · view.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "description": "Какой из двух списков.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "close"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока названия. Курсора у ручки нет намеренно: список, из которого выбирают глазами, листать некуда — человек уточняет запрос, а не жмёт «показать ещё».",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Названия причин",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TitleListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "titles": [
                      "Замена в декрете",
                      "расширение штата",
                      "замена уволившегося",
                      "замена на время отсутствия",
                      "новое подразделение или проект",
                      "ротация"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "kind не из списка — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/users": {
      "get": {
        "operationId": "appUsers",
        "tags": [
          "Люди портала"
        ],
        "summary": "Справочник сотрудников своего портала",
        "description": "Список ограничен порталом сессии. Требует права portal_user · view, и выдача СУЖАЕТСЯ уровнем вызывающего: «только свои» отдаёт одну его карточку, «свой отдел» — его отдел с подразделениями, «все» — портал целиком. Какой уровень достался вызывающему, сказано в grants ответа GET /api/v1/me — по нему и надо решать, а не по числу строк в ответе. Страница на чтение: роли назначают и снимают ручки /api/v1/access/assignments.\n\nПоверх ведра ключа на этом чтении стоит второе ведро — на пользователя портала: оно отбивает и запрос из кабинета, где ключа нет вовсе. Вёдра складываются, побеждает отказавшее раньше, поэтому 429 здесь возможен раньше, чем у соседних операций.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока по фамилии, имени и отчеству. Короче двух СИМВОЛОВ не принимается — длина считается в рунах, а не в байтах: «Ли» и «Li» обязаны вести себя одинаково.",
            "schema": {
              "type": "string",
              "minLength": 2
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "description": "any — не сужает, none — только без ролей, иначе код роли. Словарь кодов не закрыт: вертикали заводят свои роли, и неизвестный код даёт пустую выдачу, а не отказ. Формы у кода тоже нет — hr2, Recruiter и hr-2 законны одинаково и приезжают в roles этого же ответа. Отвергается только код длиннее 32 символов; длина считается в символах, а не в байтах.",
            "schema": {
              "type": "string",
              "maxLength": 32
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Без параметра — active: иначе уволенные засоряют справочник навсегда. Неизвестное значение отвергается, а не откатывается молча.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "any"
              ]
            }
          },
          {
            "name": "b24",
            "in": "query",
            "required": false,
            "description": "Есть ли у человека учётка на портале Битрикс24. no — «синий воротничок»: полноправный сотрудник, учётки нет и не будет.",
            "schema": {
              "type": "string",
              "enum": [
                "any",
                "yes",
                "no"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. Непрозрачный: не ради секрета, а чтобы ключ сортировки можно было сменить, не ломая контракт.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница справочника",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AppUsersResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "users": [
                      {
                        "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "lastName": "Одинцова",
                        "firstName": "Мария",
                        "middleName": "Павловна",
                        "roles": [
                          "portal_admin",
                          "recruiter"
                        ],
                        "archived": false,
                        "b24Account": true,
                        "lastLoginAt": "2026-09-12T08:41:00Z",
                        "createdAt": "2026-03-04T11:20:15Z",
                        "can": {
                          "editRoles": true,
                          "archive": true,
                          "restore": false
                        }
                      },
                      {
                        "id": "5c81d0a3-e64b-47f2-b903-8a1c7d6e2540",
                        "lastName": "Гафуров",
                        "firstName": "Тимур",
                        "middleName": null,
                        "roles": [],
                        "archived": false,
                        "b24Account": false,
                        "lastLoginAt": null,
                        "createdAt": "2026-08-27T06:05:44Z",
                        "can": {
                          "editRoles": true,
                          "archive": true,
                          "restore": false
                        }
                      }
                    ],
                    "roles": [
                      "portal_admin",
                      "recruiter"
                    ],
                    "nextCursor": "eyJwIjoiNWM4MWQwYTMtZTY0Yi00N2YyLWI5MDMtOGExYzdkNmUyNTQwIn0"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Короткий запрос, слишком длинный код роли, неизвестный status или b24, испорченный курсор — код bad_request. Этим же кодом отвечает ИСПРАВНЫЙ курсор, который не переводится в строку: человека удалили или курсор пришёл из чужого портала. У всех этих отказов retryable = false — тот же запрос даст тот же ответ, и повторять его нечем.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates": {
      "get": {
        "operationId": "appVacancyTemplates",
        "tags": [
          "Справочники"
        ],
        "summary": "Шаблоны вакансий",
        "description": "Шаблоны портала, архивные тоже, по названию — для грида настройки. Строка несёт то же, что карточка, кроме длинных текстов и наборов, которых грид не показывает: description приходит null, в brief и profile null поля, reasons и channels — пустыми. Их отдаёт карточка.\n\nВилка скрытого шаблона (режим salary = hidden) приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null (спека шаблонов § 7.5).\n\nТребует права vacancy_template · view.\n\nПоля условий заявки список не отдаёт: их возвращает карточка шаблона.",
        "responses": {
          "200": {
            "description": "Шаблоны портала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "templates": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "title": "Сварщик цеха",
                        "description": null,
                        "group": "Производство",
                        "positionTitle": "Сварщик",
                        "positionUsable": true,
                        "companyId": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                        "companyArchived": false,
                        "interviewerId": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                        "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                        "routeTitle": "Найм на производство",
                        "recruiterId": null,
                        "interviewerActive": true,
                        "recruiterActive": true,
                        "interviewer": {
                          "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                          "name": "Одинцова Мария Павловна"
                        },
                        "recruiter": null,
                        "headcount": 1,
                        "headcountMax": 5,
                        "deadlineDays": 30,
                        "salaryMin": "90000.00",
                        "salaryMax": "120000.00",
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "currency": "RUB",
                        "workFormat": "on_site",
                        "brief": {
                          "tasks": null,
                          "conditions": null,
                          "schedule": null,
                          "hiringSteps": null
                        },
                        "profile": {
                          "experience": null,
                          "skills": null,
                          "education": null,
                          "stoppers": null
                        },
                        "modes": {
                          "headcount": "fixed",
                          "deadline": "author",
                          "salary": "range",
                          "work_format": "author",
                          "brief_tasks": "author",
                          "brief_conditions": "author",
                          "brief_schedule": "author",
                          "brief_hiring_steps": "fixed",
                          "profile_experience": "author",
                          "profile_skills": "author",
                          "profile_education": "author",
                          "profile_stoppers": "author"
                        },
                        "audienceAll": false,
                        "audience": [
                          {
                            "departmentId": 12,
                            "includeChildren": true
                          }
                        ],
                        "reasons": [],
                        "channels": [],
                        "requests": 3,
                        "archived": false,
                        "createdAt": "2026-09-30T09:00:00Z",
                        "updatedAt": "2026-09-30T09:00:00Z",
                        "massHiring": false,
                        "offerApprovalRequired": true
                      }
                    ],
                    "emptyReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Значение параметра не принято: q длиннее 255 Unicode символов после обрезки пробелов или не UTF-8 — код invalid_value, details.field = q. Каталог не читается.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search over the accessible base catalog title, description and position. EmptyReason is classified before/after this search without exposing hidden templates. At most 255 Unicode characters after trimming; longer or non-UTF-8 is invalid_value with details.field = q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appVacancyTemplateCreate",
        "tags": [
          "Справочники"
        ],
        "summary": "Завести шаблон вакансии",
        "description": "Заводит шаблон одним телом: значения, режимы полей, аудиторию, причины открытия, процесс и площадки. Обязательны title и positionTitle; headcount по умолчанию 1; archived заведение не читает. Причина, которой ещё нет в справочнике причин открытия, заводится в нём той же операцией. Валюту ставит сервер.\n\nВилка скрытого шаблона (режим salary = hidden) приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null (спека шаблонов § 7.5).\n\nТребует права vacancy_template · edit.\n\nПринимает поля условий заявки: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `observerIds`; у наборов — пределы maxItems. Ключ API не присылает `fileIds` (400). В `modes` у полей условий заявки допустимы только author и fixed; отсутствующий в ответе код поля означает author. `workFormat` несёт код формата работы (on_site, hybrid, remote, field_work) или прежний свободный текст, например office, — его стоит показать как есть. Поля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Отказы полей условий — 400 invalid_value с полем в details.field и причиной details.reason: invalid, too_many, duplicate, ref_rejected или file_rejected.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyTemplateWrite"
              },
              "example": {
                "title": "Сварщик цеха",
                "positionTitle": "Сварщик",
                "group": "Производство",
                "headcount": 1,
                "headcountMax": 5,
                "deadlineDays": 30,
                "salaryMin": "90000",
                "salaryMax": "120000",
                "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                "brief": {
                  "tasks": "Сварка металлоконструкций по чертежам."
                },
                "modes": {
                  "salary": "range",
                  "headcount": "fixed",
                  "employment_type": "fixed"
                },
                "audienceAll": false,
                "audience": [
                  {
                    "departmentId": 12,
                    "includeChildren": true
                  }
                ],
                "reasons": [
                  "Расширение штата"
                ],
                "channels": [
                  "hh"
                ],
                "employmentType": "permanent",
                "marketReview": true,
                "offerApprovalRequired": true,
                "languages": [
                  "ru",
                  "en"
                ],
                "location": "moscow",
                "timezone": "Europe/Moscow",
                "workSchedule": "5_2",
                "observerIds": [
                  "42"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Шаблон заведён",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                    "title": "Сварщик цеха",
                    "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                    "group": "Производство",
                    "positionTitle": "Сварщик",
                    "positionUsable": true,
                    "companyId": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                    "companyArchived": false,
                    "interviewerId": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "routeTitle": "Найм на производство",
                    "recruiterId": null,
                    "interviewerActive": true,
                    "recruiterActive": true,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "headcount": 1,
                    "headcountMax": 5,
                    "deadlineDays": 30,
                    "salaryMin": "90000.00",
                    "salaryMax": "120000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "workFormat": "on_site",
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": null,
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Звонок, пробная сварка в цехе."
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргон, полуавтомат.",
                      "education": null,
                      "stoppers": null
                    },
                    "modes": {
                      "headcount": "fixed",
                      "deadline": "author",
                      "salary": "range",
                      "work_format": "author",
                      "brief_tasks": "author",
                      "brief_conditions": "author",
                      "brief_schedule": "author",
                      "brief_hiring_steps": "fixed",
                      "profile_experience": "author",
                      "profile_skills": "author",
                      "profile_education": "author",
                      "profile_stoppers": "author"
                    },
                    "audienceAll": false,
                    "audience": [
                      {
                        "departmentId": 12,
                        "includeChildren": true
                      }
                    ],
                    "reasons": [
                      "Расширение штата",
                      "Замена сотрудника"
                    ],
                    "channels": [
                      "hh",
                      "avito"
                    ],
                    "requests": 3,
                    "archived": false,
                    "createdAt": "2026-09-30T09:00:00Z",
                    "updatedAt": "2026-09-30T09:00:00Z",
                    "massHiring": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — значение не принято; поле называет details.field: title — название пустое или длиннее допустимого; positionTitle — должности нет, она снята с «доступна для заявки» или ушла в архив (один случай; проверяется при заведении и при смене должности); companyId — профиля компании нет или он в архиве; interviewerId, recruiterId — человека нет или он не действует; routeId — маршрута нет; modes — режим не из словаря, не бывает у этого поля или salary_comment: author при salary: hidden в том же теле; headcount — число людей вне 1…65535; headcountMax — потолок ниже числа по умолчанию или выше 65535; deadlineDays — срок вне 1…365 дней; salaryMin — нижняя граница вилки не деньги или её нет у режима range; salaryMax — верхняя граница не деньги, ниже нижней или её нет у режима range; channels — площадка не из словаря; reasons — пустое название причины или причин больше 100; audience — отдел без номера или без includeChildren, или отделов больше 100; legalEntityId — юрлица нет, оно чужое или не действует (details.reason ref_rejected); employmentType, location, workSchedule — код не из словаря или пустая строка, languages — код не из словаря, timezone — пустая строка или не пояс IANA (details.reason invalid); marketReview — null; fileIds — прислан ключом API (с любым значением, null тоже), файлов больше maxItems (details.reason too_many), повтор (duplicate), файл не принят — его нет, он чужой или не автора правки, не подтверждён, уже занят, не того типа или размера, адрес не разбирается (file_rejected, одна причина на все случаи); observerIds — наблюдателей больше maxItems (too_many), повтор номера (duplicate), сотрудника нет в Битрикс24 портала или он ушёл, строка не номер (ref_rejected); languages — ещё и повтор (duplicate). Уже стоящие юрлицо, пояс, наблюдатели и файлы шаблона повторно не проверяются. Без details.reason приходят marketReview: null, fileIds от ключа API и отказы скрытой вилки. У длинных текстов (description, group, workFormat, brief.*, profile.*, salaryComment, customerWishes) details.reason — too_long или control_char. Адрес ссылки, который не разбирается, — тоже invalid_value со своим полем. У полей условий заявки отказ один — первый по порядку: разбор тела (marketReview: null, fileIds ключом, адрес файла не разбирается), форма значения без обращения к базе (invalid у кодов, too_long, too_many, duplicate), затем ссылки (ref_rejected, file_rejected, invalid у timezone). bad_request — тело не разбирается, в нём неизвестный ключ или значение не того типа.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "conflict",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "route_archived — маршрут в архиве (details.field = routeId): новой привязкой он не становится. route_type_mismatch — маршрут согласует объекты другого типа (details.field = routeId). Привязка, уже стоящая у шаблона, остаётся, пока routeId не меняется.",
            "x-error-codes": [
              "route_archived",
              "route_type_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/choice": {
      "get": {
        "operationId": "appVacancyTemplateChoice",
        "tags": [
          "План найма"
        ],
        "summary": "Шаблоны для заведения вакансии",
        "description": "Шаблоны, по которым вызывающий заводит вакансию в «Плане найма» полем templateId операции POST /api/v1/vacancies. При праве vacancy · edit на уровне all — все не архивные шаблоны с доступной должностью; ниже — только видимые вызывающему по отделам, где он состоит (с «включая подразделения» — и по предку), тем же отбором, что каталог заявки; у ключа — отделы его владельца. Право на справочник шаблонов для этого не нужно.\n\nСтрока — то же, что строка каталога заявки, плюс список причин шаблона и отделы вызывающего для поля department. Вилка шаблона с режимом salary = hidden приходит без права vacancy · edit на уровне all как salaryMin и salaryMax = null при salaryHidden = true.\n\nТребует права vacancy · edit.\n\nПоля условий заявки этот список не отдаёт: их возвращает карточка шаблона.",
        "responses": {
          "200": {
            "description": "Шаблоны для выбора",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateChoiceResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "choices": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "title": "Сварщик цеха",
                        "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                        "group": "Производство",
                        "positionTitle": "Сварщик",
                        "headcount": 1,
                        "headcountMax": 5,
                        "deadlineDays": 30,
                        "salaryMin": null,
                        "salaryMax": null,
                        "salaryHidden": true,
                        "salaryMasked": true,
                        "currency": "RUB",
                        "workFormat": "on_site",
                        "modes": {
                          "headcount": "author",
                          "deadline": "author",
                          "salary": "hidden",
                          "work_format": "fixed",
                          "brief_tasks": "author",
                          "brief_conditions": "fixed",
                          "brief_schedule": "fixed",
                          "brief_hiring_steps": "fixed",
                          "profile_experience": "author",
                          "profile_skills": "author",
                          "profile_education": "author",
                          "profile_stoppers": "fixed"
                        },
                        "reasons": [
                          "расширение штата",
                          "замена уволившегося"
                        ],
                        "departments": [
                          {
                            "id": 12,
                            "name": "Цех металлоконструкций"
                          },
                          {
                            "id": 14,
                            "name": "Цех сборки"
                          }
                        ],
                        "massHiring": false,
                        "offerApprovalRequired": true
                      }
                    ],
                    "emptyReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Значение параметра не принято: q длиннее 255 Unicode символов после обрезки пробелов или не UTF-8 — код invalid_value, details.field = q. Каталог не читается.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search over the accessible base catalog title, description and position. EmptyReason is classified before/after this search without exposing hidden templates. At most 255 Unicode characters after trimming; longer or non-UTF-8 is invalid_value with details.field = q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/{id}": {
      "get": {
        "operationId": "appVacancyTemplate",
        "tags": [
          "Справочники"
        ],
        "summary": "Шаблон вакансии",
        "description": "Карточка шаблона со всеми текстами и наборами.\n\nВилка скрытого шаблона (режим salary = hidden) приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null (спека шаблонов § 7.5).\n\nТребует права vacancy_template · view.\n\nПоля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. В `modes` у полей условий заявки допустимы только author и fixed; отсутствующий в ответе код поля означает author. `workFormat` несёт код формата работы (on_site, hybrid, remote, field_work) или прежний свободный текст, например office, — его стоит показать как есть.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес шаблона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка шаблона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                    "title": "Сварщик цеха",
                    "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                    "group": "Производство",
                    "positionTitle": "Сварщик",
                    "positionUsable": true,
                    "companyId": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                    "companyArchived": false,
                    "interviewerId": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "routeTitle": "Найм на производство",
                    "recruiterId": null,
                    "interviewerActive": true,
                    "recruiterActive": true,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "headcount": 1,
                    "headcountMax": 5,
                    "deadlineDays": 30,
                    "salaryMin": "90000.00",
                    "salaryMax": "120000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "workFormat": "on_site",
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": null,
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Звонок, пробная сварка в цехе."
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргон, полуавтомат.",
                      "education": null,
                      "stoppers": null
                    },
                    "modes": {
                      "headcount": "fixed",
                      "deadline": "author",
                      "salary": "range",
                      "work_format": "author",
                      "brief_tasks": "author",
                      "brief_conditions": "author",
                      "brief_schedule": "author",
                      "brief_hiring_steps": "fixed",
                      "profile_experience": "author",
                      "profile_skills": "author",
                      "profile_education": "author",
                      "profile_stoppers": "author"
                    },
                    "audienceAll": false,
                    "audience": [
                      {
                        "departmentId": 12,
                        "includeChildren": true
                      }
                    ],
                    "reasons": [
                      "Расширение штата",
                      "Замена сотрудника"
                    ],
                    "channels": [
                      "hh",
                      "avito"
                    ],
                    "requests": 3,
                    "archived": false,
                    "createdAt": "2026-09-30T09:00:00Z",
                    "updatedAt": "2026-09-30T09:00:00Z",
                    "massHiring": false,
                    "offerApprovalRequired": true,
                    "legalEntity": {
                      "id": "5c1d2e3f-4a5b-46c7-8d9e-0f1a2b3c4d5e",
                      "name": "ООО «Металлоконструкции»",
                      "active": true
                    },
                    "employmentType": "permanent",
                    "marketReview": false,
                    "salaryComment": "Премия по итогам квартала до 20 %.",
                    "languages": [
                      "ru"
                    ],
                    "location": "moscow",
                    "timezone": "Europe/Moscow",
                    "workSchedule": "5_2",
                    "customerWishes": "Опыт работы в цеху от года.",
                    "files": [
                      {
                        "id": "0199a1f0-9b8a-7c6d-8e5f-4a3b2c1d0e9f",
                        "name": "Регламент цеха.pdf",
                        "contentType": "application/pdf",
                        "size": 184320
                      }
                    ],
                    "observers": [
                      {
                        "id": "42",
                        "name": "Петров Иван Сергеевич",
                        "active": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — шаблона с таким адресом в портале нет. Тот же ответ на адрес, который не разбирается, и на шаблон другого портала.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appVacancyTemplatePatch",
        "tags": [
          "Справочники"
        ],
        "summary": "Править шаблон вакансии",
        "description": "Частичная правка: ключа нет — поле не трогается; null или пустая строка у поля, которое бывает пустым, снимают значение. Наборы audience, reasons, channels, languages, fileIds и observerIds заменяются ЦЕЛИКОМ: пустой набор очищает. В modes прежние коды заменяются целиком, а код условий заявки, не названный в присланном modes, сохраняет режим (VacancyTemplateModesWrite). Архив и возврат из него — archived: true и false.\n\nДоступность должности проверяется только при её смене: шаблон, чью должность уже убрали, остаётся правимым и уходит в архив. Уже стоящие профиль компании, интервьюер и рекрутер остаются, даже если с тех пор ушли в архив; выбранные заново обязаны быть действующими.\n\nСкрытую вилку (режим salary = hidden) правит только держатель правки вакансий на уровне all. Правка без него, которая меняет режим salary (присланный modes, где salary не hidden) или режим salary_comment (не fixed), присылает salaryMin, salaryMax либо salaryComment, получает 400 invalid_value с полем modes, salaryMin, salaryMax или salaryComment, и ничего из правки не применяется. Граница и комментарий отвергаются по присутствию ключа — с любым значением, null и равным хранимому тоже: иначе ответ на подобранное число выдавал бы скрытую сумму.\n\nВилка скрытого шаблона (режим salary = hidden) приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null (спека шаблонов § 7.5).\n\nТребует права vacancy_template · edit.\n\nПринимает поля условий заявки: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `observerIds`; у наборов — пределы maxItems. Ключ API не присылает `fileIds` (400). В `modes` у полей условий заявки допустимы только author и fixed; отсутствующий в ответе код поля означает author. `workFormat` несёт код формата работы (on_site, hybrid, remote, field_work) или прежний свободный текст, например office, — его стоит показать как есть. Поля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Отказы полей условий — 400 invalid_value с полем в details.field и причиной details.reason: invalid, too_many, duplicate, ref_rejected или file_rejected.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес шаблона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyTemplateWrite"
              },
              "example": {
                "description": null,
                "headcountMax": 8,
                "archived": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Шаблон после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                    "title": "Сварщик цеха",
                    "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                    "group": "Производство",
                    "positionTitle": "Сварщик",
                    "positionUsable": true,
                    "companyId": "8b1f2c34-5d6e-47a8-9b0c-1d2e3f4a5b6c",
                    "companyArchived": false,
                    "interviewerId": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                    "routeId": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "routeTitle": "Найм на производство",
                    "recruiterId": null,
                    "interviewerActive": true,
                    "recruiterActive": true,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "headcount": 1,
                    "headcountMax": 5,
                    "deadlineDays": 30,
                    "salaryMin": "90000.00",
                    "salaryMax": "120000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "currency": "RUB",
                    "workFormat": "on_site",
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": null,
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Звонок, пробная сварка в цехе."
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргон, полуавтомат.",
                      "education": null,
                      "stoppers": null
                    },
                    "modes": {
                      "headcount": "fixed",
                      "deadline": "author",
                      "salary": "range",
                      "work_format": "author",
                      "brief_tasks": "author",
                      "brief_conditions": "author",
                      "brief_schedule": "author",
                      "brief_hiring_steps": "fixed",
                      "profile_experience": "author",
                      "profile_skills": "author",
                      "profile_education": "author",
                      "profile_stoppers": "author"
                    },
                    "audienceAll": false,
                    "audience": [
                      {
                        "departmentId": 12,
                        "includeChildren": true
                      }
                    ],
                    "reasons": [
                      "Расширение штата",
                      "Замена сотрудника"
                    ],
                    "channels": [
                      "hh",
                      "avito"
                    ],
                    "requests": 3,
                    "archived": false,
                    "createdAt": "2026-09-30T09:00:00Z",
                    "updatedAt": "2026-09-30T09:00:00Z",
                    "massHiring": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — значение не принято; поле называет details.field: title — название пустое или длиннее допустимого; positionTitle — должности нет, она снята с «доступна для заявки» или ушла в архив (один случай; проверяется при заведении и при смене должности); companyId — профиля компании нет или он в архиве; interviewerId, recruiterId — человека нет или он не действует; routeId — маршрута нет; modes — режим не из словаря, не бывает у этого поля или salary_comment: author при salary: hidden в том же теле; headcount — число людей вне 1…65535; headcountMax — потолок ниже числа по умолчанию или выше 65535; deadlineDays — срок вне 1…365 дней; salaryMin — нижняя граница вилки не деньги или её нет у режима range; salaryMax — верхняя граница не деньги, ниже нижней или её нет у режима range; channels — площадка не из словаря; reasons — пустое название причины или причин больше 100; audience — отдел без номера или без includeChildren, или отделов больше 100; legalEntityId — юрлица нет, оно чужое или не действует (details.reason ref_rejected); employmentType, location, workSchedule — код не из словаря или пустая строка, languages — код не из словаря, timezone — пустая строка или не пояс IANA (details.reason invalid); marketReview — null; fileIds — прислан ключом API (с любым значением, null тоже), файлов больше maxItems (details.reason too_many), повтор (duplicate), файл не принят — его нет, он чужой или не автора правки, не подтверждён, уже занят, не того типа или размера, адрес не разбирается (file_rejected, одна причина на все случаи); observerIds — наблюдателей больше maxItems (too_many), повтор номера (duplicate), сотрудника нет в Битрикс24 портала или он ушёл, строка не номер (ref_rejected); languages — ещё и повтор (duplicate); modes, salaryMin, salaryMax, salaryComment — ещё и правка без vacancy · edit на уровне all тронула скрытую вилку (см. описание операции; salaryComment — по присутствию ключа). Уже стоящие юрлицо, пояс, наблюдатели и файлы шаблона повторно не проверяются. Без details.reason приходят marketReview: null, fileIds от ключа API и отказы скрытой вилки. У длинных текстов (description, group, workFormat, brief.*, profile.*, salaryComment, customerWishes) details.reason — too_long или control_char. Адрес ссылки, который не разбирается, — тоже invalid_value со своим полем. У полей условий заявки отказ один — первый по порядку: разбор тела (marketReview: null, fileIds ключом, адрес файла не разбирается), скрытая вилка (salaryComment и режимы от правки без all), форма значения без обращения к базе (invalid у кодов, too_long, too_many, duplicate), затем ссылки (ref_rejected, file_rejected, invalid у timezone). bad_request — тело не разбирается, в нём неизвестный ключ или значение не того типа.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TelegramScenarioWriteForbidden"
          },
          "404": {
            "description": "not_found — шаблона с таким адресом в портале нет. Тот же ответ на адрес, который не разбирается, и на шаблон другого портала.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "conflict",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "route_archived — маршрут в архиве (details.field = routeId): новой привязкой он не становится. route_type_mismatch — маршрут согласует объекты другого типа (details.field = routeId). Привязка, уже стоящая у шаблона, остаётся, пока routeId не меняется.",
            "x-error-codes": [
              "route_archived",
              "route_type_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Коды ответа: feature_flags_unavailable, telegram_scenarios_busy.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Запрос отклонён",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/{id}/apply-preview": {
      "get": {
        "operationId": "appVacancyTemplateApplyPreview",
        "tags": [
          "Справочники"
        ],
        "summary": "Предпросмотр применения шаблона к черновикам",
        "description": "Что изменится у заявок этого шаблона, если применить его сейчас (спека шаблонов § 8). Цели — заявки с templateId шаблона на этапах draft и rejected; остальные этапы — группа untouched с этапом: на approval согласующие решают по цифрам на экране, с new вакансию уже можно публиковать.\n\nГруппы ответа: change — у заявки изменятся поля fields; reveal — то же, и скрытая вилка станет видна заказчику (salaryHidden меняется с true на false), salaryMin и salaryMax называют числа, которые он увидит, null — граница пуста; nothing — менять нечего; untouched — применение заявку не трогает. fields — имена полей контракта; skipped — поля, которые шаблон изменил бы, но не меняет: unavailable — должность шаблона снята с «доступна для заявки» или в архиве, archived — профиль компании шаблона в архиве, inactive — интервьюер шаблона больше не работает, order — граница вилки дала бы вилку наоборот. Оба списка — всегда массивы.\n\nfingerprint — отпечаток состояния шаблона: его присылает POST /api/v1/vacancy-templates/{id}/apply, и правка шаблона после предпросмотра меняет его — как и снятие должности с «доступна для заявки», архив профиля компании или интервьюера.\n\nПределы. Каждая группа — не больше 1000 заявок, в порядке создания. Цели (draft и rejected) просматриваются по порядку, пока change и reveal вместе не наберут 1000 заявок, но не дальше 10000 целей; nothing сверх 1000 отбрасывается без признака. truncated = true — изменяемых больше 1000: остальные появятся в следующем предпросмотре после применения показанных. scanTruncated = true — просмотр упёрся в 10000 целей, не набрав 1000 изменяемых: дальние цели не проверены и после применения показанных не появятся. Флаги не бывают true вместе. untouchedTruncated = true — untouched показаны не все, первые 1000.\n\nТребует права vacancy_template · edit и vacancy · edit на уровне all: ниже него 403 forbidden — числа раскрытия показывают вилку шаблона, которую без all смотреть нельзя.\n\nПредпросмотр и применение шаблона к черновикам переносят и условия заявки; в `fields` и `skipped` они названы ключами записи: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `fileIds`, `observerIds`. Причина `inactive` в `skipped` бывает и у юрлица (недействующее не переносится), и у наблюдателей (ушедшие не переносятся, причина одна на поле, остальные переносятся); причина `unreadable` означает, что тексты заявки не читаются, вилка остаётся скрытой. Необязательное поле строки предпросмотра `removedAuthorFiles` — сколько файлов автора снимет замена `fileIds`: применение удалит их безвозвратно. Текста комментария про деньги предпросмотр не несёт.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес шаблона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Предпросмотр",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateApplyPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "fingerprint": "9f2c4e7a1b3d5f60718293a4b5c6d7e8f90123456789abcdef0123456789abcd",
                    "change": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "number": null,
                        "position": "Сварщик",
                        "stage": "draft",
                        "fields": [
                          "headcount",
                          "deadline",
                          "brief.tasks",
                          "fileIds"
                        ],
                        "skipped": [
                          {
                            "field": "companyId",
                            "reason": "archived"
                          },
                          {
                            "field": "observerIds",
                            "reason": "inactive"
                          }
                        ],
                        "removedAuthorFiles": 1
                      }
                    ],
                    "reveal": [
                      {
                        "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                        "number": null,
                        "position": "Сварщик",
                        "stage": "rejected",
                        "fields": [
                          "salaryMin",
                          "salaryMax",
                          "salaryHidden"
                        ],
                        "skipped": [],
                        "salaryMin": "90000.00",
                        "salaryMax": null
                      }
                    ],
                    "nothing": [
                      {
                        "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                        "number": null,
                        "position": "Сварщик",
                        "stage": "draft",
                        "fields": [],
                        "skipped": []
                      }
                    ],
                    "untouched": [
                      {
                        "id": "0199a1f0-9d0e-7f1a-8b2c-3d4e5f6a7b8c",
                        "number": 17,
                        "position": "Сварщик",
                        "stage": "approval"
                      }
                    ],
                    "truncated": false,
                    "scanTruncated": false,
                    "untouchedTruncated": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — шаблона с таким адресом в портале нет. Тот же ответ на адрес, который не разбирается, и на шаблон другого портала.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/{id}/apply": {
      "post": {
        "operationId": "appVacancyTemplateApply",
        "tags": [
          "Справочники"
        ],
        "summary": "Применить шаблон к черновикам",
        "description": "Переписывает заявки списка по шаблону (спека шаблонов § 8). Тело несёт ЯВНЫЙ список заявок из предпросмотра и его отпечаток; что именно меняется у каждой, решает тот же план, что показал предпросмотр.\n\nПереписываются поля в режимах fixed и hidden и сам признак скрытой вилки; author и range — нет, range только прижимается к новым границам, если значение вышло за них. Пустое значение шаблона не пишется; недоступная должность, архивный профиль компании и неактивный интервьюер не пишутся и называются в предпросмотре. Если применение раскрывает вилку (salaryHidden true → false), вилка заявки переписывается значением шаблона при любом режиме, пустое тоже.\n\nКаждая заявка применяется своей транзакцией: отправленная на согласование или сменившая шаблон между предпросмотром и применением попадает в skipped с причиной и не меняется — stage — заявка ушла с draft и rejected; template — у заявки другой шаблон; not_found — такой заявки в портале нет; nothing — значения уже совпадают с шаблоном; headcount — число людей шаблона ниже уже вышедших на работу, и заявка не меняется целиком. Повтор адреса в списке применяется один раз. В журнал каждая запись идёт с источником «шаблон».\n\nОтпечаток сверяется до первой заявки и ещё раз у каждой: шаблон поправили посреди применения — 409 template_apply_stale, а заявки, применённые до этого, остаются применёнными (по шаблону, который видел вызывающий); перезапросите предпросмотр.\n\nТребует права vacancy_template · edit и vacancy · edit на уровне all: ниже него 403 forbidden.\n\nПредпросмотр и применение шаблона к черновикам переносят и условия заявки; в `fields` и `skipped` они названы ключами записи: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `fileIds`, `observerIds`. Причина `inactive` в `skipped` бывает и у юрлица (недействующее не переносится), и у наблюдателей (ушедшие не переносятся, причина одна на поле, остальные переносятся); причина `unreadable` означает, что тексты заявки не читаются, вилка остаётся скрытой. Необязательное поле строки предпросмотра `removedAuthorFiles` — сколько файлов автора снимет замена `fileIds`: применение удалит их безвозвратно. Текста комментария про деньги предпросмотр не несёт.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес шаблона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacancyTemplateApplyRequest"
              },
              "example": {
                "ids": [
                  "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                  "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f"
                ],
                "fingerprint": "9f2c4e7a1b3d5f60718293a4b5c6d7e8f90123456789abcdef0123456789abcd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Итог применения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateApplyResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "applied": [
                      "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60"
                    ],
                    "skipped": [
                      {
                        "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                        "reason": "stage"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — значение не принято; поле называет details.field: ids — список пуст или в нём адрес, который не разбирается; fingerprint — отпечаток не прислан. template_apply_too_many — в списке больше 100 заявок (hiring.TemplateApplyMax): режьте список предпросмотра на части и шлите по очереди. bad_request — тело не разбирается или в нём неизвестный ключ.",
            "x-error-codes": [
              "invalid_value",
              "template_apply_too_many",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — шаблона с таким адресом в портале нет. Тот же ответ на адрес, который не разбирается, и на шаблон другого портала.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_apply_stale — отпечаток не совпал с состоянием шаблона: его поправили после предпросмотра. Ничего из этого вызова не применено после расхождения; перезапросите предпросмотр и подтвердите его заново. 409, а не 400: тело законно, а шаблон успели поправить.",
            "x-error-codes": [
              "template_apply_stale"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/templates": {
      "get": {
        "operationId": "appRequestTemplates",
        "tags": [
          "План найма"
        ],
        "summary": "Каталог шаблонов для заявки",
        "description": "Шаблоны, по которым вызывающий может подать заявку: не в архиве, с доступной должностью, и аудитория — «весь портал» или отдел, где он состоит (с «включая подразделения» — и его предок). Отделы берутся из прав вызывающего; у ключа — отделы его владельца. Аудитория действует на любом уровне прав, и у держателя правки вакансий all тоже: мимо шаблонов вакансии заводят в «Плане найма».\n\nВилка шаблона с режимом salary = hidden приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. В режиме range границы видны — заказчик выбирает внутри них.\n\nТребует права vacancy_request · edit.\n\nПоля условий заявки этот список не отдаёт: их возвращает карточка шаблона.",
        "responses": {
          "200": {
            "description": "Каталог",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RequestTemplateListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "templates": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "title": "Сварщик цеха",
                        "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                        "group": "Производство",
                        "positionTitle": "Сварщик",
                        "headcount": 1,
                        "headcountMax": 5,
                        "deadlineDays": 30,
                        "salaryMin": null,
                        "salaryMax": null,
                        "salaryHidden": true,
                        "salaryMasked": true,
                        "currency": "RUB",
                        "workFormat": "on_site",
                        "modes": {
                          "headcount": "author",
                          "deadline": "author",
                          "salary": "hidden",
                          "work_format": "fixed",
                          "brief_tasks": "author",
                          "brief_conditions": "fixed",
                          "brief_schedule": "fixed",
                          "brief_hiring_steps": "fixed",
                          "profile_experience": "author",
                          "profile_skills": "author",
                          "profile_education": "author",
                          "profile_stoppers": "fixed"
                        },
                        "massHiring": false
                      }
                    ],
                    "emptyReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Значение параметра не принято: q длиннее 255 Unicode символов после обрезки пробелов или не UTF-8 — код invalid_value, details.field = q. Каталог не читается.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring search over the accessible base catalog title, description and position. EmptyReason is classified before/after this search without exposing hidden templates. At most 255 Unicode characters after trimming; longer or non-UTF-8 is invalid_value with details.field = q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/templates/{id}": {
      "get": {
        "operationId": "appRequestTemplate",
        "tags": [
          "План найма"
        ],
        "summary": "Шаблон для формы заявки",
        "description": "Всё, что нужно форме заявки: значения и режимы полей, тексты брифа и профиля, допустимые причины открытия и отделы вызывающего, попавшие в аудиторию. Поля с режимом author и range форма предлагает править, fixed показывает как есть, вилку hidden не показывает.\n\nВилка шаблона с режимом salary = hidden приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. В режиме range границы видны — заказчик выбирает внутри них.\n\nТребует права vacancy_request · edit.\n\nКарточка для формы заявки содержит необязательные поля условий шаблона: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. `salaryComment` скрыт вместе с вилкой: при режиме salary = hidden смотрящему без правки вакансий на уровне all ключа нет; нет ключа и при пустом комментарии.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес шаблона из каталога.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Шаблон для формы",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RequestTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                    "title": "Сварщик цеха",
                    "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                    "group": "Производство",
                    "positionTitle": "Сварщик",
                    "headcount": 1,
                    "headcountMax": 5,
                    "deadlineDays": 30,
                    "salaryMin": null,
                    "salaryMax": null,
                    "salaryHidden": true,
                    "salaryMasked": true,
                    "currency": "RUB",
                    "workFormat": "on_site",
                    "modes": {
                      "headcount": "author",
                      "deadline": "author",
                      "salary": "hidden",
                      "work_format": "fixed",
                      "brief_tasks": "author",
                      "brief_conditions": "fixed",
                      "brief_schedule": "fixed",
                      "brief_hiring_steps": "fixed",
                      "profile_experience": "author",
                      "profile_skills": "author",
                      "profile_education": "author",
                      "profile_stoppers": "fixed"
                    },
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": "Смена 2/2, спецодежда.",
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Собеседование с мастером, пробная сварка."
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргонодуговая сварка.",
                      "education": null,
                      "stoppers": "Нет допуска НАКС."
                    },
                    "reasons": [
                      "Расширение штата",
                      "Замена сотрудника"
                    ],
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех металлоконструкций"
                      }
                    ],
                    "massHiring": false,
                    "marketReview": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found — шаблона нет в каталоге вызывающего: его нет в портале, он в архиве, его должность недоступна для заявки или ни один отдел вызывающего не попал в аудиторию. Тот же ответ на адрес, который не разбирается: существование чужого шаблона не подтверждается.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests": {
      "get": {
        "operationId": "appRequests",
        "tags": [
          "План найма"
        ],
        "summary": "Мои заявки",
        "description": "Свои заявки по шаблону и самостоятельные, свежие сверху, страницами. creationMode различает способ; templateTitle у самостоятельной строки — пустая строка. Обычные вакансии автора без происхождения заявки в список не входят. У заявки на согласовании — прогресс круга.\n\nВилка вакансии: salaryMin и salaryMax приходят null, когда сходятся три условия — у заявки снимок salaryHidden = true, вызывающий — её автор, и правка вакансий у него ниже уровня all. Признак salaryHidden приходит всегда. Отличить скрытую вилку от незаданной позволяет именно он.\n\nТребует права vacancy_request · view.\n\nПоля условий заявки список не отдаёт: их возвращает карточка.",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "Только собственные незавершённые заявки без архива. Имеет приоритет над archived и сочетается с поиском и этапом. Допустимы true и false; другое значение — 400 invalid_value с полем active.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Поиск по названию или номеру вакансии (35, В-35, V-35), применяется до пагинации.",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "Быстрый отбор по этапу: approval — заявки на согласовании, rejected — вернувшиеся на доработку (тот же отбор, что у счётчика vacancyRework). Другое значение — 400 `bad_request`.",
            "schema": {
              "type": "string",
              "enum": [
                "approval",
                "rejected"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. Непрозрачный.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "description": "Отбор по архиву: `exclude` — без архивных заявок, `only` — только архивные, `all` — все (умолчание). Без параметра список отдаёт и архив, а отличает его archivedAt строки. Иное значение — 400 `invalid_value` (поле `archived`); значения различают регистр.",
            "schema": {
              "$ref": "#/components/schemas/VacancyArchivedFilter",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница заявок",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RequestListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "requests": [
                      {
                        "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
                        "number": null,
                        "publishedAt": null,
                        "position": "Сварщик",
                        "headcount": 2,
                        "openReason": "Расширение штата",
                        "desiredStartDate": "2026-11-02",
                        "deadline": "2026-10-30",
                        "salaryMin": null,
                        "salaryMax": null,
                        "salaryHidden": true,
                        "salaryMasked": true,
                        "currency": "RUB",
                        "justification": "Цех выходит на вторую смену.",
                        "department": 12,
                        "departmentName": "Отдел продаж",
                        "departmentMissing": false,
                        "interviewer": {
                          "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                          "name": "Одинцова Мария Павловна"
                        },
                        "recruiter": null,
                        "company": null,
                        "stage": "approval",
                        "closeReason": null,
                        "allowedStages": [],
                        "createdAt": "2026-09-30T09:00:00Z",
                        "activeApplications": null,
                        "templateTitle": "Сварщик цеха",
                        "progress": {
                          "decided": 1,
                          "total": 3,
                          "waitingKinds": [
                            "author_dept_head",
                            "role"
                          ]
                        },
                        "scenario": "regular",
                        "creationMode": "template"
                      },
                      {
                        "id": "0199a2b4-2d3e-7f40-8b5c-6d7e8f9a0b1c",
                        "number": null,
                        "publishedAt": null,
                        "position": "Сварщик",
                        "headcount": 1,
                        "openReason": "Расширение штата",
                        "desiredStartDate": "2026-11-02",
                        "deadline": "2026-10-30",
                        "salaryMin": null,
                        "salaryMax": null,
                        "salaryHidden": true,
                        "salaryMasked": true,
                        "currency": "RUB",
                        "justification": "Цех выходит на вторую смену.",
                        "department": 12,
                        "departmentName": "Отдел продаж",
                        "departmentMissing": false,
                        "interviewer": {
                          "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                          "name": "Одинцова Мария Павловна"
                        },
                        "recruiter": null,
                        "company": null,
                        "stage": "draft",
                        "closeReason": null,
                        "allowedStages": [],
                        "createdAt": "2026-09-30T09:00:00Z",
                        "activeApplications": null,
                        "templateTitle": "Сварщик цеха",
                        "progress": null,
                        "scenario": "regular",
                        "creationMode": "template"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request — курсор не разбирается или не указывает на заявку вызывающего. Код invalid_value — archived не из exclude, only, all; details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appRequestCreate",
        "tags": [
          "План найма"
        ],
        "summary": "Создать заявку",
        "description": "Создаёт черновик заявки. Автор — вызывающий. Для отправки на согласование вызовите POST /api/v1/vacancies/{id}/submit.\n\nДля самостоятельной заявки опустите templateId или передайте null. Укажите доступную positionTitle и причину из GET /api/v1/requests/pickers/reasons. Список собственных отделов автора возвращает GET /api/v1/requests/create-context в поле departments. Численность по умолчанию равна 1, этап — draft, сценарий — regular.\n\nДля заявки по шаблону передайте UUID в templateId и опустите positionTitle. В GET /api/v1/requests/templates/{id} поле departments содержит отделы автора в аудитории шаблона, а reasons — допустимые причины. Если у шаблона задана одна причина, можно передать в openReasonTitle пустую строку. В остальных случаях укажите название причины. Шаблон задаёт исходные значения. В запросе можно изменить поля с режимом author или range, включая доступные поля брифа и профиля. Режимы и аудитория действуют на любом уровне прав.\n\nЕсли доступных отделов несколько, передайте в department идентификатор одного из них. Если доступен один отдел, сервер подставит его сам. Если список пуст, оставьте department пустым, и заявка будет без отдела.\n\nВилка вакансии: salaryMin и salaryMax приходят null, когда сходятся три условия — у заявки снимок salaryHidden = true, вызывающий — её автор, и правка вакансий у него ниже уровня all. Признак salaryHidden приходит всегда. Отличить скрытую вилку от незаданной позволяет именно он.\n\nТребует права vacancy_request · edit.\n\nПринимает поля условий заявки: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `observerIds`, с пределами, как у шаблона. Ключ API не присылает `fileIds` (400). Поля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой. Отказы полей условий — 400 invalid_value с полем в details.field и причиной details.reason: invalid, too_long, too_many, duplicate, ref_rejected или file_rejected. `salaryComment`, присланный тем, кому вилка скрыта, — 400 invalid_value с полем salaryComment.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestCreateBody"
              },
              "example": {
                "positionTitle": "Сварщик",
                "openReasonTitle": "Расширение штата",
                "headcount": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заявка заведена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Request"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
                    "number": null,
                    "publishedAt": null,
                    "position": "Сварщик",
                    "headcount": 2,
                    "openReason": "Расширение штата",
                    "desiredStartDate": "2026-11-02",
                    "deadline": "2026-10-30",
                    "salaryMin": null,
                    "salaryMax": null,
                    "salaryHidden": true,
                    "salaryMasked": true,
                    "currency": "RUB",
                    "justification": "Цех выходит на вторую смену.",
                    "department": 12,
                    "departmentName": "Отдел продаж",
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "company": null,
                    "stage": "draft",
                    "closeReason": null,
                    "allowedStages": [],
                    "createdAt": "2026-09-30T09:00:00Z",
                    "activeApplications": null,
                    "template": {
                      "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                      "title": "Сварщик цеха",
                      "archived": false,
                      "headcountMax": 5,
                      "salaryMin": null,
                      "salaryMax": null,
                      "salaryHidden": true,
                      "salaryMasked": true,
                      "currency": "RUB",
                      "modes": {
                        "headcount": "author",
                        "deadline": "author",
                        "salary": "hidden",
                        "work_format": "fixed",
                        "brief_tasks": "author",
                        "brief_conditions": "fixed",
                        "brief_schedule": "fixed",
                        "brief_hiring_steps": "fixed",
                        "profile_experience": "author",
                        "profile_skills": "author",
                        "profile_education": "author",
                        "profile_stoppers": "fixed"
                      },
                      "reasons": [
                        "Расширение штата",
                        "Замена сотрудника"
                      ]
                    },
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": "Смена 2/2, спецодежда.",
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Собеседование с мастером, пробная сварка.",
                      "regionId": null,
                      "professionId": null,
                      "workFormat": "on_site"
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргонодуговая сварка.",
                      "education": null,
                      "stoppers": "Нет допуска НАКС."
                    },
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех металлоконструкций"
                      }
                    ],
                    "progress": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "languages": [
                      "ru"
                    ],
                    "workSchedule": "5_2",
                    "offerApprovalRequired": true,
                    "creationMode": "template",
                    "openReasons": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код invalid_value — значение не принято; поле называет details.field: templateId — передана пустая строка; headcount — вне 1…65535, выше потолка шаблона или поле закреплено; deadline, desiredStartDate — не дата; salaryMin, salaryMax — не деньги, вне границ range, закреплены или скрыты от автора; details.field пусто — нижняя граница выше верхней; workFormat, brief.*, profile.* — длиннее предела или закреплены; justification — длиннее 4000 символов; openReasonTitle — причина не из допустимых; department — отдел не из допустимых или их несколько, а отдел не выбран. Код bad_request — тело не разбирается, в нём неизвестный ключ или значение не того типа. Условия заявки: details.reason называет причину — invalid (код вне словаря, пустая строка кода, пояс вне tzdata), too_long (текст длиннее maxLength), too_many (набор больше maxItems), duplicate (повтор в наборе languages, fileIds или observerIds), ref_rejected (юрлицо недействующее или чужое, наблюдатель вне снимка Битрикс24 или ушёл), file_rejected (файл не годится или адрес не разбирается). Без details.reason — поле закреплено режимом шаблона (наблюдатели — всегда), неразборный legalEntityId, marketReview: null, salaryComment от того, кому вилка скрыта (с любым значением), и fileIds, присланный ключом API (с любым значением, null тоже). Самостоятельная должность, пустой templateId, null/негодная численность и отсутствующая причина дают invalid_value с соответствующим details.field. Неизвестные поля, включая серверный маркер, дают bad_request.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "not_found — неправильный непустой UUID шаблона или шаблон отсутствует, чужой, скрыт либо архивен. Ошибочная ссылка не выбирает самостоятельную ветку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/appRequestCreateFeatureUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/{id}": {
      "get": {
        "operationId": "appRequest",
        "tags": [
          "План найма"
        ],
        "summary": "Карточка заявки",
        "description": "Для самостоятельной заявки template=null, creationMode=blank и допустимые причины в openReasons; у шаблонной template сохраняет прежнюю форму и openReasons=[]. Заявка вызывающего с тем, что нужно форме правки: режимы полей ТЕКУЩЕГО шаблона и границы range, допустимые причины, отделы для выбора, бриф и профиль, прогресс круга. Открывается автору и тогда, когда он выпал из аудитории шаблона или шаблон ушёл в архив.\n\nВилка вакансии: salaryMin и salaryMax приходят null, когда сходятся три условия — у заявки снимок salaryHidden = true, вызывающий — её автор, и правка вакансий у него ниже уровня all. Признак salaryHidden приходит всегда. Отличить скрытую вилку от незаданной позволяет именно он.\n\nТребует права vacancy_request · view.\n\nПоля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка заявки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Request"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
                    "number": null,
                    "publishedAt": null,
                    "position": "Сварщик",
                    "headcount": 2,
                    "openReason": "Расширение штата",
                    "desiredStartDate": "2026-11-02",
                    "deadline": "2026-10-30",
                    "salaryMin": null,
                    "salaryMax": null,
                    "salaryHidden": true,
                    "salaryMasked": true,
                    "currency": "RUB",
                    "justification": "Цех выходит на вторую смену.",
                    "department": 12,
                    "departmentName": "Отдел продаж",
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "company": null,
                    "stage": "draft",
                    "closeReason": null,
                    "allowedStages": [],
                    "createdAt": "2026-09-30T09:00:00Z",
                    "activeApplications": null,
                    "template": {
                      "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                      "title": "Сварщик цеха",
                      "archived": false,
                      "headcountMax": 5,
                      "salaryMin": null,
                      "salaryMax": null,
                      "salaryHidden": true,
                      "salaryMasked": true,
                      "currency": "RUB",
                      "modes": {
                        "headcount": "author",
                        "deadline": "author",
                        "salary": "hidden",
                        "work_format": "fixed",
                        "brief_tasks": "author",
                        "brief_conditions": "fixed",
                        "brief_schedule": "fixed",
                        "brief_hiring_steps": "fixed",
                        "profile_experience": "author",
                        "profile_skills": "author",
                        "profile_education": "author",
                        "profile_stoppers": "fixed"
                      },
                      "reasons": [
                        "Расширение штата",
                        "Замена сотрудника"
                      ]
                    },
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": "Смена 2/2, спецодежда.",
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Собеседование с мастером, пробная сварка.",
                      "regionId": null,
                      "professionId": null,
                      "workFormat": "on_site"
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргонодуговая сварка.",
                      "education": null,
                      "stoppers": "Нет допуска НАКС."
                    },
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех металлоконструкций"
                      }
                    ],
                    "progress": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "languages": [
                      "ru"
                    ],
                    "workSchedule": "5_2",
                    "offerApprovalRequired": true,
                    "creationMode": "template",
                    "openReasons": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found — своей заявки нет: строка отсутствует, чужая либо является обычной вакансией без происхождения заявки. Тот же ответ на негодный адрес.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appRequestPatch",
        "tags": [
          "План найма"
        ],
        "summary": "Править заявку",
        "description": "Для самостоятельной заявки template=null, creationMode=blank и допустимые причины в openReasons; у шаблонной template сохраняет прежнюю форму и openReasons=[]. Автор правит заявку на этапах draft и rejected: поля шаблона с режимом author и range в ТЕКУЩЕМ шаблоне, причину открытия, обоснование, дату выхода и отдел. Присылаются только меняемые поля.\n\nВилка вакансии: salaryMin и salaryMax приходят null, когда сходятся три условия — у заявки снимок salaryHidden = true, вызывающий — её автор, и правка вакансий у него ниже уровня all. Признак salaryHidden приходит всегда. Отличить скрытую вилку от незаданной позволяет именно он.\n\nТребует права vacancy_request · edit.\n\nПринимает поля условий заявки: `legalEntityId`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `observerIds`, с пределами, как у шаблона. Ключ API не присылает `fileIds` (400). Поля условий заявки необязательны: `legalEntity`, `employmentType`, `marketReview`, `salaryComment`, `languages`, `location`, `timezone`, `workSchedule`, `customerWishes`, `files`, `observers`. Ключу API они приходят без `files[].id`, `observers[].name` и `observers[].active`. Признак `termsUnreadable` означает, что тексты условий не открылись и не пришли. `salaryComment` скрыт вместе с вилкой. Отказы полей условий — 400 invalid_value с полем в details.field и причиной details.reason: invalid, too_long, too_many, duplicate, ref_rejected или file_rejected. `salaryComment`, присланный тем, кому вилка скрыта, — 400 invalid_value с полем salaryComment.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес заявки.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestPatchBody"
              },
              "example": {
                "justification": "Цех выходит на вторую смену с ноября.",
                "headcount": 3
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Заявка после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Request"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
                    "number": null,
                    "publishedAt": null,
                    "position": "Сварщик",
                    "headcount": 3,
                    "openReason": "Расширение штата",
                    "desiredStartDate": "2026-11-02",
                    "deadline": "2026-10-30",
                    "salaryMin": null,
                    "salaryMax": null,
                    "salaryHidden": true,
                    "salaryMasked": true,
                    "currency": "RUB",
                    "justification": "Цех выходит на вторую смену с ноября.",
                    "department": 12,
                    "departmentName": "Отдел продаж",
                    "departmentMissing": false,
                    "interviewer": {
                      "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
                      "name": "Одинцова Мария Павловна"
                    },
                    "recruiter": null,
                    "company": null,
                    "stage": "draft",
                    "closeReason": null,
                    "allowedStages": [],
                    "createdAt": "2026-09-30T09:00:00Z",
                    "activeApplications": null,
                    "template": {
                      "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                      "title": "Сварщик цеха",
                      "archived": false,
                      "headcountMax": 5,
                      "salaryMin": null,
                      "salaryMax": null,
                      "salaryHidden": true,
                      "salaryMasked": true,
                      "currency": "RUB",
                      "modes": {
                        "headcount": "author",
                        "deadline": "author",
                        "salary": "hidden",
                        "work_format": "fixed",
                        "brief_tasks": "author",
                        "brief_conditions": "fixed",
                        "brief_schedule": "fixed",
                        "brief_hiring_steps": "fixed",
                        "profile_experience": "author",
                        "profile_skills": "author",
                        "profile_education": "author",
                        "profile_stoppers": "fixed"
                      },
                      "reasons": [
                        "Расширение штата",
                        "Замена сотрудника"
                      ]
                    },
                    "brief": {
                      "tasks": "Сварка металлоконструкций по чертежам.",
                      "conditions": "Смена 2/2, спецодежда.",
                      "schedule": "2/2 по 12 часов",
                      "hiringSteps": "Собеседование с мастером, пробная сварка.",
                      "regionId": null,
                      "professionId": null,
                      "workFormat": "on_site"
                    },
                    "profile": {
                      "experience": "От года на производстве.",
                      "skills": "Аргонодуговая сварка.",
                      "education": null,
                      "stoppers": "Нет допуска НАКС."
                    },
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех металлоконструкций"
                      }
                    ],
                    "progress": null,
                    "scenario": "regular",
                    "marketReview": false,
                    "languages": [
                      "ru"
                    ],
                    "workSchedule": "5_2",
                    "offerApprovalRequired": true,
                    "creationMode": "template",
                    "openReasons": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код invalid_value — значение не принято; поле называет details.field: headcount — вне 1…65535, выше потолка шаблона или поле закреплено; deadline, desiredStartDate — не дата; salaryMin, salaryMax — не деньги, вне границ range, закреплены или скрыты от автора; details.field пусто — нижняя граница выше верхней; workFormat, brief.*, profile.* — длиннее предела или закреплены; justification — длиннее 4000 символов; openReasonTitle — причина не из допустимых; department — отдел не из допустимых или их несколько, а отдел не выбран. Код bad_request — тело не разбирается, в нём неизвестный ключ или значение не того типа. Условия заявки: details.reason называет причину — invalid (код вне словаря, пустая строка кода, пояс вне tzdata), too_long (текст длиннее maxLength), too_many (набор больше maxItems), duplicate (повтор в наборе languages, fileIds или observerIds), ref_rejected (юрлицо недействующее или чужое, наблюдатель вне снимка Битрикс24 или ушёл), file_rejected (файл не годится или адрес не разбирается). Без details.reason — поле закреплено режимом шаблона (наблюдатели — всегда), неразборный legalEntityId, marketReview: null, salaryComment от того, кому вилка скрыта (с любым значением), и fileIds, присланный ключом API (с любым значением, null тоже).",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — своей заявки нет: строка отсутствует, чужая либо является обычной вакансией без происхождения заявки. Тот же ответ на негодный адрес.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код stage_forbidden — заявка не на этапе draft или rejected: после отправки на согласование её не правят. 409, а не 400: тело законно, а этап не позволяет. Код vacancy_archived: заявка в архиве — она не правится, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "stage_forbidden",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications": {
      "get": {
        "operationId": "appApplications",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: список",
        "description": "Страница откликов портала, свежие сверху. Отборы складываются: vacancy — отклики одной вакансии, stage — один этап или active, q — подстрока фамилии, имени или отчества кандидата. Исключение — review: отбор по статусу разбора с q и fit не складывается, такая пара отвергается кодом invalid_value.\n\nstage=active — все этапы, кроме «Отказ» (rejected) и «Выход на работу» (hired). Это ровно те отклики, которые считает поле activeApplications вакансии: страница с `vacancy=<id>` и stage=active показывает те самые отклики, что вошли в число, — в пределах того же уровня доступа.\n\nТребует права application · view, и выдача СУЖАЕТСЯ уровнем вызывающего: «только свои» отдаёт отклики, где он ответственный или автор; «все» отдаёт портал целиком. Какой уровень достался вызывающему, сказано в grants ответа GET /api/v1/me. Отбор vacancy уровнем к вакансиям не сужается: строки уже отобраны уровнем к откликам, и отбор не показывает ничего сверх видимого без него.\n\nstep — шаг вида «Откликов» (ApplicationStepKind): «Разбор», «Собеседование», «Решение», «Оффер», «Выход», «Отказы». Шаг считает сервер из этапа, живых приглашений, встреч и кругов решения на нынешнем этапе — тем же правилом, что поле step строки, — и отбирает только отклики обычного сценария: массовый подбор шагов не знает. Отбор шага — своя ось: вместе со stage, review и fit он отвергается кодом invalid_value (поле step). «Все» отдельного кода не имеет — это stage=active и scenario=regular: отклики в работе без «Выхода» и «Отказов». Поиск q с шагом ищет внутри шага, без шага — по всем.\n\nverdict — вердикт «Разбора» (ReviewVerdictFilter): fit, unsure, unfit, none или stale — «Устарел», анализ ИИ сделан по версии портрета, которая уже не главная. Только вместе с vacancy и step=review: вердикты разных вакансий не сравнимы; иначе — invalid_value (поле verdict). Отклик с устаревшим анализом попадает и под свой вердикт.\n\nПорядок «Разбора»: со step=review и vacancy, когда сортировку не назвали (нет sort, dir и mineFirst), страница идёт по действующей оценке по убыванию — ручной «Разбора», иначе оценке ИИ, без анализа в конце, — затем от давних к новым по дате отклика, затем по id; курсор такой страницы несёт ранг последней строки. step=review без vacancy и без сортировки — от давних к новым: оценки разных вакансий не сравнимы. Названная сортировка действует, как на любом шаге.",
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": false,
            "description": "public_id вакансии: только её отклики. Вакансии с таким id в портале нет — 404.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "Код одного этапа или active — все этапы, кроме rejected и hired. Без параметра — все этапы.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationStageFilter"
            }
          },
          {
            "name": "fit",
            "in": "query",
            "required": false,
            "description": "Отбор по соответствию разбора «Разбора» — он хранится за откликом и читается на любом шаге. Работает вместе с vacancy — разбор идёт по одной вакансии; без неё параметр отвергается кодом invalid_value. Строки с вердиктом прежней доски «Собеседования» и «Оффера» отбираются по сырому столбцу, пока эти отклики не уйдут со стадии (поле fit у них — maybe). Устарел: отклики «Нового» в нужном статусе отдаёт review; параметр будет удалён.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationFit"
            },
            "deprecated": true
          },
          {
            "name": "review",
            "in": "query",
            "required": false,
            "description": "Статус разбора стадии: отклики стадии stage в этом статусе. Работает с vacancy и ровно одним этапом в stage, который разбирается: new (hired и rejected — invalid_value, поле review) — статус есть у пары «отклик + стадия». Закрытая стадия разбора (interview, offer) — 409 review_stage_closed: выбирать в ней нечего. С q и fit не складывается: такой запрос отвергается кодом invalid_value с полем q или fit, а не отдаёт отклики стадии без отбора. С этим отбором список идёт по скору (sort=score), какую бы ось ни назвали; mineFirst с ним не работает.",
            "schema": {
              "$ref": "#/components/schemas/ReviewStatus"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока фамилии, имени или отчества кандидата.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. Непрозрачный, чтобы форму курсора можно было сменить, не ломая контракт.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Ось сортировки страницы.`createdAt` — по дате отклика; `updatedAt` — по дате последней правки; `alpha` — по ФИО кандидата (фамилия → имя → отчество). Смена оси инвалидирует курсор: сервер отвечает 400 `bad_request`. `score` — по скору соответствия, отклики без скора в конце. С отбором `review` — по действующей оценке (ручная, иначе бота); без него — по оценке бота (`review.scoreBot`). Строки с оценкой прежней доски «Собеседования» и «Оффера» стоят по сырой оценке, пока эти отклики не уйдут со стадии; `score` и `review.scoreBot` у них null. Без sort, dir и mineFirst со `step=review` порядок свой — порядок «Разбора» (описание операции); названная ось его отменяет.",
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "updatedAt",
                "alpha",
                "score"
              ],
              "default": "createdAt"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "description": "Направление сортировки. `desc` — сегодняшнее умолчание (свежие сверху); `asc` переворачивает и порядок, и компаратор курсора.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "mineFirst",
            "in": "query",
            "required": false,
            "description": "«Мои сверху»: `true` — отклики, где вызывающий стоит ответственным, идут перед прочими. Работает только с `sort=createdAt`; с другими осями сервер отвечает 400 `invalid_value` (поле `mineFirst`). Требует индекс `ix_application_responsible_id`.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "responsible",
            "in": "query",
            "required": false,
            "description": "`public_id` ответственного: страница отдаст только его отклики. Отсутствие или пустая строка — фильтр не применяется. Неизвестный идентификатор отвечает 400 `invalid_value` (поле `responsible`).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "description": "Что добрать к строкам. `review` — фразу-вывод и пункты разбора «Разбора» (на любом шаге), обоснование человека, оценку бота и историю прошлых стадий. Без параметра разбор не едет вовсе: тот же отклик отдают и другие вызовы этого списка, которым пункты не нужны.",
            "schema": {
              "type": "string",
              "enum": [
                "review"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ApplicationSource"
            },
            "description": "Источник отклика, независимо от type."
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ApplicationType"
            },
            "description": "Тип отклика, независимо от source."
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "description": "Отбор по сохранённому сценарию до пагинации и подсчёта. Без параметра область общего API сохраняется.",
            "schema": {
              "$ref": "#/components/schemas/VacancyScenario"
            }
          },
          {
            "name": "step",
            "in": "query",
            "required": false,
            "description": "Шаг вида «Откликов»: только отклики этого шага, только обычного сценария. Без параметра шаг не отбирается. Вместе со stage, review или fit, а также код вне перечня (в том числе резерв test) — 400 invalid_value, поле step.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationStepKind"
            }
          },
          {
            "name": "verdict",
            "in": "query",
            "required": false,
            "description": "Вердикт «Разбора» одной вакансии: fit, unsure, unfit, none (нет анализа) или stale (анализ устарел — версия портрета в нём не главная). Только с vacancy и step=review, иначе 400 invalid_value, поле verdict.",
            "schema": {
              "$ref": "#/components/schemas/ReviewVerdictFilter"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница откликов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "applications": [
                      {
                        "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                        "candidate": {
                          "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                          "name": "Кузнецов Алексей Игоревич",
                          "contacts": [
                            {
                              "kind": "phone",
                              "value": "+7 916 555-12-34"
                            },
                            {
                              "kind": "telegram",
                              "value": "@kuznetsov_cnc"
                            }
                          ]
                        },
                        "vacancy": {
                          "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                          "position": "Оператор станка ЧПУ"
                        },
                        "stage": "interview",
                        "hiredOn": null,
                        "historicalOn": null,
                        "fit": "high",
                        "fitBot": "high",
                        "fitHuman": null,
                        "score": 92,
                        "scoreSource": "ai",
                        "reviewStatus": "fit",
                        "allowedStages": [
                          "new"
                        ],
                        "formStages": [
                          "offer",
                          "hired",
                          "rejected"
                        ],
                        "responsible": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                        "note": "Работал на стойке Heidenhain, готов к сменному графику.",
                        "createdAt": "2026-09-14T08:05:41Z",
                        "source": "hh",
                        "channels": [
                          "hh"
                        ],
                        "decision": {
                          "verdict": null,
                          "pending": false
                        },
                        "nextInterviewAt": "2026-09-16T08:00:00Z",
                        "journey": {
                          "phase": "interview_scheduled",
                          "step": "interview",
                          "steps": [
                            "application",
                            "interview",
                            "decision",
                            "offer",
                            "hired"
                          ]
                        },
                        "type": "unspecified",
                        "submittedBy": null,
                        "submittedSnapshot": null,
                        "rejection": null,
                        "step": "interview",
                        "state": {
                          "code": "meeting_scheduled",
                          "kind": "wait",
                          "since": "2026-09-15T12:30:00Z",
                          "marks": []
                        },
                        "decider": null,
                        "decisionState": null,
                        "liveInvite": {
                          "id": "8a1f0c3e-6b27-4d59-a0e4-2c7b9d15f683",
                          "state": "booked"
                        },
                        "verdict": "fit",
                        "verdictSource": "ai",
                        "rejectedFrom": null,
                        "stageEnteredAt": "2026-09-15T09:00:00Z"
                      },
                      {
                        "id": "c7d19e03-82b5-4a6f-b0d4-5e8a2c61f937",
                        "candidate": {
                          "id": "1d6b0e8f-94a2-4c37-a5f1-7b3e9d20c486",
                          "name": "Петрова Анна",
                          "contacts": [
                            {
                              "kind": "email",
                              "value": "anna.petrova@example.ru"
                            }
                          ]
                        },
                        "vacancy": {
                          "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                          "position": "Оператор станка ЧПУ"
                        },
                        "stage": "new",
                        "hiredOn": null,
                        "historicalOn": null,
                        "fit": "high",
                        "fitBot": "high",
                        "fitHuman": null,
                        "score": 92,
                        "scoreSource": "ai",
                        "reviewStatus": "fit",
                        "allowedStages": [
                          "interview"
                        ],
                        "formStages": [
                          "offer",
                          "hired",
                          "rejected"
                        ],
                        "responsible": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "resumeUrl": null,
                        "note": null,
                        "createdAt": "2026-09-13T16:22:09Z",
                        "source": "hh",
                        "channels": [],
                        "decision": null,
                        "nextInterviewAt": null,
                        "journey": {
                          "phase": "review",
                          "step": "application",
                          "steps": [
                            "application",
                            "interview",
                            "decision",
                            "offer",
                            "hired"
                          ]
                        },
                        "type": "unspecified",
                        "submittedBy": null,
                        "submittedSnapshot": null,
                        "rejection": null,
                        "step": "review",
                        "state": {
                          "code": "review",
                          "kind": "turn",
                          "since": "2026-09-13T16:22:09Z",
                          "marks": []
                        },
                        "decider": null,
                        "decisionState": null,
                        "liveInvite": null,
                        "verdict": "fit",
                        "verdictSource": "ai",
                        "rejectedFrom": null,
                        "stageEnteredAt": "2026-09-13T16:22:09Z"
                      }
                    ],
                    "nextCursor": "eyJwIjoiYzdkMTllMDMtODJiNS00YTZmLWIwZDQtNWU4YTJjNjFmOTM3In0"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Этап или vacancy не разобрались, курсор не разобрался, ни на что не указывает или принадлежит другому порядку — код bad_request. Отбор fit или review без vacancy, review не с одним этапом, step вместе со stage, review или fit, verdict без vacancy и step=review, неизвестное значение отбора — код invalid_value, details.field называет поле.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии из параметра vacancy в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код review_stage_closed: review= названа вместе со stage=interview или stage=offer — разбор этой стадии закрыт, разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.5).",
            "x-error-codes": [
              "review_stage_closed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Неизвестный сценарий",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "invalid_value"
            ]
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Завести отклик",
        "description": "Кандидат находится по контакту или заводится той же операцией. Контакт, уже известный порталу, указывает на существующего кандидата, и его имя введённым не перезаписывается: в портале может лежать более полная запись того же человека. Контакты сравниваются в нормальной форме: у телефона «+7 916…», «8 916…» и «7916…» — один номер, у почты не важен регистр, у Telegram — регистр и ведущая @.\n\nКонтакт при заведении ровно один: два могли бы указать на двух разных кандидатов, и у вопроса «чей это отклик» стало бы два ответа. Остальные контакты человека добавляет правка отклика.\n\nКандидат, отклик и запись в журнал появляются вместе или не появляются вовсе. Новый отклик стоит на этапе new; ответственный, если не назван, — сам вызывающий.\n\nТребует права application · edit и видимости вакансии на уровне vacancy · view: вакансия вне уровня вызывающего отвечает 404, как несуществующая.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заведённый отклик",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "e4b8c1d7-2a95-4f3e-8d06-b7c3a9f1e582",
                    "candidate": {
                      "id": "7f3d2b9c-5e61-4a08-9c47-d2e8b1a6f035",
                      "name": "Соколова Ирина Андреевна",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "8 903 123-45-67"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                      "position": "Сварщик"
                    },
                    "stage": "new",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/sokolova.pdf",
                    "note": null,
                    "createdAt": "2026-09-15T10:41:27Z",
                    "source": "hh",
                    "channels": [],
                    "decision": null,
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "review",
                      "step": "application",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "review",
                    "state": {
                      "code": "review",
                      "kind": "turn",
                      "since": "2026-09-15T10:41:27Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T10:41:27Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Поле не прошло проверку — код invalid_value, details.field называет какое. contact_not_allowed: вводимое имя содержит ссылку или контакт; details.field и details.offset (исходный Unicode code point), без исходного текста. Импортированное имя площадки не переписывается.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Вакансии с таким vacancyId в этом портале нет или она вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Этот человек уже откликался на эту вакансию — код already_applied. Второй отклик не заводится: у человека один отклик на вакансию, и найти его можно в списке по vacancy и q. details.existingApplicationId — public_id существующего отклика, только если вызывающий видит именно его уровнем application · view; иначе деталей нет, и ни адреса, ни контакта, ни ссылки отказ не несёт.\n\nВакансия закрыта (stage completed) — код vacancy_closed: обычный отклик на закрытую вакансию не заводится. Проверка идёт под замком вакансии, который берёт и закрытие, раньше кандидата и контакта, поэтому ничего не записано. Для нового набора вакансию переоткрывают (appMoveVacancy) или заводят новую заявку. Прошлый отклик на закрытую вакансию вносится отдельной операцией appCreateHistoricalApplication — с датой отклика и категорией причины. Код contact_taken — контакт из тела уже принадлежит другому кандидату: карточки побочным эффектом не склеиваются. Код contact_form_candidate — контакт у кандидата из Telegram-формы: он дал согласие только на одну вакансию, второй отклик не заводится — попросите его откликнуться заново. Вакансия в архиве — код vacancy_archived: обычный отклик на неё не заводится, исторический ввод тоже; архивная завершённая отвечает им, а не vacancy_closed. Проверка идёт под тем же замком вакансии раньше кандидата и контакта, поэтому ничего не записано. Сначала вакансию возвращают из архива (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "already_applied",
              "contact_form_candidate",
              "contact_taken",
              "vacancy_closed",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "vacancy_archived": {
                    "value": {
                      "error": {
                        "code": "vacancy_archived",
                        "message": "вакансия в архиве",
                        "retryable": false
                      }
                    }
                  },
                  "already_applied": {
                    "value": {
                      "error": {
                        "code": "already_applied",
                        "message": "этот человек уже откликался на эту вакансию",
                        "retryable": false,
                        "details": {
                          "existingApplicationId": "e4b8c1d7-2a95-4f3e-8d06-b7c3a9f1e582"
                        }
                      }
                    }
                  },
                  "vacancy_closed": {
                    "value": {
                      "error": {
                        "code": "vacancy_closed",
                        "message": "вакансия закрыта: обычный отклик на неё не заводится",
                        "retryable": false
                      }
                    }
                  },
                  "contact_form_candidate": {
                    "value": {
                      "error": {
                        "code": "contact_form_candidate",
                        "message": "контакт у кандидата из Telegram-формы — попросите его откликнуться заново",
                        "retryable": false
                      }
                    }
                  },
                  "contact_taken": {
                    "value": {
                      "error": {
                        "code": "contact_taken",
                        "message": "контакт уже принадлежит другому кандидату",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}": {
      "get": {
        "operationId": "appApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: карточка",
        "description": "Один отклик целиком: кандидат, вакансия, этап с разрешёнными переходами, ответственный, источник, ссылка на резюме и заметка.\n\nОтдаёт ту же схему Application, что и строка списка: вторая схема на те же данные разошлась бы с первой на первом же новом поле.\n\nТребует права application · view и сужается его уровнем: отклик, невидимый в списке, отвечает 404, а не 403 — отказ подтверждал бы, что такой отклик есть.\n\nwith=review — то же, что у списка: к отклику едет разбор «Разбора» на любом шаге (вывод, пункты, обоснование, оценка бота) и история прошлых стадий. Им открывают отклик, которого нет в загруженной странице.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": false,
            "description": "Что добрать к отклику. `review` — разбор «Разбора» на любом шаге (вывод, пункты, обоснование, оценка бота) и историю прошлых стадий. Без параметра разбор не едет вовсе. Неизвестное значение — 400 `invalid_value` (поле `with`).",
            "schema": {
              "type": "string",
              "enum": [
                "review"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка отклика",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Инженер-технолог"
                    },
                    "stage": "offer",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new",
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": "fit",
                      "pending": false
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "offer",
                      "step": "offer",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "offer",
                    "state": {
                      "code": "await_offer_answer",
                      "kind": "wait",
                      "since": "2026-09-22T10:00:00Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-22T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неизвестное значение with — код invalid_value, details.field — with.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appPatchApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Править отклик",
        "description": "Частичная правка: присылаются ТОЛЬКО меняемые поля — контакт кандидата, ответственный, ссылка на резюме, заметка. Имя кандидата и вакансию эта операция не меняет, этап меняется через POST /api/v1/applications/{id}/stage; присланные сюда, они дают invalid_value.\n\nКонтакт правится у КАНДИДАТА, а не у отклика: новый телефон виден во всех откликах этого человека. Контакт того же вида заменяется, контакт нового вида добавляется. Контакт, который уже принадлежит другому кандидату, карточки не склеивает, а даёт contact_taken.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-98-76"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "interview",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику. Новый номер с 15.09.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": null,
                      "pending": true
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "decision",
                      "step": "decision",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "decision",
                    "state": {
                      "code": "await_customer",
                      "kind": "wait",
                      "since": "2026-09-16T09:00:00Z",
                      "marks": []
                    },
                    "decider": {
                      "id": "2d9b6e41-0c5a-4f87-b3e2-91a7c4d8f056",
                      "name": "Белова Ирина Сергеевна"
                    },
                    "decisionState": "pending",
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Поле не прошло проверку или этой операцией не меняется — код invalid_value, details.field называет какое.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Контакт уже принадлежит другому кандидату — код contact_taken. Код source_locked — у отклика Telegram-формы источник не меняется: он часть факта согласия кандидата. Код candidate_purged — данные кандидата удалены по сроку хранения или отзыву согласия: править нечего.",
            "x-error-codes": [
              "contact_taken",
              "source_locked",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/stage": {
      "post": {
        "operationId": "appMoveApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Перевести отклик на другой этап",
        "description": "Ответ — отклик целиком, а не 204: вместе с этапом меняются allowedStages и formStages, поэтому перечитывать его после перевода не нужно.\n\nfromStage обязателен — это этап, который вызывающий видел. Расходится с настоящим — перевода нет, ответ stage_forbidden: иначе перевод по устаревшей странице молча отменил бы чужую работу, например отказ, отправленный из соседней вкладки. allowedStages от этого не спасает — он из того же устаревшего ответа.\n\nВ offer и hired эта операция не ведёт: у этих этапов есть свои данные — у оффера сумма, вилка, срок ответа и один действующий оффер, у выхода день выхода и свободная единица вакансии, — и туда ведут только отправка оффера POST /api/v1/applications/{id}/offers и отметка выхода POST /api/v1/applications/{id}/hire. Перевод в offer или hired отвечает stage_requires_form, откуда бы он ни шёл; такие этапы отклик называет в formStages. Перевод с hired очищает день выхода hiredOn.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий. В rejected ведёт только POST /api/v1/applications/{id}/reject: /stage отвечает 409 stage_requires_form.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationMoveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после перевода",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "interview",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": "fit",
                      "pending": false
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "decision",
                      "step": "decision",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "decision",
                    "state": {
                      "code": "prepare_offer",
                      "kind": "turn",
                      "since": "2026-09-17T11:20:00Z",
                      "marks": []
                    },
                    "decider": {
                      "id": "2d9b6e41-0c5a-4f87-b3e2-91a7c4d8f056",
                      "name": "Белова Ирина Сергеевна"
                    },
                    "decisionState": "decided",
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Этап пуст или неизвестен — код invalid_value, details.field называет fromStage или stage.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код stage_requires_form: в этот этап ведёт форма операции, а не смена этапа — в offer ведёт только отправка оффера, в hired — только отметка выхода. Код stage_forbidden: исходный этап не совпал с настоящим или отклик переводят в тот этап, на котором он уже стоит. 409, а не 400: тело законно, а состояние отклика не позволяет. Код historical_application: отклик внесён историческим вводом в закрытую вакансию (appCreateHistoricalApplication) — это запись прошлого отказа, и в работу его не переводят; его allowedStages пуст. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения. Код vacancy_archived: вакансия отклика в архиве, а отклик переводят из неактивного этапа (rejected, hired) в активный — в работу его не возвращают, пока вакансию не вернут из архива (POST /api/v1/vacancies/{id}/restore); allowedStages такого отклика активных этапов не несёт. Перевод активного отклика между активными этапами на архивной вакансии разрешён.",
            "x-error-codes": [
              "stage_forbidden",
              "stage_requires_form",
              "candidate_purged",
              "historical_application",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "vacancy_archived": {
                    "value": {
                      "error": {
                        "code": "vacancy_archived",
                        "message": "вакансия в архиве",
                        "retryable": false
                      }
                    }
                  },
                  "stage_forbidden": {
                    "value": {
                      "error": {
                        "code": "stage_forbidden",
                        "message": "переход между этапами запрещён",
                        "retryable": false
                      }
                    }
                  },
                  "stage_requires_form": {
                    "value": {
                      "error": {
                        "code": "stage_requires_form",
                        "message": "в этот этап ведёт форма, а не смена этапа",
                        "retryable": false
                      }
                    }
                  },
                  "historical_application": {
                    "value": {
                      "error": {
                        "code": "historical_application",
                        "message": "исторический отклик не переводится в работу",
                        "retryable": false
                      }
                    }
                  },
                  "candidate_purged": {
                    "value": {
                      "error": {
                        "code": "candidate_purged",
                        "message": "данные кандидата удалены",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Запись новых массовых стадий выключена.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "blue_collar_disabled"
            ]
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/candidates": {
      "get": {
        "operationId": "appCandidates",
        "tags": [
          "База кандидатов"
        ],
        "summary": "Кандидаты: список",
        "description": "Страница базы кандидатов, недавно заведённые сверху.\n\nСтатус вычисляется по ВСЕМ откликам человека и потому одинаков для всех смотрящих: есть активный отклик — working, активных нет и есть вышедший на работу — hired, остались одни отказы — rejected, откликов нет вовсе — none. Статус нигде не хранится: хранимый пришлось бы чинить при каждом переводе этапа, и он молча расходился бы с откликами.\n\nТребует права candidate · view. У этого права два уровня, «нет» и «все»: база кандидатов открыта или закрыта целиком — «свои кандидаты» не описывает ничего, потому что человека заводит тот, кто первым принёс его отклик, а работают с ним другие.\n\nДолжность и источник — детали работы по человеку, и они приходят под ДРУГИМ правом, application · view: видно ноль откликов — в этих полях null, а статус остаётся настоящим.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "ФИО, телефон, почта или телеграм. Контакт ищется с НАЧАЛА нормальной формы: «+7 916 555-12-34» и «89165551234» — один и тот же запрос, а поиск по хвосту номера не обслуживается."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/CandidateStatusGroup"
            },
            "description": "Отбор по группе статуса. Без параметра — все."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ApplicationSource"
            },
            "description": "Кандидаты, у которых есть ВИДИМЫЙ отклик с этим источником."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "nextCursor предыдущей страницы. Непрозрачный."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "createdAt",
                "alpha"
              ],
              "default": "createdAt"
            },
            "description": "Ось: createdAt — по дате заведения; alpha — по ФИО. Оси «последняя активность» нет: это агрегат по откликам, и сортировка по нему прошла бы весь портал до взятия страницы."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            },
            "description": "Направление сортировки."
          },
          {
            "name": "attention",
            "in": "query",
            "required": false,
            "description": "Личные приглашения кандидатов, требующие действия. Только cookie-сессия.",
            "schema": {
              "type": "string",
              "enum": [
                "invitation"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница кандидатов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CandidateListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "candidates": [
                      {
                        "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                        "name": "Кузнецов Алексей Игоревич",
                        "status": {
                          "group": "working",
                          "stage": "offer"
                        },
                        "applicationsCount": 2,
                        "lastActivityAt": "2026-09-21T11:20:03Z",
                        "position": "Инженер-технолог",
                        "source": "hh"
                      },
                      {
                        "id": "1d6b0e8f-94a2-4c37-a5f1-7b3e9d20c486",
                        "name": "Петрова Анна",
                        "status": {
                          "group": "none",
                          "stage": null
                        },
                        "applicationsCount": 0,
                        "lastActivityAt": null,
                        "position": null,
                        "source": null
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Параметр не разобрался — код bad_request: неизвестная группа статуса, неизвестный источник, чужая ось или испорченный курсор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCandidateCreate",
        "tags": [
          "База кандидатов"
        ],
        "summary": "Кандидаты: завести вручную",
        "description": "Заводит человека БЕЗ отклика: он появляется в базе со статусом none, отклик добавляется позже.\n\nКонтакт уже принадлежит кому-то — 409 candidate_exists, и public_id найденного приезжает в details.id. Молча вернуть найденного как созданного нельзя: заводящий решил, что человек новый, и обязан увидеть, что это не так. Имя найденного тоже не переписывается — в базе может лежать выверенная запись.\n\nТребует права candidate · edit. Форма отклика заводит человека вторым путём, под своим правом application · edit: закрыть тот путь правом на кандидата значило бы отнять у рекрутера заведение откликов на новых людей.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandidateCreateRequest"
              },
              "example": {
                "lastName": "Петрова",
                "firstName": "Анна",
                "contact": {
                  "kind": "phone",
                  "value": "+7 916 555-12-34"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Кандидат заведён",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CandidateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "1d6b0e8f-94a2-4c37-a5f1-7b3e9d20c486",
                    "name": "Петрова Анна",
                    "contacts": [
                      {
                        "kind": "phone",
                        "value": "+7 916 555-12-34"
                      }
                    ],
                    "status": {
                      "group": "none",
                      "stage": null
                    },
                    "applicationsCount": 0,
                    "lastActivityAt": null,
                    "applications": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Поле не прошло проверку — код invalid_value, details.field называет какое. contact_not_allowed: вводимое имя содержит ссылку или контакт; details.field и details.offset (исходный Unicode code point), без исходного текста. Импортированное имя площадки не переписывается.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "Человек с таким контактом уже в базе — код candidate_exists. Его public_id — в details.id: по нему открывается карточка найденного.",
            "x-error-codes": [
              "candidate_exists"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/candidates/{id}": {
      "get": {
        "operationId": "appCandidate",
        "tags": [
          "База кандидатов"
        ],
        "summary": "Кандидаты: карточка",
        "description": "Человек, все его контакты и видимая история откликов.\n\nТребует права candidate · view. У этого права два уровня, «нет» и «все»: база кандидатов открыта или закрыта целиком — «свои кандидаты» не описывает ничего, потому что человека заводит тот, кто первым принёс его отклик, а работают с ним другие.\n\nИстория сужается правом application · view: пустой список при ненулевом applicationsCount значит «отклики есть, но не ваши», а не «откликов нет».",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "public_id кандидата."
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка кандидата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CandidateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                    "name": "Кузнецов Алексей Игоревич",
                    "contacts": [
                      {
                        "kind": "phone",
                        "value": "+7 916 555-12-34"
                      }
                    ],
                    "status": {
                      "group": "working",
                      "stage": "offer"
                    },
                    "applicationsCount": 2,
                    "lastActivityAt": "2026-09-21T11:20:03Z",
                    "applications": [
                      {
                        "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                        "vacancy": {
                          "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                          "position": "Инженер-технолог"
                        },
                        "stage": "offer",
                        "source": "hh",
                        "createdAt": "2026-09-14T08:05:41Z",
                        "historicalOn": null
                      },
                      {
                        "id": "c7d19e03-82b5-4a6f-b0d4-5e8a2c61f937",
                        "vacancy": {
                          "id": "9a1f7c34-2b60-4d85-8e13-7f2a6c904db5",
                          "position": "Мастер участка"
                        },
                        "stage": "rejected",
                        "source": "referral",
                        "createdAt": "2026-03-02T09:14:00Z",
                        "historicalOn": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Кандидата с таким public_id в портале нет — код not_found. Чужой портал отвечает так же: отказ подтверждал бы, что такой человек существует.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appCandidatePatch",
        "tags": [
          "База кандидатов"
        ],
        "summary": "Кандидаты: правка карточки",
        "description": "Правит ФИО и набор контактов. Присланное поле меняется, отсутствующее не трогается.\n\ncontacts — набор ЦЕЛИКОМ: чего в нём нет, то снимается. Отдельной ручки на контакт нет намеренно — адресовать контакт его значением значило бы поставить телефон в путь запроса, то есть в историю браузера и в заголовок Referer. Цена решения: две одновременные правки одного человека затирают друг друга.\n\nТребует права candidate · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "public_id кандидата."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandidatePatchRequest"
              },
              "example": {
                "lastName": "Кузнецова",
                "contacts": [
                  {
                    "kind": "phone",
                    "value": "+7 916 555-12-34"
                  },
                  {
                    "kind": "email",
                    "value": "a.kuznetsova@example.ru"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Карточка после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CandidateCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                    "name": "Кузнецов Алексей Игоревич",
                    "contacts": [
                      {
                        "kind": "phone",
                        "value": "+7 916 555-12-34"
                      }
                    ],
                    "status": {
                      "group": "working",
                      "stage": "offer"
                    },
                    "applicationsCount": 2,
                    "lastActivityAt": "2026-09-21T11:20:03Z",
                    "applications": [
                      {
                        "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                        "vacancy": {
                          "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                          "position": "Инженер-технолог"
                        },
                        "stage": "offer",
                        "source": "hh",
                        "createdAt": "2026-09-14T08:05:41Z",
                        "historicalOn": null
                      },
                      {
                        "id": "c7d19e03-82b5-4a6f-b0d4-5e8a2c61f937",
                        "vacancy": {
                          "id": "9a1f7c34-2b60-4d85-8e13-7f2a6c904db5",
                          "position": "Мастер участка"
                        },
                        "stage": "rejected",
                        "source": "referral",
                        "createdAt": "2026-03-02T09:14:00Z",
                        "historicalOn": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Поле не прошло проверку — код invalid_value. Пустой набор контактов — код contact_last: человек без контакта не находится поиском и не склеивается со своим следующим откликом. contact_not_allowed: вводимое имя содержит ссылку или контакт; details.field и details.offset (исходный Unicode code point), без исходного текста. Импортированное имя площадки не переписывается.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "contact_last",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Кандидата с таким public_id в портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Контакт принадлежит другому кандидату — код contact_taken. Перенести его правкой нельзя: уникальность контакта и есть склейка людей. Код candidate_purged — данные кандидата удалены по сроку хранения или отзыву согласия: править нечего.",
            "x-error-codes": [
              "contact_taken",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/counts": {
      "get": {
        "operationId": "appApplicationReviewCounts",
        "tags": [
          "Отклики"
        ],
        "summary": "Сколько откликов в каждой группе соответствия",
        "description": "Устарела: числа колонок по стадиям отдаёт GET /api/v1/applications/review-stages. Ручка живёт до contract-релиза и считает соответствие fit разбора «Разбора»: он хранится за откликом и читается на любом шаге, поэтому в числа входят и отклики, ушедшие со стадии: строки с вердиктом прежней доски «Собеседования» и «Оффера» считаются по сырому столбцу, пока эти отклики не уйдут со стадии (поле fit у них — maybe).\n\nСколько живых откликов вакансии в каждой группе соответствия и сколько их всего.\n\nОтдельная ручка, а не поле страницы: числа полные, а страница знает лишь то, что вызывающий уже забрал.\n\nСумма трёх групп равна total: это одно множество, разложенное по трём значениям. Нанятые и отказанные не считаются нигде — они решены.\n\nУровень application · view сужает и эти числа: на уровне «свои» считаются только свои отклики.\n\nТребует права application · view.",
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": true,
            "description": "public_id вакансии. Обязателен: разбор идёт по одной вакансии — скор осмыслен только против её требований.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Числа групп",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationReviewCounts"
                    }
                  }
                },
                "example": {
                  "data": {
                    "high": 18,
                    "maybe": 46,
                    "low": 177,
                    "total": 241
                  }
                }
              }
            }
          },
          "400": {
            "description": "Параметр vacancy не прислан или пуст — код invalid_value, details.field называет vacancy.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет или она вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "deprecated": true,
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/step-counts": {
      "get": {
        "operationId": "appApplicationStepCounts",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: числа шагов",
        "description": "Сколько откликов на каждом шаге вида «Откликов» (ApplicationStepKind): «Разбор», «Собеседование», «Решение», «Оффер», «Выход», «Отказы». Числа считаются тем же отбором, что GET /api/v1/applications с параметром step: число шага равно числу откликов, которые список отдаст с этим шагом и с теми же vacancy, q, source, type и responsible. Шаг считает сервер — тем же правилом, что поле step отклика; массовый подбор шагов не знает и в числа не входит.\n\n«Все» отдельного числа не имеет: это сумма review, interview, decision и offer — отклики в работе, без «Выхода» и «Отказов». Она равна числу откликов, которые список отдаёт со stage=active и scenario=regular.\n\nС поиском q каждое число считается не дальше 1000 совпадений: если их больше, n равно 1000, а capped — true (показывайте «1000+»). Без q числа точные, и capped всегда false.\n\nhistorical=exclude не считает исторические отклики — внесённые в закрытую вакансию историческим вводом (у такого отклика есть historicalOn). Без параметра они входят в «Отказы», как и в списке.\n\nТребует права application · view, и числа СУЖАЮТСЯ уровнем вызывающего, как строки списка: на уровне «только свои» считаются только отклики, где он ответственный или автор.",
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": true,
            "description": "public_id вакансии или all — все вакансии портала, включая завершённые. Обязателен: все вакансии называются явно. Вакансии с таким id в портале нет — 404.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока фамилии, имени или отчества кандидата, как у списка. С ним каждое число — не больше 1000 (capped).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Источник отклика, как у списка.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationSource"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Тип отклика, как у списка.",
            "schema": {
              "$ref": "#/components/schemas/ApplicationType"
            }
          },
          {
            "name": "responsible",
            "in": "query",
            "required": false,
            "description": "`public_id` ответственного: считаются только его отклики, как у списка. Пустая строка — фильтр не применяется. Неизвестный идентификатор отвечает 400 `invalid_value` (поле `responsible`).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "historical",
            "in": "query",
            "required": false,
            "description": "exclude — без исторических откликов. Без параметра они входят в «Отказы».",
            "schema": {
              "type": "string",
              "enum": [
                "exclude"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Числа шагов. В примере — ответ с поиском q: совпавших «Отказов» больше 1000.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationStepCounts"
                    }
                  }
                },
                "example": {
                  "data": {
                    "steps": {
                      "review": {
                        "n": 14,
                        "capped": false
                      },
                      "interview": {
                        "n": 6,
                        "capped": false
                      },
                      "decision": {
                        "n": 2,
                        "capped": false
                      },
                      "offer": {
                        "n": 1,
                        "capped": false
                      },
                      "hired": {
                        "n": 37,
                        "capped": false
                      },
                      "rejected": {
                        "n": 1000,
                        "capped": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "vacancy не прислан, пуст или не идентификатор и не all; source, type или historical вне словаря; responsible не идентификатор или такого человека в портале нет — код invalid_value, details.field называет поле.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/vacancy-summary": {
      "get": {
        "operationId": "appApplicationVacancySummary",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: свод по вакансиям",
        "description": "Вакансии с числами откликов по шагам и их событиями — одна страница на панель вакансий и обзор вакансий «Откликов». В свод входят вакансии обычного сценария, которые вызывающий видит по праву vacancy · view; массовый подбор — свой раздел.\n\nscope выбирает набор. all — вакансии в работе: новые, на подготовке и на отборе; заявки и завершённые не входят. mine — из них те, где вызывающий — рекрутер вакансии или у него есть дела по ней: он ответственный отклика, где его ход, или решающий ждущего решения заказчика. С поиском q (подстрока названия или номер вакансии, как у GET /api/v1/vacancies) в набор входят и завершённые вакансии — с completed = true.\n\nwaiting — «ждут вас»: сколько дел у вызывающего по откликам вакансии. Число считается только у вакансий свода: дело по вакансии, которую вызывающий не видит по vacancy · view, не добавляет в ответ ни вакансию, ни число.\n\nsort задаёт порядок: turn — по waiting по убыванию; review_wait — по самому давнему входу отклика на «Разбор» (reviewSince), давние сверху, вакансии без откликов на «Разборе» — в конце; new — по дате публикации (publishedAt), новые сверху, неопубликованные — в конце. Равные по ключу идут по названию — без учёта регистра, «ё» и «е» равны, — затем по id.\n\nСтраница — до 50 вакансий, next — курсор следующей. Курсор выдан для своих scope и sort и с другими не принимается. Между страницами ключ сортировки может сдвинуться, и вакансия переедет на соседнюю страницу; total — вакансий в своде по всем страницам.\n\nЧисла (steps, verdicts, reviewSince) и события (mainEvent, nearestEvent) считаются по откликам, которые вызывающий видит по уровню application · view: на уровне «только свои» — только отклики, где он ответственный или автор. События читаются только у вакансий страницы.\n\nТребует права application · view.",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "description": "mine — «Мои», all — «Все». Обязателен: набор называется явно.",
            "schema": {
              "$ref": "#/components/schemas/VacancySummaryScope"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Порядок свода; без параметра — turn.",
            "schema": {
              "$ref": "#/components/schemas/VacancySummarySort"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока названия вакансии или её номер («12», «В-12»); с ним в свод входят и завершённые вакансии. Не длиннее 255 символов.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next прошлой страницы с теми же scope и sort; без него — первая страница.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница свода. В примере — «Мои» по turn: у первой вакансии отклики ждут разбора, а ближайшее событие — день выхода; у второй главное событие — идущая встреча, а ближайшее — следующая встреча.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancySummary"
                    }
                  }
                },
                "example": {
                  "data": {
                    "vacancies": [
                      {
                        "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                        "number": 41,
                        "position": "Продавец-консультант",
                        "completed": false,
                        "publishedAt": "2026-10-28T09:00:00Z",
                        "headcount": 3,
                        "hired": 2,
                        "waiting": 7,
                        "steps": {
                          "review": 25,
                          "interview": 4,
                          "decision": 1,
                          "offer": 1,
                          "hired": 2,
                          "rejected": 63
                        },
                        "verdicts": {
                          "fit": 6,
                          "unsure": 7,
                          "unfit": 5,
                          "none": 7
                        },
                        "reviewSince": "2026-11-04T10:15:00Z",
                        "mainEvent": {
                          "kind": "review",
                          "at": "2026-11-04T10:15:00Z",
                          "date": null,
                          "count": 25
                        },
                        "nearestEvent": {
                          "kind": "start",
                          "at": "2026-11-08T21:00:00Z",
                          "date": "2026-11-09",
                          "count": null
                        }
                      },
                      {
                        "id": "a1b7f3c2-6d84-4e09-b5a1-3c9e2f7d4b60",
                        "number": 37,
                        "position": "Кладовщик",
                        "completed": false,
                        "publishedAt": "2026-10-12T08:30:00Z",
                        "headcount": 2,
                        "hired": 1,
                        "waiting": 1,
                        "steps": {
                          "review": 0,
                          "interview": 2,
                          "decision": 0,
                          "offer": 1,
                          "hired": 1,
                          "rejected": 18
                        },
                        "verdicts": {
                          "fit": 0,
                          "unsure": 0,
                          "unfit": 0,
                          "none": 0
                        },
                        "reviewSince": null,
                        "mainEvent": {
                          "kind": "meeting",
                          "at": "2026-11-06T11:30:00Z",
                          "date": null,
                          "count": null
                        },
                        "nearestEvent": {
                          "kind": "meeting",
                          "at": "2026-11-07T08:00:00Z",
                          "date": null,
                          "count": null
                        }
                      }
                    ],
                    "total": 2,
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "scope не прислан или вне словаря; sort вне словаря; q длиннее 255 символов; cursor не разобрался или выдан для других scope и sort — код invalid_value, details.field называет поле.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/review-stages": {
      "get": {
        "operationId": "appApplicationReviewStages",
        "tags": [
          "Отклики"
        ],
        "summary": "Лента стадий разбора вакансии",
        "description": "Стадии разбора вакансии в порядке воронки — new, interview, offer: сколько откликов в каждом статусе, сколько из «Подходит» и «Не подходит» возьмёт фиксация, сколько возьмёт бот и что с запуском ИИ-разбора. Экран опрашивает ручку, пока разбор идёт. Разбирается только new: у закрытой стадии (interview, offer) числа — по прежнему статусу строк, botTargets null, а fixable фиксацией не берётся.\n\ncounts сужает уровень application · view; fixable — ещё и application · edit: это ровно те отклики, которые возьмёт POST /api/v1/applications/review-fix, и ровно те числа, что она ждёт в expected. У открытой стадии — ровно те отклики, которые возьмёт POST …/review-fix. botTargets и числа run уровнем не сужаются — бот идёт по всей стадии, — поэтому приходят только при уровне «все» у application · edit, иначе null; run.state и run.reason видны всем.\n\nТребует права application · view.",
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": true,
            "description": "public_id вакансии. Обязателен: разбор идёт по одной вакансии.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Лента стадий",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationReviewStages"
                    }
                  }
                },
                "example": {
                  "data": {
                    "stages": [
                      {
                        "stage": "new",
                        "closed": false,
                        "counts": {
                          "new": 0,
                          "unreviewed": 12,
                          "fit": 7,
                          "unfit": 4
                        },
                        "fixable": {
                          "fit": 7,
                          "unfit": 4
                        },
                        "botTargets": 12,
                        "run": {
                          "state": "running",
                          "total": 12,
                          "processed": 5,
                          "failed": 0,
                          "reason": null,
                          "finishedAt": null
                        }
                      },
                      {
                        "stage": "interview",
                        "closed": true,
                        "counts": {
                          "new": 3,
                          "unreviewed": 1,
                          "fit": 2,
                          "unfit": 0
                        },
                        "fixable": {
                          "fit": 2,
                          "unfit": 0
                        },
                        "botTargets": null,
                        "run": {
                          "state": "idle",
                          "total": 0,
                          "processed": 0,
                          "failed": 0,
                          "reason": null,
                          "finishedAt": null
                        }
                      },
                      {
                        "stage": "offer",
                        "closed": true,
                        "counts": {
                          "new": 1,
                          "unreviewed": 0,
                          "fit": 1,
                          "unfit": 0
                        },
                        "fixable": {
                          "fit": 1,
                          "unfit": 0
                        },
                        "botTargets": null,
                        "run": {
                          "state": "failed",
                          "total": 1,
                          "processed": 0,
                          "failed": 0,
                          "reason": "ai_quota",
                          "finishedAt": "2026-09-26T10:15:00Z"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Параметр vacancy не прислан, пуст или не идентификатор — код invalid_value, details.field называет vacancy.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/review": {
      "post": {
        "operationId": "appSetApplicationReview",
        "tags": [
          "Отклики"
        ],
        "summary": "Решение по стадии разбора",
        "description": "Решение человека по стадии stage: статус разбора отклика меняется с from на to, и, если переданы note и score, пишутся ручные обоснование и оценка этой стадии. Ответ — отклик в форме with=review: с разбором (вывод, пункты, обоснование, оценка бота) и историей прошлых стадий.\n\nstage и from обязательны — это стадия и статус, которые вызывающий видел. Расходятся с настоящими — решения нет, ответ review_forbidden: иначе решение по устаревшей странице молча отменило бы чужое или разложило бы отклик, который уже ушёл на другую стадию. Разбирается только «Новый» (new): interview и offer — 409 review_stage_closed, hired и rejected — invalid_value, как неизвестный этап.\n\nПоложить можно в unreviewed, fit или unfit. to = from разрешено, только если передан note или score: пишутся они, статус не меняется. Ручная оценка становится действующей (score отклика), оценка бота остаётся в review.scoreBot; null стирает ручную. Текст обоснования в журнал не пишется — только признак, что он менялся. Запись идёт только в решение человека и только когда он не согласен с ботом этой стадии, как у устаревшей POST /api/v1/applications/{id}/fit; исключение — unreviewed у отклика, у которого после записи есть ручные оценка или обоснование этой стадии: решение человека пишется явно, и бот, разобрав отклик позже, статус не меняет. Этап воронки ручка не трогает — это делает фиксация стадии.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после решения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Ерохина Алиса Дмитриевна",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Продакт-менеджер"
                    },
                    "stage": "new",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 85,
                    "scoreSource": "human",
                    "review": {
                      "summary": "Пять лет в продуктовой роли, два запуска с выручкой в цифрах.",
                      "matches": [
                        {
                          "kind": "match",
                          "source": "resume",
                          "text": "Опыт 5 лет: Ozon, Авито"
                        },
                        {
                          "kind": "gap",
                          "source": "resume",
                          "text": "В резюме только удалённый формат"
                        }
                      ],
                      "note": {
                        "text": "Запуски с выручкой в цифрах важнее формата работы.",
                        "author": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "at": "2026-09-15T10:12:00Z"
                      },
                      "scoreBot": 92,
                      "questions": []
                    },
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "7c1d9e40-2b85-4a13-9f6c-0d5e8a2b1349",
                      "name": "Смирнова Ольга Петровна"
                    },
                    "resumeUrl": "https://hh.ru/resume/abc",
                    "note": null,
                    "createdAt": "2026-09-20T09:15:00Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": null,
                    "nextInterviewAt": null,
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "review",
                    "state": {
                      "code": "review",
                      "kind": "turn",
                      "since": "2026-09-20T09:15:00Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-20T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Стадия финальная, пуста или неизвестна, статус пуст или неизвестен, to — new или совпадает с from без note и score, score не целое или вне 0–100, note длиннее 2000 символов — код invalid_value, details.field называет stage, from, to, score или note.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код review_forbidden: стадия или исходный статус не совпали с настоящими. 409, а не 400: тело законно, а состояние отклика не позволяет. Код portrait_changed: портрет вакансии сменился с той версии, что видел человек (portraitVersion), — ничего не записано. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения. Код review_stage_closed: разбор этой стадии закрыт — разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.5); ничего не записано.",
            "x-error-codes": [
              "review_forbidden",
              "candidate_purged",
              "portrait_changed",
              "review_stage_closed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "candidate_purged": {
                    "value": {
                      "error": {
                        "code": "candidate_purged",
                        "message": "данные кандидата удалены",
                        "retryable": false
                      }
                    }
                  },
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/review-score": {
      "post": {
        "operationId": "appSetApplicationReviewScore",
        "tags": [
          "Отклики"
        ],
        "summary": "Ручная оценка «Разбора»",
        "description": "Ручные оценка и обоснование «Разбора» без ручной отметки: пишутся score и note; статус разбора (reviewStatus), решение человека (fitHuman) и отметка «совпало с ИИ» не меняются. Нужно передать хотя бы одно из полей score и note; пустое тело — invalid_value. Оценка 0–100 становится действующей (score отклика), оценка бота остаётся в review.scoreBot; score = null стирает ручную, пустой note стирает обоснование. Текст обоснования в журнал не пишется — только признак, что он менялся.\n\nportraitVersion — версия портрета, которую видел человек (mainVersionId портрета вакансии): разошлась с основной — ничего не записано, ответ portrait_changed; поля нет — версия не сверяется. Оценка помнит версию портрета, по которой поставлена. Разбор «Разбора» пишется только пока отклик на этапе «Новый»: на любом другом — 409 review_stage_closed. Ответ — отклик в форме with=review.\n\nТребует прав application · view и application · edit; отклик вне любого из этих уровней отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationReviewScoreRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после записи оценки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Ерохина Алиса Дмитриевна",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "number": 112,
                      "position": "Продакт-менеджер",
                      "scenario": "regular"
                    },
                    "stage": "new",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 85,
                    "scoreSource": "human",
                    "review": {
                      "summary": "Пять лет в продуктовой роли, два запуска с выручкой в цифрах.",
                      "matches": [
                        {
                          "kind": "match",
                          "source": "resume",
                          "text": "Опыт 5 лет: Ozon, Авито"
                        },
                        {
                          "kind": "gap",
                          "source": "resume",
                          "text": "В резюме только удалённый формат"
                        }
                      ],
                      "note": {
                        "text": "Запуски с выручкой в цифрах важнее формата работы.",
                        "author": {
                          "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                          "name": "Одинцова Мария Павловна"
                        },
                        "at": "2026-09-20T10:12:00Z"
                      },
                      "scoreBot": 92,
                      "provenance": {
                        "portrait": null,
                        "sources": [],
                        "capturedAt": "2026-09-20T10:12:00Z",
                        "stale": false
                      },
                      "questions": []
                    },
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "7c1d9e40-2b85-4a13-9f6c-0d5e8a2b1349",
                      "name": "Смирнова Ольга Петровна"
                    },
                    "resumeUrl": "https://hh.ru/resume/abc",
                    "note": null,
                    "createdAt": "2026-09-20T09:15:00Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": null,
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "review",
                      "step": "application",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "review",
                    "state": {
                      "code": "review",
                      "kind": "turn",
                      "since": "2026-09-20T09:15:00Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-20T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Нет ни score, ни note, score не целое или вне 0–100, note длиннее 2000 символов, portraitVersion не идентификатор — код invalid_value, details.field называет score, note или portraitVersion.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код review_stage_closed: отклик не на этапе «Новый», разбор этой стадии закрыт — разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.15); ничего не записано. Код portrait_changed: портрет вакансии сменился с той версии, что видел человек (portraitVersion), — ничего не записано. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения.",
            "x-error-codes": [
              "review_stage_closed",
              "portrait_changed",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  },
                  "portrait_changed": {
                    "value": {
                      "error": {
                        "code": "portrait_changed",
                        "message": "портрет вакансии изменился — перечитайте его и оцените заново",
                        "retryable": false
                      }
                    }
                  },
                  "candidate_purged": {
                    "value": {
                      "error": {
                        "code": "candidate_purged",
                        "message": "данные кандидата удалены",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/review-fix": {
      "post": {
        "operationId": "appFixReviewStage",
        "tags": [
          "Отклики"
        ],
        "summary": "Зафиксировать разбор стадии",
        "description": "Одной транзакцией: «Не подходит» уходят в Отказ, «Подходит» — на Собеседование (смена этапа new → interview). new и unreviewed не трогаются. Разбирается только «Новый» (new): interview и offer — 409 review_stage_closed, hired и rejected — invalid_value, как неизвестный этап.\n\nБерутся отклики под уровнями application · view и application · edit сразу — те, что GET /api/v1/applications/review-stages отдаёт как fixable. expected — эти числа, какими их видел экран: разошлись с настоящими — фиксации нет, ответ review_changed. Идёт ИИ-разбор стадии — review_running. Больше 1000 откликов одна фиксация не проводит — review_fix_too_large.\n\nТребует права application · edit. При unfit строках требуется явный rejection {category, comment?}. Без дескриптора — 409 stage_requires_form до любого перехода; fit-only запросы совместимы.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewFixRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Итог фиксации",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewFixResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "advanced": 7,
                    "rejected": 4,
                    "awaitingForm": 0,
                    "to": "interview"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. vacancy не идентификатор, стадия финальная или неизвестна, expected не прислан или отрицателен — код invalid_value, details.field называет поле.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код review_changed: отклики стадии разошлись с expected — их переразобрали, увели или передали, пока экран был открыт. Код review_running: по стадии идёт ИИ-разбор. Код review_fix_too_large: фиксация задевает больше откликов, чем проводит одна транзакция. 409, а не 400: тело законно, а состояние стадии не позволяет. Код stage_requires_form: unfit строки требуют явного rejection. Код review_stage_closed: разбор этой стадии закрыт — разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.5); ничего не записано.",
            "x-error-codes": [
              "review_changed",
              "review_running",
              "review_fix_too_large",
              "stage_requires_form",
              "review_stage_closed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/review-runs": {
      "post": {
        "operationId": "appStartReviewRun",
        "tags": [
          "Отклики"
        ],
        "summary": "Запустить ИИ-разбор стадии",
        "description": "Ставит ИИ-разбор «Разбора» вакансии. 202 без тела: разбор идёт фоном, ход виден в run ленты GET /api/v1/applications/review-stages и в GET /api/v1/applications/review-run-status — там, если вакансия видна вызывающему по vacancy · view.\n\nБез applications разбираются отклики «Разбора» вакансии: у вакансии сценария regular — те же, что отдаёт список откликов с step=review; у вакансии сценария mass шагов нет, и это её отклики на этапе new без живого приглашения (liveInvite). Сначала — без анализа (verdict=none), затем — с устаревшим анализом (verdict=stale), не больше 200 за запуск. Отклики с ручной отметкой «Подходит» или «Не подходит» прежней доски (verdictSource = human) прогон вакансии не берёт ни без анализа, ни с устаревшим. С applications разбираются ровно названные отклики «Разбора» этой вакансии в том же смысле, до 200, — в том числе с анализом и с ручной отметкой. Новый анализ гасит ручную отметку отклика (fitHuman): вердикт после него даёт ИИ.\n\nПовтор, пока разбор этой вакансии идёт, второго запуска не создаёт, ничего не меняет — ни цели, ни выбора — и тоже отвечает 202, даже когда сервис занят; applications повтора с «Разбором» не сверяются — отклик, ушедший с него после постановки, повтор не отвергает. Пока у портала идёт разбор другой вакансии или стадии — review_run_busy с details.cause = portal; сервис занят пределом одновременных разборов — review_run_busy с details.cause = service. Портал не подключён к ИИ — 409 not_connected сразу, разбор в очередь не ставится. Разбирается только «Новый» (new): interview и offer — 409 review_stage_closed, hired и rejected — invalid_value, как неизвестный этап. Прогон закрытой стадии, поставленный до выката, завершается done без причины и ничего не пишет. Запуск в журнал не пишется.\n\nТребует права application · edit на уровне «все» — и прогон вакансии, и прогон по выбранным: прогон идёт по вакансии, а не по уровню, тратит квоту ИИ портала и занимает его один, поэтому уровню ниже ответ 403 с кодом forbidden.\n\nПеред постановкой и HTTP, и команда запуска читают сохранённый живой факт подключения без секрета и без обращения к провайдеру; отсутствие даёт 409 not_connected. Сохранённый факт не предсказывает живые ошибки ключа, квоты или провайдера.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRunRequest"
              },
              "example": {
                "vacancy": "0193f1c2-7a4e-7b10-9c2d-3e4f5a6b7c8d",
                "stage": "new",
                "applications": [
                  "0193f1c2-8b5f-7c21-8d3e-4f5a6b7c8d9e",
                  "0193f1c2-9c60-7d32-9e4f-5a6b7c8d9eaf"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Разбор поставлен"
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. vacancy не идентификатор, стадия финальная или неизвестна — код invalid_value, details.field называет поле. applications пуст, длиннее 200 или с адресом не той формы — тот же invalid_value с details.field = applications. Отклик в applications не из «Разбора» этой вакансии — другой вакансии, неизвестный, не на шаге «Разбор» (у вакансии сценария mass — не на этапе new или с живым приглашением) — тоже invalid_value с details.field = applications, пока разбор этой вакансии не идёт: при идущем повтор отвечает 202 без сверки. Разбор не поставлен.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код review_run_busy: разбор не поставлен, details.cause говорит, чей предел, — portal: у портала уже идёт ИИ-разбор другой вакансии или стадии (ход — в GET /api/v1/applications/review-run-status; вакансию вне vacancy · view он не называет), service: сервис занят пределом одновременных разборов; повторите позже. Код not_connected: портал не подключён к ИИ — разбор не поставлен, подключите ИИ и повторите. Код review_stage_closed: разбор этой стадии закрыт — разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.5); ничего не записано.",
            "x-error-codes": [
              "review_run_busy",
              "not_connected",
              "review_stage_closed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "review_run_busy": {
                    "value": {
                      "error": {
                        "code": "review_run_busy",
                        "message": "в портале уже идёт ИИ-разбор или сервис занят — повторите позже",
                        "retryable": false,
                        "details": {
                          "cause": "portal"
                        }
                      }
                    }
                  },
                  "not_connected": {
                    "value": {
                      "error": {
                        "code": "not_connected",
                        "message": "портал не подключён к вайбкоду",
                        "retryable": false
                      }
                    }
                  },
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/review-run-status": {
      "get": {
        "operationId": "appApplicationReviewRunStatus",
        "tags": [
          "Отклики"
        ],
        "summary": "Ход ИИ-разбора портала",
        "description": "Идёт ли у портала ИИ-разбор вакансии (POST /api/v1/applications/review-runs), по какой вакансии и насколько он продвинулся. Разбор на портале один на все вакансии: пока он идёт, запуск по другой вакансии отвечает 409 review_run_busy с details.cause = portal, а повтор запуска по этой же — 202 без второго разбора. Ответ один на портал, параметров нет; опрашивайте его, пока state = running.\n\nВакансию разбора ответ называет, только если вызывающему она видна по праву vacancy · view — тому же, что у чтения вакансии. Иначе state = running, а vacancy, total, processed и failed — null: идёт разбор вакансии, которой вызывающий не видит («идёт другой разбор»), и ни её названия, ни id ответ не раскрывает.\n\ntotal, processed и failed — ход разбора названной вакансии: сколько откликов возьмёт разбор, сколько уже пройдено и сколько шагов закончилось отказом. Уровнем application · view они не сужаются — разбор идёт по всей вакансии, — поэтому приходят только при уровне «все» у application · edit, иначе null. При state = idle все поля, кроме state, — null. Чем разбор закончился (done или failed и причина), показывает run в GET /api/v1/applications/review-stages.\n\nТребует права application · view.",
        "responses": {
          "200": {
            "description": "Ход разбора. В примере — разбор вакансии, видимой вызывающему, при уровне «все» у application · edit.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReviewRunStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "running",
                    "vacancy": {
                      "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                      "position": "Продавец-консультант"
                    },
                    "total": 12,
                    "processed": 5,
                    "failed": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/fit": {
      "post": {
        "operationId": "appSetApplicationFit",
        "tags": [
          "Отклики"
        ],
        "summary": "Сменить соответствие отклика",
        "description": "Устарела: решение по стадии пишет POST /api/v1/applications/{id}/review. Ручка живёт до contract-релиза; решение она пишет в разбор «Разбора» и только отклику на «Новом». Разбирается только «Новый» (new): отклик на любом другом этапе — 409 review_stage_closed.\n\nОтвет — отклик целиком: вместе с соответствием меняется и то, что о нём известно.\n\nfromFit обязателен — это соответствие, которое вызывающий видел. Расходится с настоящим — смены нет, ответ fit_forbidden: иначе запись по устаревшему состоянию молча отменила бы чужое решение.\n\nЗапись идёт ТОЛЬКО в решение человека и ТОЛЬКО когда он не согласен с ботом: значение, совпавшее с предложением бота, стирает решение, а не повторяет его. Поэтому fitHuman в ответе бывает null сразу после успешной смены — это не ошибка, а отсутствие спора.\n\nЭтап воронки эта ручка не трогает никогда.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationFitRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после смены соответствия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Ерохина Алиса Дмитриевна",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Продакт-менеджер"
                    },
                    "stage": "new",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "7c1d9e40-2b85-4a13-9f6c-0d5e8a2b1349",
                      "name": "Смирнова Ольга Петровна"
                    },
                    "resumeUrl": "https://hh.ru/resume/abc",
                    "note": null,
                    "createdAt": "2026-09-20T09:15:00Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": null,
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "review",
                      "step": "application",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "review",
                    "state": {
                      "code": "review",
                      "kind": "turn",
                      "since": "2026-09-20T09:15:00Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-20T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Соответствие пусто или неизвестно — код invalid_value, details.field называет fromFit или fit.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код fit_forbidden: исходное соответствие не совпало с настоящим или отклик переводят в то же значение, которое у него уже стоит. 409, а не 400: тело законно, а состояние отклика не позволяет. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения. Код review_stage_closed: разбор этой стадии закрыт — разбирают только «Новый» (спека «Отклики — путь рекрутера» § 15.5); ничего не записано.",
            "x-error-codes": [
              "fit_forbidden",
              "candidate_purged",
              "review_stage_closed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "review_stage_closed": {
                    "value": {
                      "error": {
                        "code": "review_stage_closed",
                        "message": "разбор этой стадии закрыт — разбирают только «Новый»",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "deprecated": true,
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/interviews": {
      "get": {
        "operationId": "appApplicationInterviews",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: собеседования",
        "description": "Приглашения на собеседование, заведённые из этого отклика (POST /api/v1/interviews с полем applicationId), свежие сверху, до 200 строк — экран читается целиком, без постраничной навигации. По каждому — статус, время брони и собеседующие с именами.\n\nВремя брони — начало и конец встречи в UTC и зона приглашения, в которой рекрутер задавал окно; у приглашения без брони все три поля null. Статус expired вычисляется при чтении: это ожидающее приглашение с истёкшим сроком ссылки. Имя собеседующего берётся у пользователя сервиса с тем же b24UserId; у сотрудника Битрикс24, который в сервис не входил, name — null.\n\nТребует права application · view и сужается его уровнем: отклик вне уровня отвечает 404, а не 403 — отказ подтверждал бы, что такой отклик есть. Права interview здесь не нужно: собеседование отклика показывается как часть отклика.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Собеседования отклика",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationInterviewsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "interviews": [
                      {
                        "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                        "status": "booked",
                        "startsAt": "2026-09-21T07:00:00Z",
                        "endsAt": "2026-09-21T08:00:00Z",
                        "tz": "Europe/Kaliningrad",
                        "attendees": [
                          {
                            "b24UserId": 15,
                            "name": "Одинцова Мария Павловна"
                          },
                          {
                            "b24UserId": 17,
                            "name": null
                          }
                        ],
                        "createdAt": "2026-09-17T09:00:00Z",
                        "link": "https://hrm.example.com/join/vacancies/0f3b6a1e-2c4d-4e8f-9a1b-7c5d3e2f1a09",
                        "durationMin": 60,
                        "b24EventId": null,
                        "calendarOperation": null
                      },
                      {
                        "id": "1c7e5a38-94d2-4b0f-8a61-3e2d9f07b5c4",
                        "status": "cancelled",
                        "startsAt": null,
                        "endsAt": null,
                        "tz": null,
                        "attendees": [
                          {
                            "b24UserId": 15,
                            "name": "Одинцова Мария Павловна"
                          }
                        ],
                        "createdAt": "2026-09-16T12:30:00Z",
                        "link": "",
                        "durationMin": 60,
                        "b24EventId": null,
                        "calendarOperation": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/decisions": {
      "get": {
        "operationId": "appApplicationDecisions",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: решения заказчика",
        "description": "Решения заказчика вакансии по собеседованиям этого отклика, новые сверху, до 200 строк — экран читается целиком, без постраничной навигации. По каждому — чьё собеседование, кто решает (заказчик вакансии на момент брони), момент, с которого решение ждёт (конец слота), состояние, вердикт, комментарий и момент решения. Время ожидания — decidedAt − availableAt — клиент считает сам.\n\nСтрока появляется при брони собеседования активного отклика и исчезает, если собеседование отменили до решения или отклику отказали (в том числе пачкой): возврат отклика в работу старый запрос не воскрешает. Принятое решение ни отмена, ни отказ не трогают.\n\nТребует права application · view и сужается его уровнем: отклик вне уровня отвечает 404, а не 403 — отказ подтверждал бы, что такой отклик есть.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Решения отклика",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationDecisionsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "decisions": [
                      {
                        "interviewId": "1c7e5a38-94d2-4b0f-8a61-3e2d9f07b5c4",
                        "decider": {
                          "id": "0199d4c1-aa10-7b2c-9d3e-4f5a6b7c8d9e",
                          "name": "Петров Пётр Сергеевич"
                        },
                        "availableAt": "2026-09-24T08:00:00Z",
                        "state": "pending",
                        "verdict": null,
                        "comment": null,
                        "decidedAt": null,
                        "awaiting": true
                      },
                      {
                        "interviewId": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                        "decider": {
                          "id": "0199d4c1-aa10-7b2c-9d3e-4f5a6b7c8d9e",
                          "name": "Петров Пётр Сергеевич"
                        },
                        "availableAt": "2026-09-21T08:00:00Z",
                        "state": "decided",
                        "verdict": "another_meeting",
                        "comment": "Нужен разговор с технологом",
                        "decidedAt": "2026-09-22T09:30:00Z",
                        "awaiting": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/offers": {
      "get": {
        "operationId": "appApplicationOffers",
        "tags": [
          "Отклики"
        ],
        "summary": "Отклики: офферы",
        "description": "Офферы отклика, новые сверху, до 200 строк — экран читается целиком, без постраничной навигации. У отклика действующий оффер — принятый либо отправленный с неистёкшим сроком — бывает один; остальные строки — история: отклонённые, отозванные, истёкшие. Отправленный с вышедшим сроком приходит истёкшим сразу.\n\nТребует права application · view и сужается его уровнем: отклик вне уровня отвечает 404, а не 403 — отказ подтверждал бы, что такой отклик есть.\n\nУ вакансии с согласованием оффера (approvalRequired) ответ несёт подготовленный оффер (prepared), а у офферов, отправленных из подготовленного, — исход согласования (approval).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Офферы отклика",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationOffersResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "offers": [
                      {
                        "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "amount": "180000.00",
                        "currency": "RUB",
                        "forkMin": "100000.00",
                        "forkMax": "150000.00",
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "outOfFork": true,
                        "overForkReason": "Редкий специалист, встречное предложение",
                        "startDate": "2026-10-12",
                        "conditions": "Испытательный срок три месяца",
                        "state": "sent",
                        "respondBy": "2026-10-01",
                        "expiresAt": "2026-10-01T21:00:00Z",
                        "tz": "Europe/Moscow",
                        "sentAt": "2026-09-24T09:00:00Z",
                        "respondedAt": null,
                        "declineReason": null,
                        "approval": {
                          "kind": "approved",
                          "at": "2026-09-23T15:20:00Z",
                          "by": {
                            "id": "3f6b2a90-1c4e-4d7a-9b58-6e2d0c8f1a73",
                            "name": "Заказчикова Анна Сергеевна"
                          },
                          "reason": null,
                          "selfApproved": false
                        }
                      },
                      {
                        "id": "c41d2e8f-0a6b-4c93-8d17-5e2f9b3a6c08",
                        "link": "https://hrm.example.ru/join/offer/c41d2e8f-0a6b-4c93-8d17-5e2f9b3a6c08",
                        "amount": "140000.00",
                        "currency": "RUB",
                        "forkMin": "100000.00",
                        "forkMax": "150000.00",
                        "salaryHidden": false,
                        "salaryMasked": false,
                        "outOfFork": false,
                        "overForkReason": null,
                        "startDate": "2026-10-12",
                        "conditions": "Испытательный срок три месяца",
                        "state": "declined",
                        "respondBy": "2026-09-20",
                        "expiresAt": "2026-09-20T21:00:00Z",
                        "tz": "Europe/Moscow",
                        "sentAt": "2026-09-15T08:00:00Z",
                        "respondedAt": "2026-09-16T10:12:00Z",
                        "declineReason": "Выбрал другое предложение",
                        "approval": null
                      }
                    ],
                    "approvalRequired": true,
                    "prepared": null,
                    "defaultApprover": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSendOffer",
        "tags": [
          "Отклики"
        ],
        "summary": "Отправить оффер кандидату",
        "description": "Заводит оффер отклику и отдаёт ссылку кандидату — адрес страницы оффера в кабинете кандидата. Ссылку рекрутер отправляет кандидату сам; кандидат открывает её, входит в кабинет тем контактом, что в отклике, и принимает или отклоняет оффер там. Секрета в ссылке нет: тот же адрес приходит полем link у каждого оффера в истории отклика.\n\nВилка и валюта берутся снимком из вакансии. Сумма вне вилки требует причины overForkReason — согласования нет, причина видна в карточке отклика. Срок ответа — от завтра до тридцати дней от сегодня в зоне tz; истекает оффер в первый момент следующего дня в этой зоне.\n\nОффер отправляют только активному отклику (new, interview, offer), и действующий оффер у отклика один: второй — offer_active_exists, пока первый не отозван, не отклонён или не истёк. Отклик из new или interview в той же записи уходит в offer — это единственный путь в этот этап: смена этапа туда отвечает stage_requires_form.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Оффер отправлен; ссылка ведёт в кабинет кандидата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationOfferSent"
                    }
                  }
                },
                "example": {
                  "data": {
                    "offer": {
                      "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "amount": "180000.00",
                      "currency": "RUB",
                      "forkMin": "100000.00",
                      "forkMax": "150000.00",
                      "salaryHidden": false,
                      "salaryMasked": false,
                      "outOfFork": true,
                      "overForkReason": "Редкий специалист, встречное предложение",
                      "startDate": "2026-10-12",
                      "conditions": "Испытательный срок три месяца",
                      "state": "sent",
                      "respondBy": "2026-10-01",
                      "expiresAt": "2026-10-01T21:00:00Z",
                      "tz": "Europe/Moscow",
                      "sentAt": "2026-09-24T09:00:00Z",
                      "respondedAt": null,
                      "declineReason": null
                    },
                    "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — поле не годится, details.field называет его: amount — не число больше нуля в разрядности; startDate или respondBy — не дата 2006-01-02, а respondBy ещё и вне окна от завтра до тридцати дней в зоне tz; tz — пустая строка, Local или неизвестная зона; overForkReason — сумма вне вилки без причины либо причина длиннее 4000 знаков; conditions — длиннее 4000 знаков.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код application_inactive: отклик в hired или rejected — оффер отправляют только активному. Код offer_active_exists: у отклика уже есть действующий оффер — принятый или отправленный с неистёкшим сроком; сначала его отзывают. 409, а не 400: тело законно, а состояние отклика не позволяет. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения. Код offer_approval_required: у вакансии отклика согласование оффера — оффер готовится (POST /api/v1/applications/{id}/offer-drafts) и уходит кандидату после решения согласующего оффера: выбранного у оффера, иначе заказчика вакансии, иначе её автора.",
            "x-error-codes": [
              "application_inactive",
              "offer_active_exists",
              "candidate_purged",
              "offer_approval_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/offer-drafts": {
      "post": {
        "operationId": "appPrepareOfferDraft",
        "tags": [
          "Отклики"
        ],
        "summary": "Подготовить оффер",
        "description": "Готовит оффер отклику у вакансии, где нужно согласование оффера (offerApprovalRequired). Кандидат подготовленный оффер не видит, этап отклика не меняется: в offer его переведёт отправка кандидату. Дальше — запрос согласующему оффера согласовать условия и отправка кандидату.\n\nФорма и проверки — те же, что у отправки оффера: вилка и валюта берутся снимком из вакансии, сумма вне вилки требует причины overForkReason, срок ответа — от завтра до тридцати дней в зоне tz. Подготовленный оффер у отклика один; при действующем оффере новый не готовится. Согласующий оффера — выбранный у оффера, иначе заказчик вакансии, иначе её автор: выбрать можно сразу (approverB24UserId) — человека портала из GET /api/v1/applications/directory/people; без выбора запрос уйдёт заказчику вакансии, иначе её автору.\n\nКод forbidden также у запроса ключом API с полем approverB24UserId (число или null): согласующего выбирают только из кабинета; без поля ключ готовит оффер с согласующим по умолчанию.\n\nУ вакансии без признака оффер отправляют сразу — POST /api/v1/applications/{id}/offers.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferDraftCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Оффер подготовлен",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferDraft"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1d7e42-8a90-4b3f-a6d1-0e9f2b7c4a18",
                    "amount": "140000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": false,
                    "overForkReason": null,
                    "startDate": "2026-11-23",
                    "conditions": "Испытательный срок три месяца",
                    "respondBy": "2026-11-16",
                    "tz": "Europe/Moscow",
                    "version": 1,
                    "revision": 1,
                    "approval": null,
                    "bypassClosed": false,
                    "bypass": null,
                    "can": {
                      "request": true,
                      "remind": false,
                      "resend": false,
                      "sendApproved": false,
                      "bypass": true
                    },
                    "approver": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — поле не годится, details.field называет его: amount — не число больше нуля в разрядности; startDate или respondBy — не дата 2006-01-02, а respondBy ещё и вне окна от завтра до тридцати дней в зоне tz; tz — пустая строка, Local или неизвестная зона; overForkReason — сумма вне вилки без причины либо причина длиннее 4000 знаков; conditions — длиннее 4000 знаков; approverB24UserId — не целое больше нуля либо не человек этого портала: чужой, уволен, пропал.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_approval_not_required: у вакансии отклика нет согласования оффера — оффер отправляют сразу. Код offer_draft_exists: у отклика уже есть подготовленный оффер. Код offer_active_exists: у отклика есть действующий оффер. Код application_inactive: отклик в hired или rejected. Код candidate_purged — данные кандидата отклика удалены: отклик только для чтения.",
            "x-error-codes": [
              "offer_approval_not_required",
              "offer_draft_exists",
              "offer_active_exists",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/hire": {
      "post": {
        "operationId": "appHireApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Отметить выход на работу",
        "description": "Переводит отклик в hired с днём выхода — единственный вход в этот этап: смена этапа POST /api/v1/applications/{id}/stage туда отвечает stage_requires_form. Выход закрывает единицу вакансии: вышедших не бывает больше headcount, и лишний выход отвечает units_filled. Отметить выход можно у активного отклика на вакансии в любом этапе; принятый оффер не обязателен — кандидат мог согласиться устно.\n\nhiredOn — календарный день, не позже сегодняшнего в зоне tz. Зоны у портала нет, поэтому «сегодня» считается в зоне вызывающего — IANA, как у формы оффера. Прошедший день законен: выход отмечают и задним числом.\n\nВыход, закрывший последнюю единицу вакансии, которую можно завершить, отвечает vacancyFilled = true и причиной closeReason на базовом языке установки: вакансию предлагают завершить — POST /api/v1/vacancies/{id}/stage, — а не завершают молча.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationHireRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после выхода и предложение завершить вакансию",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationHired"
                    }
                  }
                },
                "example": {
                  "data": {
                    "application": {
                      "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                      "candidate": {
                        "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                        "name": "Кузнецов Алексей Игоревич",
                        "contacts": [
                          {
                            "kind": "phone",
                            "value": "+7 916 555-12-34"
                          },
                          {
                            "kind": "telegram",
                            "value": "@kuznetsov_cnc"
                          }
                        ]
                      },
                      "vacancy": {
                        "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                        "position": "Оператор станка ЧПУ"
                      },
                      "stage": "hired",
                      "hiredOn": "2026-10-12",
                      "historicalOn": null,
                      "fit": "high",
                      "fitBot": "high",
                      "fitHuman": null,
                      "score": 92,
                      "scoreSource": "ai",
                      "reviewStatus": null,
                      "allowedStages": [
                        "new",
                        "interview"
                      ],
                      "formStages": [],
                      "responsible": {
                        "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "name": "Одинцова Мария Павловна"
                      },
                      "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                      "note": "Работал на стойке Heidenhain, готов к сменному графику.",
                      "createdAt": "2026-09-14T08:05:41Z",
                      "source": "hh",
                      "channels": [
                        "hh"
                      ],
                      "decision": {
                        "verdict": "fit",
                        "pending": false
                      },
                      "nextInterviewAt": null,
                      "journey": {
                        "phase": "hired",
                        "step": "hired",
                        "steps": [
                          "application",
                          "interview",
                          "decision",
                          "offer",
                          "hired"
                        ]
                      },
                      "type": "unspecified",
                      "submittedBy": null,
                      "submittedSnapshot": null,
                      "rejection": null,
                      "step": "hired",
                      "state": {
                        "code": "hired",
                        "kind": "none",
                        "since": "2026-10-12T09:00:00Z",
                        "marks": []
                      },
                      "decider": null,
                      "decisionState": null,
                      "liveInvite": null,
                      "verdict": "fit",
                      "verdictSource": "ai",
                      "rejectedFrom": null,
                      "stageEnteredAt": "2026-10-12T09:00:00Z"
                    },
                    "vacancyFilled": true,
                    "closeReason": "наняли"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — hiredOn не календарный день 2006-01-02 или позже сегодняшнего дня в зоне tz (поле hiredOn); tz пуста, Local или неизвестная зона (поле tz).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код application_inactive: отклик уже не в работе — в отказе или кандидат уже вышел на работу. Код units_filled: все единицы вакансии закрыты вышедшими — увеличьте headcount вакансии. 409, а не 400: тело законно, а состояние не позволяет. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения.",
            "x-error-codes": [
              "application_inactive",
              "units_filled",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/no-show": {
      "post": {
        "operationId": "appNoShowApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Отметить, что кандидат не вышел",
        "description": "Кандидат принял оффер, но на работу не вышел: принятый оффер становится no_show, отклик — отказом (rejected), одной транзакцией. Единица вакансии освобождается сама — сетка единиц вычисляется, а не хранится. Невыход остаётся на оффере.\n\nДоступно у отклика на этапе offer с принятым оффером. Тела у запроса нет.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Отклик после отказа и оффер после невыхода",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationNoShow"
                    }
                  }
                },
                "example": {
                  "data": {
                    "application": {
                      "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                      "candidate": {
                        "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                        "name": "Кузнецов Алексей Игоревич",
                        "contacts": [
                          {
                            "kind": "phone",
                            "value": "+7 916 555-12-34"
                          },
                          {
                            "kind": "telegram",
                            "value": "@kuznetsov_cnc"
                          }
                        ]
                      },
                      "vacancy": {
                        "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                        "position": "Оператор станка ЧПУ"
                      },
                      "stage": "rejected",
                      "hiredOn": null,
                      "historicalOn": null,
                      "fit": "high",
                      "fitBot": "high",
                      "fitHuman": null,
                      "score": 92,
                      "scoreSource": "ai",
                      "reviewStatus": null,
                      "allowedStages": [
                        "new",
                        "interview"
                      ],
                      "formStages": [],
                      "responsible": {
                        "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "name": "Одинцова Мария Павловна"
                      },
                      "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                      "note": "Работал на стойке Heidenhain, готов к сменному графику.",
                      "createdAt": "2026-09-14T08:05:41Z",
                      "source": "hh",
                      "channels": [
                        "hh"
                      ],
                      "decision": {
                        "verdict": "fit",
                        "pending": false
                      },
                      "nextInterviewAt": null,
                      "journey": {
                        "phase": "rejected",
                        "step": null,
                        "steps": [
                          "application",
                          "interview",
                          "decision",
                          "offer",
                          "hired"
                        ]
                      },
                      "type": "unspecified",
                      "submittedBy": null,
                      "submittedSnapshot": null,
                      "rejection": null,
                      "step": "rejected",
                      "state": {
                        "code": "rejected",
                        "kind": "none",
                        "since": "2026-10-02T09:00:00Z",
                        "marks": []
                      },
                      "decider": null,
                      "decisionState": null,
                      "liveInvite": null,
                      "verdict": "fit",
                      "verdictSource": "ai",
                      "rejectedFrom": "offer",
                      "stageEnteredAt": "2026-10-02T09:00:00Z"
                    },
                    "offer": {
                      "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "amount": "180000.00",
                      "currency": "RUB",
                      "forkMin": "100000.00",
                      "forkMax": "150000.00",
                      "salaryHidden": false,
                      "salaryMasked": false,
                      "outOfFork": true,
                      "overForkReason": "Редкий специалист, встречное предложение",
                      "startDate": "2026-10-12",
                      "conditions": "Испытательный срок три месяца",
                      "state": "no_show",
                      "respondBy": "2026-10-01",
                      "expiresAt": "2026-10-01T21:00:00Z",
                      "tz": "Europe/Moscow",
                      "sentAt": "2026-09-24T09:00:00Z",
                      "respondedAt": "2026-09-25T10:12:00Z",
                      "declineReason": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не идентификатор — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_not_accepted: у отклика нет принятого оффера. Код application_not_in_offer: отклик уведён с этапа offer. Код application_inactive: отклик уже в отказе или кандидат вышел на работу. 409, а не 400: запрос законен, а состояние отклика не позволяет. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения.",
            "x-error-codes": [
              "application_inactive",
              "application_not_in_offer",
              "offer_not_accepted",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/withdraw": {
      "post": {
        "operationId": "appWithdrawOffer",
        "tags": [
          "Отклики"
        ],
        "summary": "Отозвать оффер",
        "description": "Отзывает отправленный или принятый оффер — после принятия бывают переговоры, и отзыв не требует выдумывать «не вышел». fromState обязателен — это состояние, которое вызывающий видел: расходится с настоящим — отзыва нет, ответ offer_state_changed. Так гонка «кандидат принял» против «рекрутер отозвал» закрывается один раз, а принятый оффер по устаревшей странице молча не снимается. Отправленный с вышедшим сроком уже истёк и отзывом не снимается.\n\nЭтап отклика отзыв не меняет. После отзыва можно отправить новый оффер.\n\nТребует права application · edit на отклик оффера; оффер отклика вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferWithdrawRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Оффер после отзыва",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationOffer"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "amount": "180000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": true,
                    "overForkReason": "Редкий специалист, встречное предложение",
                    "startDate": "2026-10-12",
                    "conditions": "Испытательный срок три месяца",
                    "state": "withdrawn",
                    "respondBy": "2026-10-01",
                    "expiresAt": "2026-10-01T21:00:00Z",
                    "tz": "Europe/Moscow",
                    "sentAt": "2026-09-24T09:00:00Z",
                    "respondedAt": null,
                    "declineReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — fromState не sent и не accepted (поле fromState).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_state_changed: состояние оффера уже не то, что видел вызывающий, — кандидат ответил, оффер отозвали из соседней вкладки или вышел срок. Перечитайте офферы отклика. 409, а не 400: тело законно, а состояние оффера не позволяет.",
            "x-error-codes": [
              "offer_state_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-drafts/{id}": {
      "patch": {
        "operationId": "appEditOfferDraft",
        "tags": [
          "Отклики"
        ],
        "summary": "Изменить подготовленный оффер",
        "description": "Меняет условия подготовленного оффера по ревизии, которую видел вызывающий; тело — форма оффера целиком.\n\nЕсли меняются сумма, дата выхода, условия или причина вне вилки — это новая версия: вилка и валюта перечитываются из вакансии, согласование снимается, ожидающий запрос согласующему гаснет, и согласовывать нужно заново. Срок ответа и зона версию не меняют: согласование и запрос остаются.\n\napproverB24UserId меняет согласующего; ключа нет — согласующий прежний. Если при ожидающем запросе новый согласующий — другой человек, запрос гаснет, и новый отправляется кнопкой; версия и согласованность не меняются. После отказа смена согласующего без правки условий не открывает новый запрос: отказ привязан к условиям.\n\nКод forbidden также у запроса ключом API с полем approverB24UserId (число или null): согласующего выбирают только из кабинета; без поля ключ правит оффер, не трогая согласующего.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferDraftWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Подготовленный оффер после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferDraft"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1d7e42-8a90-4b3f-a6d1-0e9f2b7c4a18",
                    "amount": "140000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": false,
                    "overForkReason": null,
                    "startDate": "2026-11-23",
                    "conditions": "Испытательный срок три месяца",
                    "respondBy": "2026-11-16",
                    "tz": "Europe/Moscow",
                    "version": 2,
                    "revision": 2,
                    "approval": null,
                    "bypassClosed": false,
                    "bypass": null,
                    "can": {
                      "request": true,
                      "remind": false,
                      "resend": false,
                      "sendApproved": false,
                      "bypass": true
                    },
                    "approver": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — поле не годится, details.field называет его: revision — не целое больше нуля; amount — не число больше нуля в разрядности; startDate или respondBy — не дата 2006-01-02, а respondBy ещё и вне окна от завтра до тридцати дней в зоне tz; tz — пустая строка, Local или неизвестная зона; overForkReason — сумма вне вилки без причины либо причина длиннее 4000 знаков; conditions — длиннее 4000 знаков; approverB24UserId — не целое больше нуля либо не человек этого портала: чужой, уволен, пропал.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_draft_changed: подготовленный оффер изменился после того, как его видел вызывающий, — другая ревизия (правка, решение согласующего), оффер удалён или уже отправлен. Перечитайте офферы отклика. Код application_inactive: отклик в hired или rejected. Код candidate_purged — данные кандидата отклика удалены: отклик только для чтения.",
            "x-error-codes": [
              "offer_draft_changed",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appDeleteOfferDraft",
        "tags": [
          "Отклики"
        ],
        "summary": "Удалить подготовленный оффер",
        "description": "Удаляет подготовленный оффер по ревизии, которую видел вызывающий: ожидающий запрос согласующему гаснет, место подготовленного у отклика освобождается. Удалить можно и у закрытого отклика.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": true,
            "description": "Ревизия подготовленного оффера, которую видел вызывающий.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Удалён."
          },
          "400": {
            "description": "id не разобрался — код bad_request. invalid_value — revision не целое больше нуля (поле revision).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_draft_changed: подготовленный оффер изменился после того, как его видел вызывающий, — другая ревизия (правка, решение согласующего), оффер удалён или уже отправлен. Перечитайте офферы отклика. Код candidate_purged — данные кандидата отклика удалены: отклик только для чтения.",
            "x-error-codes": [
              "offer_draft_changed",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-drafts/{id}/approval-request": {
      "post": {
        "operationId": "appRequestOfferApproval",
        "tags": [
          "Отклики"
        ],
        "summary": "Попросить согласующего согласовать оффер",
        "description": "Отправляет согласующему оффера — выбранному у оффера (approverB24UserId), иначе заказчику вакансии, иначе её автору — запрос согласовать текущую версию подготовленного оффера: сообщение с ссылкой приходит в чат Битрикс24. Выбранного, не входившего в HR AI, запрос заводит человеком сервиса, только когда бот портала работает. Решающий запоминается на момент запроса: смена заказчика вакансии уже отправленный запрос не перенаправляет, а смена согласующего у оффера (PATCH /api/v1/offer-drafts/{id}) гасит ожидающий запрос.\n\nСостояние запроса и доставки — в поле approval ответа. Подготовленный оффер запрос не меняет, ревизия прежняя.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferDraftRevision"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Подготовленный оффер с запросом",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferDraft"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1d7e42-8a90-4b3f-a6d1-0e9f2b7c4a18",
                    "amount": "140000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": false,
                    "overForkReason": null,
                    "startDate": "2026-11-23",
                    "conditions": "Испытательный срок три месяца",
                    "respondBy": "2026-11-16",
                    "tz": "Europe/Moscow",
                    "version": 1,
                    "revision": 1,
                    "approval": {
                      "state": "pending",
                      "delivery": "queued",
                      "deliveryFailure": null,
                      "approver": {
                        "id": "3f6b2a90-1c4e-4d7a-9b58-6e2d0c8f1a73",
                        "name": "Заказчикова Анна Сергеевна"
                      },
                      "requestedAt": "2026-11-09T09:00:00Z",
                      "decidedAt": null,
                      "rejectReason": null,
                      "remindedAt": null,
                      "remindAfter": "2026-11-09T10:00:00Z",
                      "selfApproved": false
                    },
                    "bypassClosed": false,
                    "bypass": null,
                    "can": {
                      "request": false,
                      "remind": false,
                      "resend": false,
                      "sendApproved": false,
                      "bypass": true
                    },
                    "approver": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — revision не целое больше нуля (поле revision).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_approval_pending: запрос уже ждёт решения согласующего. Код offer_approval_approved: эта версия уже согласована. Код offer_approval_rejected_version: такие условия в этом отклике уже отклонены — измените оффер; смена согласующего без правки условий нового запроса не открывает. Код offer_draft_changed: подготовленный оффер изменился после того, как его видел вызывающий, — другая ревизия (правка, решение согласующего), оффер удалён или уже отправлен. Перечитайте офферы отклика. Код application_inactive: отклик в hired или rejected. Код candidate_purged — данные кандидата отклика удалены: отклик только для чтения. Код offer_approver_unavailable: выбранный согласующий больше не работает на портале (уволен, пропал или отключён в HR AI) — выберите другого. Код offer_approver_needs_bot: выбранный согласующий не входил в HR AI, а бот на портале не работает — запросу не до кого дойти.",
            "x-error-codes": [
              "offer_approval_pending",
              "offer_approval_approved",
              "offer_approval_rejected_version",
              "offer_draft_changed",
              "application_inactive",
              "candidate_purged",
              "offer_approver_unavailable",
              "offer_approver_needs_bot"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-drafts/{id}/approval-request/remind": {
      "post": {
        "operationId": "appRemindOfferApproval",
        "tags": [
          "Отклики"
        ],
        "summary": "Напомнить согласующему об оффере",
        "description": "Отправляет решающему ожидающего запроса — согласующему оффера на момент запроса — ещё одно сообщение об этом запросе. Доступно, только когда прошлое сообщение доставлено и с запроса или прошлого напоминания прошёл час (поле approval.remindAfter). Тела нет, ревизия не сверяется и не меняется.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Подготовленный оффер после напоминания",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferDraft"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1d7e42-8a90-4b3f-a6d1-0e9f2b7c4a18",
                    "amount": "140000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": false,
                    "overForkReason": null,
                    "startDate": "2026-11-23",
                    "conditions": "Испытательный срок три месяца",
                    "respondBy": "2026-11-16",
                    "tz": "Europe/Moscow",
                    "version": 1,
                    "revision": 1,
                    "approval": {
                      "state": "pending",
                      "delivery": "queued",
                      "deliveryFailure": null,
                      "approver": {
                        "id": "3f6b2a90-1c4e-4d7a-9b58-6e2d0c8f1a73",
                        "name": "Заказчикова Анна Сергеевна"
                      },
                      "requestedAt": "2026-11-09T09:00:00Z",
                      "decidedAt": null,
                      "rejectReason": null,
                      "remindedAt": "2026-11-09T10:05:00Z",
                      "remindAfter": "2026-11-09T11:05:00Z",
                      "selfApproved": false
                    },
                    "bypassClosed": false,
                    "bypass": null,
                    "can": {
                      "request": false,
                      "remind": false,
                      "resend": false,
                      "sendApproved": false,
                      "bypass": true
                    },
                    "approver": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не разобрался — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_approval_remind_unavailable: напомнить сейчас нельзя — запрос не ждёт решения, сообщение не доставлено или час ещё не прошёл. Код candidate_purged — данные кандидата отклика удалены.",
            "x-error-codes": [
              "offer_approval_remind_unavailable",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-drafts/{id}/approval-request/resend": {
      "post": {
        "operationId": "appResendOfferApproval",
        "tags": [
          "Отклики"
        ],
        "summary": "Отправить запрос согласующему повторно",
        "description": "Повторяет сообщение решающему ожидающего запроса — согласующему оффера на момент запроса — если прошлое не доставлено (approval.delivery = failed). Тела нет, ревизия не сверяется и не меняется. Если согласующий недоступен, у оффера выбирают другого (approverB24UserId в PATCH /api/v1/offer-drafts/{id}): ожидающий запрос гаснет, и новый уходит выбранному запросом согласования.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Подготовленный оффер после повтора",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferDraft"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1d7e42-8a90-4b3f-a6d1-0e9f2b7c4a18",
                    "amount": "140000.00",
                    "currency": "RUB",
                    "forkMin": "100000.00",
                    "forkMax": "150000.00",
                    "salaryHidden": false,
                    "salaryMasked": false,
                    "outOfFork": false,
                    "overForkReason": null,
                    "startDate": "2026-11-23",
                    "conditions": "Испытательный срок три месяца",
                    "respondBy": "2026-11-16",
                    "tz": "Europe/Moscow",
                    "version": 1,
                    "revision": 1,
                    "approval": {
                      "state": "pending",
                      "delivery": "queued",
                      "deliveryFailure": null,
                      "approver": {
                        "id": "3f6b2a90-1c4e-4d7a-9b58-6e2d0c8f1a73",
                        "name": "Заказчикова Анна Сергеевна"
                      },
                      "requestedAt": "2026-11-09T09:00:00Z",
                      "decidedAt": null,
                      "rejectReason": null,
                      "remindedAt": null,
                      "remindAfter": "2026-11-09T10:00:00Z",
                      "selfApproved": false
                    },
                    "bypassClosed": false,
                    "bypass": null,
                    "can": {
                      "request": false,
                      "remind": false,
                      "resend": false,
                      "sendApproved": false,
                      "bypass": true
                    },
                    "approver": {
                      "b24UserId": 17,
                      "name": "Заказчикова Анна Сергеевна",
                      "avatarUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "id не разобрался — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_approval_resend_unavailable: повторить нечего — запрос не ждёт решения или сообщение не в ошибке доставки. Код candidate_purged — данные кандидата отклика удалены.",
            "x-error-codes": [
              "offer_approval_resend_unavailable",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-drafts/{id}/send": {
      "post": {
        "operationId": "appSendOfferDraft",
        "tags": [
          "Отклики"
        ],
        "summary": "Отправить подготовленный оффер кандидату",
        "description": "Отправляет подготовленный оффер кандидату: заводит оффер из его условий с тем же id и переводит отклик в offer — ответ тот же, что у прямой отправки, со ссылкой кандидату. Срок ответа проверяется ещё раз: истёкший правят в подготовленном оффере.\n\nСогласованную версию отправляют без причины. Несогласованную — только с причиной bypassReason, и только пока согласующий не отклонял оффер этого отклика после последней отправки (поле bypassClosed); ожидающий запрос при этом гаснет, причина остаётся в истории оффера.\n\nПовтор после успешной отправки отдаёт тот же оффер.\n\nТребует права application · edit на отклик подготовленного оффера; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id подготовленного оффера.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferDraftSend"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Оффер отправлен; ссылка ведёт в кабинет кандидата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApplicationOfferSent"
                    }
                  }
                },
                "example": {
                  "data": {
                    "offer": {
                      "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "amount": "180000.00",
                      "currency": "RUB",
                      "forkMin": "100000.00",
                      "forkMax": "150000.00",
                      "salaryHidden": false,
                      "salaryMasked": false,
                      "outOfFork": true,
                      "overForkReason": "Редкий специалист, встречное предложение",
                      "startDate": "2026-10-12",
                      "conditions": "Испытательный срок три месяца",
                      "state": "sent",
                      "respondBy": "2026-10-01",
                      "expiresAt": "2026-10-01T21:00:00Z",
                      "tz": "Europe/Moscow",
                      "sentAt": "2026-09-24T09:00:00Z",
                      "respondedAt": null,
                      "declineReason": null
                    },
                    "link": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — поле не годится, details.field называет его: revision — не целое больше нуля; bypassReason — пустая, длиннее 4000 знаков или прислана к согласованной версии; respondBy — срок ответа уже вне окна от завтра до тридцати дней.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Подготовленного оффера с таким id в этом портале нет или его отклик вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код offer_approval_missing: версия не согласована, а причины обхода нет. Код offer_approval_bypass_closed: согласующий отклонил оффер этого отклика — без согласования не отправить. Код offer_active_exists: у отклика есть действующий оффер. Код offer_draft_changed: подготовленный оффер изменился после того, как его видел вызывающий, — другая ревизия (правка, решение согласующего), оффер удалён или уже отправлен. Перечитайте офферы отклика. Код application_inactive: отклик в hired или rejected. Код candidate_purged — данные кандидата отклика удалены: отклик только для чтения.",
            "x-error-codes": [
              "offer_approval_missing",
              "offer_approval_bypass_closed",
              "offer_active_exists",
              "offer_draft_changed",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/people": {
      "get": {
        "operationId": "appInterviewPeople",
        "tags": [
          "Собеседования"
        ],
        "summary": "Люди портала для выбора собеседующих",
        "description": "Поиск по имени живым вызовом user.get, вебхуком рекрутёра со скоупом user (не calendar — он этой ручке не нужен). Страница — портальная: cursor пробрасывается в параметр start метода user.get как есть, числом, и nextCursor отвечает начало следующей страницы; портал решает, сколько человек отдать за раз.\n\nСвоя ручка, а не GET /api/v1/access/b24/people: та стоит под правом управлять правами, которого у рекрутёра нет и не должно быть, и читает снимок b24_person, который ничем не наполняется.\n\nТребует права interview · edit.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока имени или фамилии.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "nextCursor предыдущей страницы. В отличие от прочих постраничных ручек — НЕ непрозрачный: это ровно параметр start метода user.get, числом, и прятать чужой публичный параметр было бы церемонией без выгоды.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Люди портала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewPeopleResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "b24UserId": 42,
                        "name": "Одинцова Мария Павловна"
                      }
                    ],
                    "nextCursor": "50"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор не разобрался числом или отрицателен — код invalid_value, details.field: cursor.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Код calendar_not_ready: у исполнителя нет живого вебхука с нужным скоупом. Проверьте GET /api/v1/interviews/readiness — обычно раздел не открывают до её ok.",
            "x-error-codes": [
              "calendar_not_ready"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "502": {
            "description": "Код b24_unavailable: портал не ответил или ответил отказом. Причина не уходит наружу — она может нести код и адрес чужого вебхука.",
            "x-error-codes": [
              "b24_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/availability/days": {
      "post": {
        "operationId": "appInterviewAvailabilityDays",
        "tags": [
          "Собеседования"
        ],
        "summary": "Сводка свободных окон по дням диапазона",
        "description": "Число свободных окон длиной durationMin на КАЖДЫЙ календарный день диапазона в зоне tz, включая дни без единого окна — лентой дней рисуется этот ответ целиком, одним вызовом. Диапазон не длиннее квартала (92 календарных дня зоны tz). Сами времена внутри выбранного дня отдаёт POST /api/v1/interviews/availability/slots — поддиапазоном не длиннее недели.\n\nТребует права interview · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterviewAvailabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сводка по дням",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewAvailabilityDaysResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "days": [
                      {
                        "date": "2026-09-21",
                        "freeCount": 2
                      },
                      {
                        "date": "2026-09-22",
                        "freeCount": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось (bad_request) или поле не прошло проверку (invalid_value, details.field называет какое).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "Код calendar_not_ready: у исполнителя нет живого вебхука с нужным скоупом. Проверьте GET /api/v1/interviews/readiness.",
            "x-error-codes": [
              "calendar_not_ready"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код range_too_wide: запрошенный период длиннее квартала (92 календарных дня зоны tz). Ответ несёт запись на каждый день диапазона, и без предела растёт вместе с ним линейно.",
            "x-error-codes": [
              "range_too_wide"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "502": {
            "description": "Код b24_unavailable: портал не ответил или ответил отказом.",
            "x-error-codes": [
              "b24_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/availability/slots": {
      "post": {
        "operationId": "appInterviewAvailabilitySlots",
        "tags": [
          "Собеседования"
        ],
        "summary": "Свободные времена внутри одной недели диапазона",
        "description": "Ничего не создаёт: считает свободные времена в [from, to) по занятости собеседующих (calendar.accessibility.get вебхуком рекрутёра) и рабочему окну (дни, часы, зона). Диапазон не длиннее НЕДЕЛИ (7 календарных дней зоны tz) — порция, за которую платится один вызов в портал, ровно столько, сколько раскрывает лента дней при клике на один день. Сводку по всему диапазону отдаёт POST /api/v1/interviews/availability/days.\n\nТребует права interview · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterviewAvailabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Свободные времена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewAvailabilityResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "slots": [
                      {
                        "from": "2026-09-21T07:00:00Z",
                        "to": "2026-09-21T08:00:00Z"
                      },
                      {
                        "from": "2026-09-22T07:00:00Z",
                        "to": "2026-09-22T08:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось (bad_request) или поле не прошло проверку (invalid_value, details.field называет какое).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "Код calendar_not_ready: у исполнителя нет живого вебхука с нужным скоупом. Проверьте GET /api/v1/interviews/readiness.",
            "x-error-codes": [
              "calendar_not_ready"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код range_too_wide: запрошенный период длиннее недели (7 календарных дней зоны tz) — порции, за которую платится один вызов в портал. Более широкую сводку по дням отдаёт POST /api/v1/interviews/availability/days.",
            "x-error-codes": [
              "range_too_wide"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "502": {
            "description": "Код b24_unavailable: портал не ответил или ответил отказом.",
            "x-error-codes": [
              "b24_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews": {
      "get": {
        "operationId": "appListInterviews",
        "tags": [
          "Собеседования"
        ],
        "summary": "Список приглашений на собеседование",
        "description": "Приглашения портала, свежие сверху, до 200 строк — экран читается целиком, без пикеровского «показать ещё». Выдача сужается уровнем вызывающего, как и у плана найма: «свои» — где вызывающий в created_by, «все» — портал целиком.\n\nТребует права interview · view.\n\nНеобязательный vacancy сужает выдачу на сервере до выбранной вакансии перед ограничением списка. Пустое или отсутствующее значение сохраняет прежнюю выдачу. Несуществующая и чужая порталу вакансия дают одинаковый пустой список. Фильтр не требует отдельного просмотра вакансии или отклика и не расширяет доступ к строкам.",
        "responses": {
          "200": {
            "description": "Список приглашений",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "interviews": [
                      {
                        "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                        "application": {
                          "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24"
                        },
                        "candidateName": "Иван Иванов",
                        "candidateContact": "+70000000000",
                        "contactKind": "phone",
                        "durationMin": 60,
                        "tz": "Europe/Kaliningrad",
                        "status": "pending",
                        "leadB24UserId": 15,
                        "b24EventId": null,
                        "bookedAt": null,
                        "expiresAt": "2026-10-01T09:00:00Z",
                        "link": "https://hrm.example.com/join/vacancies/0f3b6a1e-2c4d-4e8f-9a1b-7c5d3e2f1a09",
                        "delivery": null,
                        "calendarOperation": null,
                        "calendarRemoval": null,
                        "telegramRecipientRetired": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный UUID vacancy — invalid_value с details.field = vacancy.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "неверное значение поля",
                    "retryable": false,
                    "details": {
                      "field": "vacancy"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "vacancy",
            "in": "query",
            "required": false,
            "description": "Public UUID вакансии. Сужает видимые строки до этой вакансии до ограничения списка; не меняет права. Не задан или пуст — прежний список без фильтра. Несуществующая или чужая порталу вакансия — пустой список. Неверный UUID — 400 invalid_value (details.field = vacancy).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateInterview",
        "tags": [
          "Собеседования"
        ],
        "summary": "Завести приглашение",
        "description": "Кандидат, собеседующие, ведущий (обязан входить в attendees), длительность, зона и предложенные времена. В ответе — поле link. Приглашение из отклика, до которого кабинет кандидата доводит сам, токена не получает: link — адрес его страницы в кабинете, постоянный и без секрета; кандидат выбирает время там, войдя телефоном или почтой из отклика. Секретная ссылка, показанная ЕДИНСТВЕННЫЙ РАЗ, выпускается приглашению без отклика и приглашению из отклика, когда кабинет не доводит: у кандидата нет телефона и почты или вход в кабинет в этой установке недоступен.\n\nПриглашение из отклика несёт поле applicationId — public_id отклика. Имя кандидата и вакансию тогда берёт сервер, candidateName присылать нельзя, а candidateContact выбирается из контактов кандидата. Создание такого приглашения переводит отклик с этапа new на interview в той же транзакции, что и само приглашение: отказ создания этап не меняет. Переводится только отклик вакансии сценария regular, стоящий на new; отклик на другом этапе и отклик вакансии сценария mass этап сохраняют. В истории стадий (reviewHistory) этот уход — с via interview_invite, в actor — создавший приглашение; stageEnteredAt — момент создания. Бронь кандидатом переводит отклик с new на interview, только если к брони он стоит на new: так бывает у приглашения, заведённого раньше, чем создание стало переводить отклик, и у отклика, который при живом приглашении вернули на new сменой этапа (POST /api/v1/applications/{id}/stage).\n\nУ отклика не больше одного приглашения, ждущего ответа кандидата: второе отвечает 409 live_invite_exists. Отклик в отказе или вышедший на работу отвечает 409 application_inactive.\n\nТребует права interview · edit, а с applicationId — ещё и права application · edit на этот отклик: привязка и есть правка отклика. Отклик вне уровня вызывающего отвечает 404, как несуществующий. Контакт phone отправляет СМС, email — письмо. СМС требует явного действия отправки.\n\nПри sendInvite=true и контакте phone сценарная СМС дополнительно требует порталовый флаг sms-scenarios. При выключенном флаге — 403 feature_disabled, при недоступном снимке или identity — 503 feature_flags_unavailable до побочных эффектов. Почта, ручные и базовые операции без нового SMS-выбора не зависят от флага. При deliveryChannel=telegram исходный private чат берётся из нового подтверждённого отклика без username или повторного Start. Создание и отправка повторно проверяют права и маршрут под замком отклика. 61сек при lease120сек повтор запрещён даже с подтверждением; после аренды неизвестный исход требует confirmPossibleDuplicate=true и может привести к дублю. Решение о почте email: режимы skip и provide (любой, кроме saved) принимаются только от того, кто может готовить чат этого кандидата, — пригласившего с личным вебхуком Битрикс24 и правами на кандидата и отклик; остальным доступен только saved, иначе 403 authorization_unproven до любого эффекта. Записанный раньше отказ кандидата от Битрикс24 соблюдается; когда чат заведомо недоступен, сервер сам отправляет выбранным каналом.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterviewCreateRequest"
              },
              "examples": {
                "telegram": {
                  "summary": "Из отклика в исходный Telegram чат",
                  "value": {
                    "applicationId": "01JTG0000000000000000000000",
                    "deliveryChannel": "telegram",
                    "durationMin": 30,
                    "tz": "Europe/Kaliningrad",
                    "attendees": [
                      7
                    ],
                    "leadB24UserId": 7,
                    "slots": [
                      {
                        "from": "2026-10-20T09:00:00Z",
                        "to": "2026-10-20T09:30:00Z"
                      }
                    ],
                    "sendInvite": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заведённое приглашение, со ссылкой",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                    "application": {
                      "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24"
                    },
                    "candidateName": "Иван Иванов",
                    "candidateContact": "+70000000000",
                    "contactKind": "phone",
                    "durationMin": 60,
                    "tz": "Europe/Kaliningrad",
                    "status": "pending",
                    "leadB24UserId": 15,
                    "b24EventId": null,
                    "bookedAt": null,
                    "expiresAt": "2026-10-01T09:00:00Z",
                    "attendees": [
                      15,
                      17
                    ],
                    "slots": [
                      {
                        "from": "2026-09-21T07:00:00Z",
                        "to": "2026-09-21T08:00:00Z"
                      },
                      {
                        "from": "2026-09-22T07:00:00Z",
                        "to": "2026-09-22T08:00:00Z"
                      }
                    ],
                    "chosenSlot": null,
                    "link": "https://hrm.example.com/join/vacancies/0f3b6a1e-2c4d-4e8f-9a1b-7c5d3e2f1a09",
                    "b24EventRemoved": null,
                    "delivery": null,
                    "calendarOperation": null,
                    "calendarRemoval": null,
                    "telegramRecipientRetired": false,
                    "b24": {
                      "state": "pending"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось (bad_request) или поле не прошло проверку (invalid_value, details.field называет какое, включая tz и слоты). С applicationId сюда же относятся: applicationId не идентификатор, присланное вместе с ним candidateName и candidateContact не из контактов кандидата. Почтовый шаблон не применён: template_data_missing — не хватает данных подстановки, template_too_large — превышен размер письма, template_invalid — некорректный исходник; письмо не поставлено в очередь. contact_not_allowed: вводимое имя содержит ссылку или контакт; details.field и details.offset (исходный Unicode code point), без исходного текста. Импортированное имя площадки не переписывается.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "template_data_missing",
              "template_too_large",
              "template_invalid",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appCreateInterviewFeatureForbidden"
          },
          "404": {
            "description": "Отклика из applicationId в этом портале нет или он вне уровня вызывающего по application · edit — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код company_contact_required: у компании нет публичной почты и телефона; до создания приглашения заполните хотя бы один контакт в профиле компании. details.companyId — public_id проверенного профиля вакансии или профиля портала по умолчанию; null, если профиля нет. Код live_invite_exists: у отклика из applicationId уже есть приглашение, которое ждёт ответа кандидата, — отмените его, чтобы отправить новое; забронированные, отменённые и истёкшие не мешают. Код application_inactive: отклик в отказе или кандидат уже вышел на работу — такой отклик на собеседование не зовут. Коды delivery_not_configured и delivery_unroutable приходят только при sendInvite: отправка проверяется ДО создания, поэтому отказ канала отменяет и само создание — приглашение не заводится. Код delivery_bad_address: адрес не принят; телефон должен быть международным, страна — разрешённой. Код candidate_purged — данные кандидата отклика удалены по сроку хранения или отзыву согласия: отклик только для чтения. Telegram: telegram_recipient_unbound, telegram_recipient_blocked, telegram_recipient_expired, telegram_bot_changed, candidate_purged, delivery_outcome_unknown. delivery_outcome_unknown несёт details.resendBlockedUntil при активной аренде. candidate_b24_email_required, contact_taken, intent_conflict, action_target_gone, login_unavailable. Код candidate_employee — кандидат отклика переведён в сотрудники: приглашение при sendInvite ему не отправляется, и встреча не заводится; без sendInvite встреча заводится без отправки. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "company_contact_required",
              "live_invite_exists",
              "application_inactive",
              "candidate_purged",
              "delivery_not_configured",
              "delivery_unroutable",
              "telegram_recipient_unbound",
              "telegram_recipient_blocked",
              "telegram_recipient_expired",
              "telegram_bot_changed",
              "delivery_outcome_unknown",
              "delivery_bad_address",
              "candidate_b24_email_required",
              "contact_taken",
              "intent_conflict",
              "action_target_gone",
              "login_unavailable",
              "candidate_employee",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "delivery_bad_address",
                    "message": "номер не в международном формате или страна не разрешена"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код validation_error: пустой список собеседующих, пустой список предложенных времён или ведущий вне списка собеседующих. Telegram: invalid_value с details.field при ручном имени, контакте, виде или отсутствии applicationId. invalid_email.",
            "x-error-codes": [
              "validation_error",
              "invalid_value",
              "invalid_email"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/InterviewCreateRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Interview operation refusal codes: delivery_not_configured, feature_flags_unavailable. Дополнительные коды: telegram_scenarios_busy.",
            "x-error-codes": [
              "delivery_not_configured",
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/{id}": {
      "get": {
        "operationId": "appGetInterview",
        "tags": [
          "Собеседования"
        ],
        "summary": "Карточка приглашения",
        "description": "Что предложено, что выбрано, что с Б24. Ссылки здесь нет — поле link пустое: секрет показывается один раз, в ответе на создание.\n\nТребует права interview · view; вне уровня смотрящего отвечает 404, как и несуществующее — 403 подтвердил бы существование чужой строки. Read-only chat preflight is returned for a new action; a submitted key returns that exact operation receipt, without scheduling or preparing a second delivery.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operationKey",
            "in": "query",
            "required": false,
            "description": "Read the exact previously submitted intent in this resource scope. An absent or unknown key describes a new action; no command, B24 call or write is performed.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка приглашения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                    "application": null,
                    "candidateName": "Иван Иванов",
                    "candidateContact": "+70000000000",
                    "contactKind": "phone",
                    "durationMin": 60,
                    "tz": "Europe/Kaliningrad",
                    "status": "pending",
                    "leadB24UserId": 15,
                    "b24EventId": null,
                    "bookedAt": null,
                    "expiresAt": "2026-10-01T09:00:00Z",
                    "attendees": [
                      15,
                      17
                    ],
                    "slots": [
                      {
                        "from": "2026-09-21T07:00:00Z",
                        "to": "2026-09-21T08:00:00Z"
                      },
                      {
                        "from": "2026-09-22T07:00:00Z",
                        "to": "2026-09-22T08:00:00Z"
                      }
                    ],
                    "chosenSlot": null,
                    "link": "",
                    "b24EventRemoved": null,
                    "delivery": null,
                    "calendarOperation": null,
                    "calendarRemoval": null,
                    "telegramRecipientRetired": false,
                    "b24Action": {
                      "intent": "new",
                      "b24": {
                        "state": "closed",
                        "reason": null,
                        "emailToo": false,
                        "superseded": false,
                        "skip": false
                      }
                    },
                    "b24Replay": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: приглашения нет, или оно вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/{id}/cancel": {
      "post": {
        "operationId": "appCancelInterview",
        "tags": [
          "Собеседования"
        ],
        "summary": "Отменить приглашение",
        "description": "Ссылка гаснет всегда, в своей транзакции. Если встреча уже создана, ручка ПЫТАЕТСЯ снять и её тем же вебхуком, которым она была создана — попытка, а не обязательство: отказ портала не отменяет отмену ссылки, он только определяет b24EventRemoved в ответе (null — встречи не было, true — снята, false — не удалось, снимите сами).\n\nТребует права interview · edit; вне уровня смотрящего отвечает 404, как и несуществующее. Необязательное тело {sendSms:true} разрешает СМС о будущей забронированной встрече. Пустое тело, отсутствие поля, null и false — отмена без СМС. Для почты флаг не используется.\n\nПри sendSms=true и сохранённом phone сценарная СМС дополнительно требует порталовый флаг sms-scenarios. Для email поле sendSms игнорируется. При выключенном флаге — 403 feature_disabled, при недоступном снимке или identity — 503 feature_flags_unavailable до побочных эффектов. Почта, ручные и базовые операции без нового SMS-выбора не зависят от флага.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Отменённое приглашение",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                    "application": null,
                    "candidateName": "Иван Иванов",
                    "candidateContact": "+70000000000",
                    "contactKind": "phone",
                    "durationMin": 60,
                    "tz": "Europe/Kaliningrad",
                    "status": "pending",
                    "leadB24UserId": 15,
                    "b24EventId": null,
                    "bookedAt": null,
                    "expiresAt": "2026-10-01T09:00:00Z",
                    "attendees": [
                      15,
                      17
                    ],
                    "slots": [
                      {
                        "from": "2026-09-21T07:00:00Z",
                        "to": "2026-09-21T08:00:00Z"
                      },
                      {
                        "from": "2026-09-22T07:00:00Z",
                        "to": "2026-09-22T08:00:00Z"
                      }
                    ],
                    "chosenSlot": null,
                    "link": "",
                    "b24EventRemoved": null,
                    "delivery": null,
                    "calendarOperation": null,
                    "calendarRemoval": null,
                    "telegramRecipientRetired": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: некорректное тело запроса.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "тело запроса не разобралось"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appMoveVacancyFeatureForbidden"
          },
          "404": {
            "description": "Код not_found: приглашения нет, или оно вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код invite_gone: приглашение уже отменено. Вышедший срок отмене не мешает: статус у просроченного остаётся pending, и отмена проходит.",
            "x-error-codes": [
              "invite_gone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/appCancelInterviewFeatureUnavailable"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppInterviewCancelRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/readiness": {
      "get": {
        "operationId": "appInterviewReadiness",
        "tags": [
          "Собеседования"
        ],
        "summary": "Готовность раздела собеседований",
        "description": "Жив ли вебхук исполнителя и есть ли в нём calendar — проверяется ПРИ ОТКРЫТИИ РАЗДЕЛА, а не в момент, когда кандидат выбирает время: скоуп calendar приезжает человеку только со следующим его входом, и об этом должен узнать рекрутёр, а не кандидат неделю спустя. Облачные и коробочные порталы проверяются по сохранённому личному вебхуку одинаково. Значение box_portal сохранено в контракте для совместимости; текущий сервер его не возвращает.\n\nС параметром application ответ дополнительно несёт companyContact — есть ли у профиля компании вакансии этого отклика публичная почта или телефон. Мастер приглашения проверяет это до создания, а не узнаёт отказом company_contact_required. Прав на компанию не нужно; отклик сверяется уровнем application · view.\n\nТребует права interview · view.",
        "parameters": [
          {
            "name": "application",
            "in": "query",
            "required": false,
            "description": "Public UUID отклика. Задан — в ответе есть companyContact по профилю компании вакансии отклика; не задан или пуст — поля companyContact нет. Неверный UUID — 400 invalid_value (details.field = application). Отклик вне уровня application · view или несуществующий — 404 not_found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Состояние готовности",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewReadiness"
                    }
                  }
                },
                "example": {
                  "data": {
                    "ready": true,
                    "reason": "ok",
                    "delivery": "ok",
                    "resendMax": 5,
                    "resendPauseSec": 60
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверный UUID application — invalid_value с details.field = application.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "неверное значение поля",
                    "retryable": false,
                    "details": {
                      "field": "application"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Код not_found: отклика из application нет или он вне уровня application · view смотрящего — ответ не подтверждает, что отклик существует.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules": {
      "get": {
        "operationId": "appVacationSchedules",
        "tags": [
          "График отпусков"
        ],
        "summary": "Графики отпусков",
        "description": "Графики портала, ближайший год сверху. Прошлые годы не прячутся и не удаляются.\n\nТребует права vacation_schedule · view.",
        "responses": {
          "200": {
            "description": "Графики",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationSchedulesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "schedules": [
                      {
                        "id": "7f2c1a9e-3d54-4b81-9c06-2e5a8b7d1f43",
                        "year": 2027,
                        "status": "collecting",
                        "collectUntil": "2026-11-30",
                        "approvedAt": null,
                        "approvedBy": null,
                        "entries": 312,
                        "people": 168
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Юрлица из параметра entity в этом портале нет (или адрес не разбирается) — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чьи графики вернуть. Не прислан — юрлицо портала по умолчанию: переключателя на экранах ещё нет, и отказ означал бы, что раздел перестал открываться. Когда переключатель появится, параметр станет обязательным."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateVacationSchedule",
        "tags": [
          "График отпусков"
        ],
        "summary": "Завести график на год",
        "description": "Один график на портал и год. Второй немедленно ставит вопрос, какой из двух настоящий, поэтому не заводится.\n\nТребует права vacation_schedule · edit — по умолчанию оно у кадровика и администратора портала.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, в котором заводится график. Не прислан — юрлицо портала по умолчанию, тем же правилом, что у списка графиков."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationScheduleCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заведённый график",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationSchedule"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7f2c1a9e-3d54-4b81-9c06-2e5a8b7d1f43",
                    "year": 2027,
                    "status": "collecting",
                    "collectUntil": "2026-11-30",
                    "approvedAt": null,
                    "approvedBy": null,
                    "entries": 312,
                    "people": 168
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Юрлица из параметра entity в этом портале нет (или адрес не разбирается) — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График на этот год уже есть — код year_taken. В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity.",
            "x-error-codes": [
              "year_taken",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Год вне допустимых пределов — код bad_year; дата срока не разбирается — bad_date.",
            "x-error-codes": [
              "bad_year",
              "bad_date"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}": {
      "get": {
        "operationId": "appVacationSchedule",
        "tags": [
          "График отпусков"
        ],
        "summary": "Карточка графика",
        "description": "Состояние, срок сбора, счётчики и отметка утверждения.\n\nТребует права vacation_schedule · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "График",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationSchedule"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7f2c1a9e-3d54-4b81-9c06-2e5a8b7d1f43",
                    "year": 2027,
                    "status": "collecting",
                    "collectUntil": "2026-11-30",
                    "approvedAt": null,
                    "approvedBy": null,
                    "entries": 312,
                    "people": 168
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appPatchVacationSchedule",
        "tags": [
          "График отпусков"
        ],
        "summary": "Состояние, сроки и охват сбора",
        "description": "Состояние двигается вперёд и по одному; назад разрешён единственный возврат из согласования в сбор. Переход в сбор требует обоих сроков, срок сбора не позже срока утверждения. При правке сроков черновика или идущего сбора обратная пара также отклоняется. Сроки и статус записываются одной транзакцией.\n\nУтверждение вместе с правкой сроков и охвата выполняется одной транзакцией с проверкой календаря и заморозкой дней. Утверждение, с правкой сроков и без, проверяет итоговую пару сроков: оба срока обязательны (пустой — missing), срок утверждения не раньше срока сбора (order), изменяемый в этом запросе срок не раньше «сегодня» юрлица (past); отказ — 422 collection_deadlines_invalid, график остаётся в review. График без одного из сроков исправляют обычной правкой в review. Порог статьи 125 проверяется по дням отпуска, а они считаются только по производственному календарю. Календарь человека — с наследованием по дереву подразделений; года нет в региональном, а в базовом есть — дни считаются и замораживаются по базовому, без региональных праздников.\n\nУтверждению мешают два нарушения, и считаются оба до отказа: у кого-то нет части не меньше порога (short_parts) и участники сбора без дат и без отметки «Не планировать в этом году» (without_dates). Есть короткие части — отказ short_parts, и в его details.withoutDates названы и люди без дат; иначе — without_dates. Закрытие сбора (переход в review) этих проверок не получает. Утверждение согласует все ждущие и возвращённые части от имени утвердившего; такие строки несут agreedOnApproval: true. Ломающее изменение (ADR-vacation-hr-cycle): раньше люди без дат утверждению не мешали.\n\nПосле утверждения уведомления о начале отпуска (ст. 123 ТК) уходят тем, кому пора, сразу — тем же проходом, что «Разослать сейчас», от имени утвердившего и в остатке её 15-секундного бюджета; чего он не вместил, дошлёт ночной проход. Строке, у которой даты меняли, пока график был снова в сборе, уведомление ждало именно этого утверждения (решение владелицы 03.10.2026, №17). Неудача рассылки утверждение не отменяет.\n\nt7Number и unionOpinionOn — реквизиты шапки Т-7: пишутся при утверждении и правятся на утверждённом графике. На утверждённом PATCH меняет только их, последняя запись выигрывает; прочие поля — 409 schedule_approved. Исключение — сохранённая пара сроков уже неверна (обратная или неполная, одной или обеих дат нет): тогда PATCH только с collectUntil и approveBy, без status, departments и реквизитов Т-7, исправляет её; итог обязан быть полной парой в верном порядке, изменённый срок не в прошлом, иначе 422 collection_deadlines_invalid. Статус, отметка утверждения и замороженные дни не меняются. Верная полная пара утверждённого по-прежнему не правится — 409 schedule_approved. Возврат в сбор их не сбрасывает.\n\nНовый срок сбора или утверждения раньше «сегодня» юрлица отклоняется — collection_deadlines_invalid с details.reason = past; проверяется только изменяемое поле, сохранённый прошедший срок правке не мешает. Порядок сроков и past действуют в draft, collecting и review, при утверждении и при исправлении неверной пары утверждённого.\n\nТребует права vacation_schedule · edit — по умолчанию оно у кадровика и администратора портала.\n\nПереход в сбор, возврат из согласования в сбор и утверждение ставят уведомления участникам в той же транзакции; отказ не создаёт уведомлений.\n\nexpectedRecipients — число адресатов рассылки о сборе, которое кадровик видел в окне (GET …/recipients); принимается только со status: \"collecting\". Число пересчитывается в той же транзакции тем же отбором, что рассылка; разошлось — 409 vacation_recipients_changed с details.recipients, перевода нет. Без поля — без сверки.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationSchedulePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "График",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationSchedule"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7f2c1a9e-3d54-4b81-9c06-2e5a8b7d1f43",
                    "year": 2027,
                    "status": "collecting",
                    "collectUntil": "2026-11-30",
                    "approvedAt": null,
                    "approvedBy": null,
                    "entries": 312,
                    "people": 168
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; номер документа Т-7 длиннее 32 символов — invalid_value с полем t7Number.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Переход не по порядку — bad_transition; утверждение без производственного календаря — calendar_required; на утверждённом графике правятся только t7Number и unionOpinionOn, сроки — только при уже неверной сохранённой паре — schedule_approved. Число адресатов изменилось с момента подтверждения — vacation_recipients_changed, новое число в details.recipients.",
            "x-error-codes": [
              "bad_transition",
              "calendar_required",
              "schedule_approved",
              "vacation_recipients_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Дата срока не разбирается — bad_date; сроки сбора не заданы, идут в обратном порядке или новый срок раньше «сегодня» юрлица — collection_deadlines_invalid с details.reason = missing | order | past; подразделение охвата недоступно или ID неверный — collection_scope_invalid с details.reason = unavailable | invalid; у кого-то нет части не меньше порога — short_parts; участники сбора без дат и без отметки «Не планировать» — without_dates; года нет ни в производственном календаре человека, ни (у регионального) в базовом — calendar_silent с details.year и details.calendar (id календаря, куда год загружать; null — календаря нет). У short_parts форма details — схема #/components/schemas/VacationShortPartsDetails: threshold — порог, people — кто не дотянул (только уровню all на строки графика), withoutDates — участники без дат. У without_dates форма details — схема #/components/schemas/VacationWithoutDatesDetails: total — сколько всего, people — первые 100 поимённо (только уровню all). expectedRecipients без перевода в сбор (status: \"collecting\") или меньше 0 — invalid_value с details.field = expectedRecipients.",
            "x-error-codes": [
              "bad_date",
              "collection_deadlines_invalid",
              "collection_scope_invalid",
              "short_parts",
              "without_dates",
              "calendar_silent",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/collection-options": {
      "get": {
        "operationId": "appVacationCollectionOptions",
        "tags": [
          "График отпусков"
        ],
        "summary": "Варианты охвата сбора графика",
        "description": "Каталог подразделений действующих людей юрлица графика и число уникальных участников при открытии формы. Список не сужается сохранённым охватом. Если сохранённый отдел стал недоступен, ответ остаётся 200 с unavailableScope и scopePeople=null, чтобы кадровик мог исправить выбор. Query departments здесь запрещён: частый предпросмотр выполняется только через /collection-options/preview. Требует vacation_schedule · edit, но не права на календарь или строки графика.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Варианты охвата и сохранённый выбор",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationCollectionOptions"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 10,
                        "name": "Отдел разработки",
                        "people": 12
                      }
                    ],
                    "savedScope": [
                      10
                    ],
                    "unavailableScope": [],
                    "previewScope": [
                      10
                    ],
                    "allPeople": 42,
                    "scopePeople": 12
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика в этом портале нет — not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Query departments передан на ручку каталога — collection_scope_invalid с details.reason = invalid.",
            "x-error-codes": [
              "collection_scope_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/collection-options/preview": {
      "get": {
        "operationId": "appVacationCollectionPreview",
        "tags": [
          "График отпусков"
        ],
        "summary": "Предпросмотр числа людей выбранного охвата",
        "description": "Лёгкий предпросмотр без каталога подразделений и без записи. Пустое departments означает всё юрлицо. Точные ID проходят проверку доступности в юрлице графика. Требует vacation_schedule · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "departments",
            "in": "query",
            "required": true,
            "description": "Пусто — всё юрлицо; иначе ID подразделений через запятую.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Охват и число уникальных людей",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationCollectionPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "previewScope": [
                      10
                    ],
                    "scopePeople": 12
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика в этом портале нет — not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Не передан departments либо указан неверный или недоступный ID — collection_scope_invalid с details.reason = invalid | unavailable.",
            "x-error-codes": [
              "collection_scope_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/recipients": {
      "get": {
        "operationId": "appVacationRecipients",
        "tags": [
          "График отпусков"
        ],
        "summary": "Число адресатов рассылки о сборе",
        "description": "Сколько сотрудников получат уведомление в Битрикс24, если перевести график в сбор дат сейчас: окно перед каждым объявлением сбора. Считается тем же отбором, что рассылка: в число входят только адресаты с учётной записью Битрикс24; ноль допустим.\n\nkind — какая рассылка уйдёт: collection_open — объявление сбора из черновика (участникам охвата, кроме отмеченных «Не планировать в этом году»); reopened — повторное открытие: с согласования — участникам без дат, с утверждённого графика — владельцам строк. from — исходное состояние графика. У графика в сборе рассылки нет — 409 vacation_no_announcement.\n\ndepartments — предложенный охват формы объявления, только у черновика: один параметр, ID подразделений через запятую; пустое значение — всё юрлицо; без параметра — сохранённый охват графика. Число подтверждают при переводе полем expectedRecipients (PATCH /api/v1/vacation-schedules/{id} со status: \"collecting\" или POST /api/v1/vacation-schedules/{id}/reopen): разошлось — 409 vacation_recipients_changed с новым числом.\n\nТребует права vacation_schedule · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "departments",
            "in": "query",
            "required": false,
            "description": "Только у черновика. Пусто — всё юрлицо; иначе ID подразделений через запятую. Без параметра — сохранённый охват.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Вид рассылки, исходное состояние и число адресатов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationRecipients"
                    }
                  }
                },
                "example": {
                  "data": {
                    "kind": "collection_open",
                    "from": "draft",
                    "recipients": 12
                  }
                }
              }
            }
          },
          "400": {
            "description": "departments передан не у черновика — bad_request: охват меняют только при объявлении сбора.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика в этом портале нет — not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "У графика в этом состоянии нет рассылки о сборе (сбор уже идёт) — vacation_no_announcement.",
            "x-error-codes": [
              "vacation_no_announcement"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "departments повторён, указан неверный или недоступный ID — collection_scope_invalid с details.reason = invalid | unavailable.",
            "x-error-codes": [
              "collection_scope_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/reopen": {
      "post": {
        "operationId": "appVacationScheduleReopen",
        "tags": [
          "График отпусков"
        ],
        "summary": "Вернуть утверждённый график в сбор дат",
        "description": "Возвращает утверждённый график в сбор дат и размораживает дни отпуска во всех строках. Части, согласованные утверждением, получают прежние статусы и причины, если решение по части с тех пор не менялось. Требует сохранённых сроков сбора и утверждения с порядком сбор не позже утверждения. При отказе статус, отметка утверждения и замороженные дни не меняются.\n\nОтдельная ручка, а не переход в общей ленте состояний: после неё дни отпуска снова посчитает текущий производственный календарь.\n\nУведомления о начале отпуска (ст. 123 ТК) у графика в сборе продолжают уходить тем, у кого даты те же, что при этом утверждении; кому даты поменяют — уйдут при повторном утверждении, возможно позже срока закона (решение владелицы 03.10.2026, №17).\n\nТребует права vacation_schedule · edit.\n\nУспешный возврат ставит уведомление участникам в той же транзакции; отправитель — выполнивший действие пользователь.\n\nТело необязательное: {\"expectedRecipients\": N} — число адресатов повторного открытия, которое кадровик видел в окне (GET …/recipients). Разошлось с пересчётом — 409 vacation_recipients_changed с details.recipients, возврата нет. Пустое тело — возврат без сверки, как раньше. Непустое тело теперь разбирается: если это не JSON-объект или expectedRecipients в нём не целое число (например, тело формы, массив или строка \"5\"), ответ — 400 bad_request, и график не меняется. Раньше ручка тело не читала. expectedRecipients меньше 0 — 422 invalid_value с details.field = expectedRecipients.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationReopenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "График",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationSchedule"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7f2c1a9e-3d54-4b81-9c06-2e5a8b7d1f43",
                    "year": 2027,
                    "status": "collecting",
                    "collectUntil": "2026-11-30",
                    "approvedAt": null,
                    "approvedBy": null,
                    "entries": 312,
                    "people": 168
                  }
                }
              }
            }
          },
          "400": {
            "description": "Непустое тело не разбирается: не JSON-объект или expectedRecipients не целое число — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График не утверждён — возвращать нечего, код not_approved. Число адресатов изменилось с момента подтверждения — vacation_recipients_changed, новое число в details.recipients.",
            "x-error-codes": [
              "not_approved",
              "vacation_recipients_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Сроков нет или порядок обратный — collection_deadlines_invalid, details.reason = missing | order. expectedRecipients меньше 0 — invalid_value с details.field = expectedRecipients.",
            "x-error-codes": [
              "collection_deadlines_invalid",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries": {
      "get": {
        "operationId": "appVacationEntries",
        "tags": [
          "График отпусков"
        ],
        "summary": "Строки графика",
        "description": "Страница людей сетки графика: все строки людей страницы, их нормы и пересечения. Люди — область графика (у кого в нём есть строки, видимые смотрящему; членство в юрлице на сегодня не сужает — прошлогодний график показывает уволенных), по 500 на страницу в порядке первого отдела (минимальный путь непропавших), фамилии и имени; люди без отдела — последними. Набор периодов человека приходит целиком на одной странице. Следующая страница — курсором nextCursor. Отдел строки — первый отдел человека, от фильтра не зависит. Сужение уровнем: сотрудник видит свои строки, руководитель — свой отдел, кадровик — весь портал. Нормы людей страницы — только при праве просмотра норм (vacation_norm · view), без него полей norms и normDefault нет. Пересечения — пары, где хотя бы один человек этой страницы; ниже уровня «отдел» пусто. У каждой строки — признак clashing (есть ли пара, по всем парам). С фильтром user — карточка человека person под правом просмотра строк. С фильтром user, равным самому смотрящему, и только из кабинета — отметки чужих правок его периодов changes (подтверждаются POST …/changes/seen).\n\nТребует права vacation_schedule_entry · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Курсор страницы людей из nextCursor прошлого ответа. Не прислан — первая страница. Неразборчивый курсор и курсор, ни на кого в портале не указывающий, — 400 bad_request.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "description": "public_id человека: показать только его периоды; или ссылка b24-<номер в Битрикс24> участника, не входившего в сервис, — строк у него нет, ответ несёт только карточку person. Адрес public_id, которого в портале нет, который не разбирается или ведёт к человеку вне уровня смотрящего, отвечает одинаково — пустым списком без person, а не отказом: фильтр никого не нашёл, и ответ не подтверждает, что такой человек есть. Ссылка b24- на человека вне области просмотра или не участника сбора — 404 not_found.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "description": "id подразделения Битрикс24 — люди его поддерева (человек из двух отделов поддерева — один раз); none — люди без подразделения. Сужение ПОВЕРХ уровня: тот, кому видно свой отдел, чужой этим фильтром не откроет. Неразборчивое значение — 422 bad_department.",
            "schema": {
              "type": "string",
              "pattern": "^([1-9][0-9]*|none)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Строки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationEntriesPage"
                    }
                  }
                },
                "example": {
                  "data": {
                    "entries": [
                      {
                        "id": "a1b2c3d4-5e6f-4708-91a2-b3c4d5e6f708",
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "userName": "Одинцова Мария Павловна",
                        "author": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "authorName": "Одинцова Мария Павловна",
                        "startsOn": "2027-07-01",
                        "endsOn": "2027-07-14",
                        "days": 14,
                        "vacationDays": null,
                        "status": "planned",
                        "department": {
                          "id": 12,
                          "name": "Отдел продаж"
                        },
                        "reviewReason": null,
                        "reviewedByName": null,
                        "reviewedAt": null,
                        "mayReview": false
                      }
                    ],
                    "nextCursor": "eyJwIjoiMGYzYTkxYzQtN2QyYi00ZTU4LTlhMTAtNmM1ZDhlMmY0MWI3In0",
                    "people": 1240,
                    "norms": [
                      {
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "days": 31,
                        "note": null
                      }
                    ],
                    "normDefault": 28,
                    "conflicts": [],
                    "conflictsTotal": 0,
                    "conflictsTruncated": false,
                    "longPart": 14,
                    "shortParts": [],
                    "awaitingEntries": [],
                    "changes": [
                      {
                        "kind": "changed",
                        "entry": "a1b2c3d4-5e6f-4708-91a2-b3c4d5e6f708",
                        "event": "1843",
                        "wasStartsOn": "2027-06-17",
                        "wasEndsOn": "2027-06-30",
                        "wasMovedTo": null,
                        "startsOn": "2027-07-01",
                        "endsOn": "2027-07-14",
                        "movedTo": null,
                        "byName": "Кадрова Ирина",
                        "at": "2027-03-02T09:15:00Z",
                        "originByName": null,
                        "originAt": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор не разобрался или ни на кого в портале не указывает — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет; человек ссылки b24- в фильтре user вне области просмотра строк или не участник сбора — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Подразделение не разбирается — код bad_department.",
            "x-error-codes": [
              "bad_department"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{userId}": {
      "put": {
        "operationId": "appReplaceVacationEntries",
        "tags": [
          "График отпусков"
        ],
        "summary": "Заменить периоды человека целиком",
        "description": "Весь набор периодов одного человека целиком. Требует vacation_schedule_entry · edit в области человека. Неизменённый период сохраняет согласование; изменённый приходит planned, если agree не запрошен фактическим согласующим. Изменение или удаление владельцем agreed требует confirmUnagree. Неизменённый returned владельца снова становится planned. agree согласует в той же транзакции и требует права фактического согласующего. Правка чужих дат уведомляет владельца: было → стало. Ответ под уровнем просмотра, как GET.\n\nВместо public_id принимается ссылка b24-<номер в Битрикс24> на участника сбора, не входившего в сервис (поле b24User готовности, поиска и списка участников): первая запись заводит ему строку человека из снимка. По ссылке пишут уровень all — за любого участника — и dept — за участника, чей отдел по снимку в поддереве пишущего; уровень own и человек вне области получают 404 not_found, неучастник сбора — 404 not_participant. Ссылку b24- принимает только запрос из кабинета: ключ API людей не заводит и получает 403 forbidden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "public_id человека, чьи периоды заменяются, или b24-<номер в Битрикс24> участника, не входившего в сервис.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationEntriesReplaceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Периоды человека после замены — урезанные уровнем ПРОСМОТРА смотрящего, как у чтения сетки: при правке шире просмотра набор может прийти пустым.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationEntriesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "entries": [
                      {
                        "id": "a1b2c3d4-5e6f-4708-91a2-b3c4d5e6f708",
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "userName": "Одинцова Мария Павловна",
                        "author": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "authorName": "Одинцова Мария Павловна",
                        "startsOn": "2027-07-01",
                        "endsOn": "2027-07-14",
                        "days": 14,
                        "vacationDays": null,
                        "status": "planned",
                        "reviewReason": null,
                        "reviewedByName": null,
                        "reviewedAt": null,
                        "mayReview": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationReplaceForbidden"
          },
          "404": {
            "description": "Графика или человека с таким id в этом портале нет, человек вне уровня пишущего — код not_found; человек ссылки b24- не участник сбора графика (не в снимке, выключен, в архиве, в другом юрлице или вне охвата) — not_participant.",
            "x-error-codes": [
              "not_found",
              "not_participant"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График утверждён — schedule_approved; строки правятся только в сборе и согласовании — not_collecting; человек не состоит в юрлице графика — not_in_entity. vacation_unagree_confirm: details.entries — адреса согласованных периодов, снятие которых требует подтверждения.",
            "x-error-codes": [
              "schedule_approved",
              "not_collecting",
              "not_in_entity",
              "vacation_unagree_confirm"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Дата не разбирается — bad_date; конец раньше начала — end_before_start; даты вне года графика — dates_outside_year; периоды одного человека перекрываются — self_overlap. vacation_unagree_confirm: details.entries — адреса согласованных периодов, снятие которых требует подтверждения.",
            "x-error-codes": [
              "bad_date",
              "end_before_start",
              "dates_outside_year",
              "self_overlap"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{entryId}": {
      "patch": {
        "operationId": "appPatchVacationEntry",
        "tags": [
          "График отпусков"
        ],
        "summary": "Принять решение по периоду отпуска",
        "description": "Согласовать planned/returned (agreed), вернуть planned на правку с причиной (returned) или снять согласование agreed (planned). Требует vacation_schedule_entry · edit и права фактического согласующего: первый руководитель вверх по оргструктуре, кроме самого владельца; кадровик с уровнем all правки может решить по любому, кроме себя. Невидимая строка — 404. Возврат уведомляет владельца с причиной. Ответ под уровнем просмотра, как GET.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "description": "public_id строки графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationEntryPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Строка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationEntry"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "a1b2c3d4-5e6f-4708-91a2-b3c4d5e6f708",
                    "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                    "userName": "Одинцова Мария Павловна",
                    "author": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                    "authorName": "Одинцова Мария Павловна",
                    "startsOn": "2027-07-01",
                    "endsOn": "2027-07-14",
                    "days": 14,
                    "vacationDays": null,
                    "status": "planned",
                    "reviewReason": null,
                    "reviewedByName": null,
                    "reviewedAt": null,
                    "mayReview": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationReviewForbidden"
          },
          "404": {
            "description": "Графика или строки с таким id в этом портале нет — код not_found. Тот же код, когда состояние записано, но строка вне уровня ПРОСМОТРА смотрящего (правка шире просмотра): ответ записи не отдаёт строку, которую чтение скрыло бы.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График утверждён, строки заморожены — код schedule_approved. vacation_review_state: решение не подходит состоянию; vacation_reason_required: details.max=500.",
            "x-error-codes": [
              "schedule_approved",
              "vacation_review_state"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Неизвестное состояние строки — код bad_status. vacation_review_state: решение не подходит состоянию; vacation_reason_required: details.max=500.",
            "x-error-codes": [
              "bad_status",
              "vacation_reason_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/departments": {
      "get": {
        "operationId": "appVacationDepartments",
        "tags": [
          "График отпусков"
        ],
        "summary": "Подразделения, представленные в графике",
        "description": "Дерево подразделений области графика: только отделы людей, у которых в графике есть строки, видимые смотрящему; предок без таких людей не показывается — руководитель одного отдела не увидит названий чужих. people узла — люди области в его поддереве (человек из двух отделов поддерева — один раз), и оно равно people ответа entries с этим узлом в department. noDepartment — люди без подразделения (department=none).\n\nТребует права vacation_schedule_entry · view. VacationDepartmentTree: noHead=true и approverName=null означают кадровика; иначе имя ближайшего согласующего по дереву.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Подразделения",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationDepartmentTree"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 10,
                        "parent": null,
                        "path": "/10/",
                        "name": "Отдел разработки",
                        "people": 14,
                        "noHead": true,
                        "approverName": null
                      },
                      {
                        "id": 12,
                        "parent": 10,
                        "path": "/10/12/",
                        "name": "Группа платформы",
                        "people": 5,
                        "noHead": true,
                        "approverName": null
                      }
                    ],
                    "noDepartment": 380
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/people": {
      "get": {
        "operationId": "appVacationPeople",
        "tags": [
          "График отпусков"
        ],
        "summary": "Поиск человека в графике",
        "description": "Люди графика, чьё имя или «Фамилия Имя» начинается с набранного, двумя частями. Первая — люди со строками в графике, видимыми смотрящему; уволенные и архивные со строками — тоже, как в сетке. Вторая — участники сбора без дат в области смотрящего: на уровне all — все участники, на уровне dept — участники, чей отдел по снимку в поддереве смотрящего, на уровне own — только сам смотрящий. Чужое имя без дат ниже уровня all не находится. Не справочник портала: человек, не участвующий в сборе и без строк, не находится. Найденный адрес сужает сетку параметром user ручки entries. Участник, не входивший в сервис, приходит с user null и номером b24User: даты ему вносят по ссылке b24-<b24User>. Не больше 20 человек, по фамилии, имени и адресу.\n\nЛомающее изменение (ADR-vacation-hr-cycle): user стал nullable, рядом добавлен b24User.\n\nТребует права vacation_schedule_entry · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Начало имени, фамилии или «Фамилия Имя». Пробелы по краям обрезаются; короче двух символов после обрезки — 400 bad_request. Регистр и ё/е не различаются; % и _ — буквы, а не джокеры.",
            "schema": {
              "type": "string",
              "minLength": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Найденные люди",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationPeopleResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "user": "0c5e9a3b-7d21-4f6e-a8b4-2e9f1c7d5a60",
                        "b24User": 118,
                        "name": "Орлова Мария"
                      },
                      {
                        "user": null,
                        "b24User": 481,
                        "name": "Орлов Пётр"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Запрос короче двух символов после обрезки пробелов — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/norms": {
      "get": {
        "operationId": "appVacationNorms",
        "tags": [
          "График отпусков"
        ],
        "summary": "Нормы людей на год графика",
        "description": "Норма ОДНОГО человека на год графика и умолчание портала (экран «Мой отпуск» и окно периодов). Параметр user обязателен: нормы юрлица целиком — неограниченная выдача; нормы людей страницы сетки приезжают в ответе entries. Условия на строки графика нет — норма человека, у которого строк ещё нет, приходит. Отсутствие строки значит «как в настройках портала», а не ноль.\n\nТребует права vacation_norm · view: свою норму видит человек, норму отдела — его руководитель.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "description": "public_id человека. Без него — 400 bad_request.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Нормы",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNormsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "norms": [
                      {
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "days": 35,
                        "note": "вредность, п. 3 коллективного договора"
                      }
                    ],
                    "default": 28
                  }
                }
              }
            }
          },
          "400": {
            "description": "Не передан параметр user — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found. Человека user в этом портале нет — тот же код.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/norms/{userId}": {
      "put": {
        "operationId": "appPutVacationNorm",
        "tags": [
          "График отпусков"
        ],
        "summary": "Поставить человеку норму",
        "description": "Год берётся из графика: работает кадровик всегда на его экране. Сама норма при этом привязана к ГОДУ, а не к графику, и его удаление переживает.\n\nСервис норму не выводит, а запоминает: стажа и отработанных периодов в нём нет. Требует права vacation_norm · edit — по умолчанию оно только у кадровика и администратора портала.\n\nВместо public_id принимается ссылка b24-<номер в Битрикс24> на участника сбора, не входившего в сервис (поле b24User готовности, поиска и списка участников): первая запись заводит ему строку человека из снимка. По ссылке, кроме права нормы, область задаёт уровень vacation_schedule_entry · edit: all — за любого участника — и dept — за участника, чей отдел по снимку в поддереве пишущего; уровень own и человек вне области получают 404 not_found, неучастник сбора — 404 not_participant. Ссылку b24- принимает только запрос из кабинета: ключ API людей не заводит и получает 403 forbidden.\n\nПримечание — не длиннее 255 символов: это строка «почему у человека другая норма», а не место для переписки.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "public_id человека или b24-<номер в Битрикс24> участника, не входившего в сервис.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationNormPutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Нормы после правки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNormsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "norms": [
                      {
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "days": 35,
                        "note": "вредность, п. 3 коллективного договора"
                      }
                    ],
                    "default": 28
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика или человека с таким id в этом портале нет, человек вне уровня пишущего — код not_found; человек ссылки b24- не участник сбора графика — not_participant.",
            "x-error-codes": [
              "not_found",
              "not_participant"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Норма вне допустимых пределов — bad_norm; примечание к норме длиннее 255 символов — bad_note.",
            "x-error-codes": [
              "bad_norm",
              "bad_note"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars": {
      "get": {
        "operationId": "appWorkCalendars",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Календари портала",
        "description": "Базовый федеральный и региональные: какие годы загружены и сколько подразделений привязано. Рядом — годы, которые есть в справочнике HR AI текущего релиза (`referenceYears`): только их сервис берёт из справочника сам и по ручке `refresh`.\n\nТребует права work_calendar · view.",
        "responses": {
          "200": {
            "description": "Календари",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "calendars": [
                      {
                        "id": "9c1f2a7e-4b83-4d21-91c5-0a7e3f6b8d42",
                        "name": "Российская Федерация",
                        "isDefault": true,
                        "years": [
                          2027,
                          2026
                        ],
                        "departmentCount": 0,
                        "driftYears": [],
                        "proposalYears": []
                      },
                      {
                        "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                        "name": "Республика Татарстан",
                        "isDefault": false,
                        "years": [
                          2026
                        ],
                        "departmentCount": 3,
                        "driftYears": [],
                        "proposalYears": []
                      }
                    ],
                    "referenceYears": [
                      2025,
                      2026,
                      2027
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateWorkCalendar",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Завести календарь",
        "description": "Региональный календарь заводится копией существующего: copyFrom переносит годы и дни, но не привязки подразделений — у подразделения ровно один календарь.\n\nТребует права work_calendar · edit. По умолчанию оно есть только у администратора портала: ошибка в календаре тихо искажает каждый расчёт дней во всех вертикалях сразу.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Заведённый календарь",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendar"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "name": "Республика Татарстан",
                    "isDefault": false,
                    "years": [
                      2026
                    ],
                    "departmentCount": 3,
                    "driftYears": [],
                    "proposalYears": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "Календарь с таким именем на портале уже есть — код name_taken; календарей на портале уже 200 — too_many_calendars.",
            "x-error-codes": [
              "name_taken",
              "too_many_calendars"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Имя пустое, с пробелом по краю или двойным внутри — код bad_name; имя длиннее 255 знаков — код too_long (details.field — имя поля, details.max — предел).",
            "x-error-codes": [
              "bad_name",
              "too_long"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}": {
      "get": {
        "operationId": "appWorkCalendar",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Карточка календаря",
        "description": "Один календарь портала.\n\nТребует права work_calendar · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Календарь",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendar"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9c1f2a7e-4b83-4d21-91c5-0a7e3f6b8d42",
                    "name": "Российская Федерация",
                    "isDefault": true,
                    "years": [
                      2027,
                      2026
                    ],
                    "departmentCount": 0,
                    "driftYears": [],
                    "proposalYears": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appPatchWorkCalendar",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Имя и пометка базового",
        "description": "Пометка базового переносится: прежний базовый перестаёт им быть в той же транзакции.\n\nТребует права work_calendar · edit. По умолчанию оно есть только у администратора портала: ошибка в календаре тихо искажает каждый расчёт дней во всех вертикалях сразу.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Календарь",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendar"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "name": "Республика Татарстан",
                    "isDefault": false,
                    "years": [
                      2026
                    ],
                    "departmentCount": 3,
                    "driftYears": [],
                    "proposalYears": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Календарь с таким именем уже есть — код name_taken.",
            "x-error-codes": [
              "name_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Имя не прошло проверку — код bad_name; имя длиннее 255 знаков — код too_long (details.field, details.max).",
            "x-error-codes": [
              "bad_name",
              "too_long"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/import/preview": {
      "post": {
        "operationId": "appPreviewWorkCalendarImport",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Предпросмотр загрузки года файлом",
        "description": "Файл разбирается на сервере теми же проверками, что и запись года. Формат узнаётся по содержимому: xlsx по шаблону, CSV по шаблону (UTF-8 или Windows-1251, разделитель «;» или «,»), JSON {source, days} — годы по датам дней. XML не принимается — код file_unreadable. Таблица: первая непустая строка — заголовок со столбцами «Дата», «Вид дня», «Название» в любом порядке; дата — ДД.ММ.ГГГГ, ГГГГ-ММ-ДД или числовая ячейка даты xlsx; вид — «праздник», «перенесённый выходной», «рабочий день», «сокращённый день» или коды holiday, rest, work, short.\n\nНичего не пишет. Для загрузки файл присылается заново вместе с version из этого ответа (expect).\n\nПределы: файл — 1 МиБ, лет — 10, строк данных — 4000.\n\nТребует права work_calendar · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarImportPreviewForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Годы файла против загруженных",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarImportPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "format": "xlsx",
                    "rowProblems": [],
                    "years": [
                      {
                        "year": 2027,
                        "status": "replace",
                        "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                        "days": 24,
                        "changes": [
                          {
                            "date": "2027-08-30",
                            "was": null,
                            "becomes": "holiday",
                            "titleWas": null,
                            "titleBecomes": "День республики"
                          }
                        ],
                        "problems": [],
                        "blocked": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не multipart/form-data или нет части file — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Файл больше 1 МиБ — код file_too_large, details.max — предел в байтах.",
            "x-error-codes": [
              "file_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Файл не узнан, не разобран или без колонок «Дата» и «Вид дня» — код file_unreadable, details.reason — format или header; лет больше 10 — too_many_years; строк данных больше 4000 — too_many_rows.",
            "x-error-codes": [
              "file_unreadable",
              "too_many_years",
              "too_many_rows"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/import": {
      "post": {
        "operationId": "appImportWorkCalendar",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Загрузить годы файлом",
        "description": "Выбранные годы файла записываются одной транзакцией: все или ни одного. Файл присылается заново вместе с years и expect — version каждого выбранного года из предпросмотра (null — года не было). Каждый год проверяется заново, как в предпросмотре. Год изменился после предпросмотра — 409 year_changed; у года ждёт решения расхождение справочника — 409 drift_pending: загрузка файлом его не отклоняет.\n\nИсточник года — имя файла (у JSON — его source), версии справочника нет, автор — тот, кто загрузил. Год базового календаря, изменённый файлом, даёт регионам предложение применить изменение.\n\nТребует права work_calendar · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarImportForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Записанные годы и их новые version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarImportResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "years": [
                      {
                        "year": 2027,
                        "version": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не multipart/form-data, нет части file или years не непустой список годов — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Год записали после предпросмотра — код year_changed; у года ждёт решения расхождение справочника — drift_pending. Ничего не записано.",
            "x-error-codes": [
              "year_changed",
              "drift_pending"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Файл больше 1 МиБ — код file_too_large, details.max — предел в байтах.",
            "x-error-codes": [
              "file_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Файл не узнан или не разобран — file_unreadable (details.reason); лет больше 10 — too_many_years; строк больше 4000 — too_many_rows; в файле есть строки без года — bad_date; выбранного года нет в файле — year_not_in_file (details.year); у выбранного года проблема — её код: bad_kind, duplicate_date, too_long, bad_year, year_degenerate (details.year, details.row, details.date); у выбранного года нет expect или он не разбирается — bad_expect; имя файла занято справочником — reserved_source. Ничего не записано.",
            "x-error-codes": [
              "file_unreadable",
              "too_many_years",
              "too_many_rows",
              "bad_date",
              "year_not_in_file",
              "bad_kind",
              "duplicate_date",
              "too_long",
              "bad_year",
              "year_degenerate",
              "bad_expect",
              "reserved_source"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}": {
      "get": {
        "operationId": "appWorkCalendarYear",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Дни года и норма по месяцам",
        "description": "Дни-исключения года и норма рабочего времени по месяцам. Норма считается из тех же дней, а не хранится рядом с ними.\n\nТребует права work_calendar · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год, четыре цифры.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Год",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarYearResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "reference",
                    "sourceVersion": "r-3f9c2a71b04e8d56",
                    "loadedAt": "2026-09-16T08:41:12Z",
                    "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-07",
                        "kind": "holiday",
                        "title": "Рождество Христово"
                      },
                      {
                        "date": "2026-04-30",
                        "kind": "short",
                        "title": null
                      },
                      {
                        "date": "2026-05-04",
                        "kind": "rest",
                        "title": null
                      },
                      {
                        "date": "2026-11-07",
                        "kind": "work",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 16,
                        "hours": 128
                      },
                      {
                        "month": 2,
                        "workingDays": 19,
                        "hours": 151
                      }
                    ],
                    "drift": null,
                    "proposal": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Год не загружен — код year_not_loaded; год вне пределов — bad_year.",
            "x-error-codes": [
              "year_not_loaded",
              "bad_year"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appPutWorkCalendarYear",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Загрузить год целиком",
        "description": "Дни года приезжают одним списком и заменяют прежние целиком. Добавления по одному дню нет намеренно: половина года, заменённая тихо, не отличима от целого.\n\nТребует права work_calendar · edit. По умолчанию оно есть только у администратора портала: ошибка в календаре тихо искажает каждый расчёт дней во всех вертикалях сразу.\n\nЗапись со сверкой: поле expect несёт version года, который клиент показывал (null — года не было). Год с тех пор записали — 409 year_changed; у года ждёт решения расхождение справочника — 409 drift_pending: запись молча ответила бы на него. В обоих случаях ничего не пишется. Без expect запись безусловная, как раньше.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год, четыре цифры.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarYearRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Загруженный год",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarYearResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "ручная загрузка",
                    "sourceVersion": null,
                    "loadedAt": "2026-09-16T08:41:12Z",
                    "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-07",
                        "kind": "holiday",
                        "title": "Рождество Христово"
                      },
                      {
                        "date": "2026-04-30",
                        "kind": "short",
                        "title": null
                      },
                      {
                        "date": "2026-05-04",
                        "kind": "rest",
                        "title": null
                      },
                      {
                        "date": "2026-11-07",
                        "kind": "work",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 16,
                        "hours": 128
                      },
                      {
                        "month": 2,
                        "workingDays": 19,
                        "hours": 151
                      }
                    ],
                    "drift": null,
                    "proposal": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Запись со сверкой (expect): год записали после чтения — код year_changed; у года ждёт решения расхождение справочника — drift_pending. Ничего не записано.",
            "x-error-codes": [
              "year_changed",
              "drift_pending"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "День не того года — day_outside_year; две записи на одну дату — duplicate_date; неизвестный вид дня — bad_kind; год вне пределов — bad_year; дата не разбирается — bad_date. Файл проверяется как автозагрузка: меньше 12 нерабочих праздничных или рабочее 1 января — код year_degenerate. Имя справочника reference и прежние служебные метки заняты сервисом — код reserved_source. Источник, версия или название дня длиннее предела — код too_long: details.field — source, sourceVersion или days.title, details.max — предел в знаках. expect, который не разбирается как version года, — код bad_expect.",
            "x-error-codes": [
              "day_outside_year",
              "duplicate_date",
              "bad_kind",
              "bad_year",
              "bad_date",
              "year_degenerate",
              "reserved_source",
              "too_long",
              "bad_expect"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/departments": {
      "put": {
        "operationId": "appPutWorkCalendarDepartments",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Привязать подразделения",
        "description": "Список подразделений заменяется целиком. У подразделения ровно один календарь: попытка привязать чужое отвечает отказом, а не переносом.\n\nПривязка действует на поддерево: дочерние подразделения, в том числе заведённые в Битрикс24 позже, считаются по этому календарю, пока у них нет своей привязки. Своя привязка дочернего важнее привязки предка — привязка к базовому выводит подразделение из регионального родителя. Привязка подразделения, пропавшего из Битрикс24, в расчёте не участвует ни для него, ни для его потомков.\n\nТребует права work_calendar · edit. По умолчанию оно есть только у администратора портала: ошибка в календаре тихо искажает каждый расчёт дней во всех вертикалях сразу.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarDepartmentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Привязки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarDepartmentsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      12,
                      17,
                      34
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается или подразделений больше 1000 (workcalendar.MaxCalendarDepartments) — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Подразделение уже привязано к другому календарю — код department_taken.",
            "x-error-codes": [
              "department_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Среди подразделений есть id, которого нет в оргструктуре портала, — код bad_department. Привязки при этом не тронуты.",
            "x-error-codes": [
              "bad_department"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendar/resolve": {
      "get": {
        "operationId": "appResolveWorkCalendar",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Рабочий ли день и сколько их в периоде",
        "description": "Единственная ручка, которой пользуются другие вертикали: отпуска, командировки, табель.\n\nКалендарь выбирается на сервере одним из трёх способов: calendar — прямо, user — через подразделения человека, ничего не названо — календарь того, кто спрашивает. Подразделение считается по календарю ближайшего привязанного подразделения на пути от него к корню, включая его самого; подразделения, пропавшие из Битрикс24, в этом не участвуют. Если подразделения человека дают два разных календаря — берётся базовый. Правило выбора живёт здесь и нигде больше, иначе график отпусков и табель посчитали бы одному человеку разные дни.\n\nКаждый год периода считается по календарю. У небазового (регионального) календаря года нет, а в базовом есть — год считается по базовому, без региональных праздников: такие годы перечислены в fallbackYears, базовый календарь — в fallbackCalendar. Подмена — свойство расчёта, она действует и при явном calendar. Интеграция, которой важны региональные праздники, обязана читать fallbackYears. Период через границу года считается по годам независимо; day одного дня — по тому календарю, по которому посчитан его год.\n\nГода нет ни в календаре, ни (у регионального) в базовом — отказ year_not_loaded, а НЕ расчёт по правилу «понедельник—пятница»: тихая догадка воспроизводит ровно тот дефект, ради которого календарь и заводился. details.year — первый такой год периода, details.calendar — id календаря, куда год загружать: базовый, если он есть, иначе сам календарь.\n\nТребует права work_calendar · view.",
        "parameters": [
          {
            "name": "calendar",
            "in": "query",
            "required": false,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "description": "public_id человека портала: календарь берётся по его подразделению.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Один день, YYYY-MM-DD.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Начало периода, YYYY-MM-DD.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Конец периода включительно.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Расчёт",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarResolveResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "calendar": {
                      "id": "9c1f2a7e-4b83-4d21-91c5-0a7e3f6b8d42",
                      "name": "Российская Федерация",
                      "isDefault": true,
                      "years": [
                        2027,
                        2026
                      ],
                      "departmentCount": 0
                    },
                    "from": "2026-01-01",
                    "to": "2026-01-14",
                    "calendarDays": 14,
                    "workingDays": 4,
                    "holidayDays": 8,
                    "shortDays": 0,
                    "hours": 32,
                    "nonWorking": [
                      {
                        "date": "2026-01-01",
                        "working": false,
                        "short": false,
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-10",
                        "working": false,
                        "short": false,
                        "kind": null,
                        "title": null
                      }
                    ],
                    "day": null,
                    "fallbackYears": [],
                    "fallbackCalendar": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Не названы ни дата, ни период — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Календаря или человека с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Года нет ни в календаре, ни (у регионального) в базовом — year_not_loaded, с details.year (первый такой год) и details.calendar (id календаря, куда год загружать; null — календаря нет); дата не разбирается — bad_date; конец периода раньше начала — bad_period; базового календаря нет — no_default_calendar (сбой: сервис заводит календарь «Россия» сам).",
            "x-error-codes": [
              "year_not_loaded",
              "bad_date",
              "bad_period",
              "no_default_calendar"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendar/departments": {
      "get": {
        "operationId": "appWorkCalendarPortalDepartments",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Подразделения портала и их календари",
        "description": "Все подразделения портала вместе с тем, к какому календарю каждое уже привязано.\n\nСвоя ручка, а не справочник отделов из прав: тот закрыт правом на матрицу прав, и экран календаря пропал бы ровно у администратора портала, которому он выдан.\n\nЗанятость возвращается СРАЗУ: у подразделения ровно один календарь, и показать это до нажатия дешевле, чем объяснять отказ после.\n\nТребует права work_calendar · edit: дерево нужно тому, кто привязывает подразделения к календарю; с одним просмотром — 403 forbidden (ADR 2026-10-02-derevo-otdelov-kalendarya-pravyashchemu).",
        "responses": {
          "200": {
            "description": "Подразделения портала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarPortalDepartmentsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 10,
                        "name": "Отдел разработки",
                        "path": "/10/",
                        "calendar": "",
                        "calendarName": ""
                      },
                      {
                        "id": 11,
                        "name": "Казанский филиал",
                        "path": "/10/11/",
                        "calendar": "e0f03160-e2d8-268f-5cae-f0c43e98a6e0",
                        "calendarName": "Республика Татарстан"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendar/import-template": {
      "get": {
        "operationId": "appWorkCalendarImportTemplate",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Скачать шаблон загрузки",
        "description": "Книга xlsx с одной строкой заголовка шаблона загрузки: «Дата», «Вид дня», «Название». Образец с днями даёт «Скачать год».\n\nТребует права work_calendar · view.",
        "responses": {
          "200": {
            "description": "Шаблон книгой Excel (xlsx), имя work-calendar-template.xlsx.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/readiness": {
      "get": {
        "operationId": "appVacationReadiness",
        "tags": [
          "График отпусков"
        ],
        "summary": "Готовность графика к утверждению",
        "description": "Те же числа, что покажет утверждение, но без утверждения: экран объясняет человеку, что мешает, до того как он нажмёт кнопку.\n\nМешает ровно одно — короткие части, статья 125: их число shortPartsCount приходит всем, кому открыт график, чтобы «мешает» видел каждый, а не только тот, кому положены имена. Остальное сведения: пересечения нормальны в большом отделе, а человек без дат может быть в декрете.\n\nДни считаются по календарю человека с наследованием по дереву подразделений. Года нет в региональном календаре, а в базовом есть — дни считаются по базовому, без региональных праздников, и отчёт говорит calendarFallback. Года нет и в базовом — отказ calendar_silent с details.year и details.calendar, а не счёт длиной периода.\n\nЧисла приходят всем, кому открыт график. Поимённые списки — nobody, shortParts, normDeviations — только тому, у кого vacation_schedule_entry · view стоит на уровне «весь портал»: они перечисляют людей ВСЕЙ организации, а сузить их до отдела нельзя, не разойдясь с числом рядом. Остальным те же поля приходят пустыми списками.\n\nТребует права vacation_schedule · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Готовность",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationReadiness"
                    }
                  }
                },
                "example": {
                  "data": {
                    "entries": 312,
                    "people": 168,
                    "participants": 172,
                    "excluded": 2,
                    "pendingParts": 12,
                    "pendingPeople": 9,
                    "waitingParts": 9,
                    "waitingPeople": 7,
                    "returnedParts": 3,
                    "returnedPeople": 3,
                    "withoutDates": 4,
                    "conflicts": 7,
                    "shortPartsCount": 1,
                    "normDeviationsCount": 1,
                    "shortParts": [
                      {
                        "user": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "longest": 6
                      }
                    ],
                    "normDeviations": [
                      {
                        "user": "1a2b3c4d-5e6f-4708-91a2-b3c4d5e6f709",
                        "norm": 28,
                        "planned": 14
                      }
                    ],
                    "nobody": [
                      {
                        "user": null,
                        "b24User": 481,
                        "userName": "Ершов Лев",
                        "secondYear": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Года нет ни в производственном календаре человека, ни (у регионального календаря) в базовом — код calendar_silent с details.year (год без календаря) и details.calendar (id календаря, куда год загружать: базовый, если он есть; null — календаря нет вовсе).",
            "x-error-codes": [
              "calendar_silent"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}/refresh": {
      "post": {
        "operationId": "appRefreshWorkCalendarYear",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Обновить год из справочника",
        "description": "Сервис берёт год из справочника HR AI — производственного календаря, встроенного в сервис и составленного по ТК и постановлениям Правительства о переносе выходных, — и принимает его, если год проходит проверки.\n\nСервис делает то же сам, по расписанию — текущий и следующий год; кнопка нужна, чтобы не ждать очередного обхода. Ручная загрузка года (PUT) остаётся и нужна там, где года в справочнике нет.\n\nЧетыре проверки приёма стоят до записи: года нет в справочнике, нерабочих праздничных меньше двенадцати, 1 января не нерабочее, расхождение с уже загруженным годом больше трёх дней. Не принятый год НЕ трогает прежний: молча обнулить календарь хуже, чем не обновиться.\n\nТребует права work_calendar · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Обновлённый год",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarYearResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "reference",
                    "sourceVersion": "r-3f9c2a71b04e8d56",
                    "loadedAt": "2026-09-16T08:41:12Z",
                    "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-07",
                        "kind": "holiday",
                        "title": "Рождество Христово"
                      },
                      {
                        "date": "2026-04-30",
                        "kind": "short",
                        "title": null
                      },
                      {
                        "date": "2026-05-04",
                        "kind": "rest",
                        "title": null
                      },
                      {
                        "date": "2026-11-07",
                        "kind": "work",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 16,
                        "hours": 128
                      },
                      {
                        "month": 2,
                        "workingDays": 19,
                        "hours": 151
                      }
                    ],
                    "drift": null,
                    "proposal": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Год слишком расходится с загруженным — код year_too_different. Не применён, но и не потерян: расхождение сохранено и ждёт решения (POST .../drift). Выпуск, отклонённый прежде, кнопка открывает заново — за обновлением стоит человек, и он явно просит показать выпуск снова.",
            "x-error-codes": [
              "year_too_different"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Года нет в справочнике HR AI — source_unreadable, его можно загрузить файлом; год не похож на производственный календарь и не принят — year_degenerate; год вне пределов — bad_year. Прежний год остаётся как был.",
            "x-error-codes": [
              "source_unreadable",
              "year_degenerate",
              "bad_year"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}/drift": {
      "post": {
        "operationId": "appDecideWorkCalendarDrift",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Решить, что делать с расхождением",
        "description": "Справочник принёс год, который расходится с загруженным больше чем на три дня, — он не применён и ждёт решения. Исходов ровно два: accept — принять пришедший год, reject — оставить свой.\n\nПринятый год применяется ИЗ СОХРАНЁННОГО, а не забирается из справочника заново: между показом и нажатием проходят дни, и справочник за это время может исправить год — «принять» применило бы не то, что человек видел.\n\nОтклонённый выпуск справочника заново не спрашивается: фоновое обновление не поднимет вопрос, если версия та же или дни пришедшего года совпадают с отклонёнными (другая версия при тех же днях — смена названия или источника). Справочник исправил дни — вопрос задаётся снова, потому что это уже другой год.\n\nТребует права work_calendar · edit: оба исхода меняют календарь — reject закрепляет нынешние дни против следующего обновления.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarDriftDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Год после решения: после accept он другой, после reject тот же, но расхождения в нём больше нет.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarYearResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "reference",
                    "sourceVersion": "r-3f9c2a71b04e8d56",
                    "loadedAt": "2026-09-16T08:41:12Z",
                    "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-07",
                        "kind": "holiday",
                        "title": "Рождество Христово"
                      },
                      {
                        "date": "2026-04-30",
                        "kind": "short",
                        "title": null
                      },
                      {
                        "date": "2026-05-04",
                        "kind": "rest",
                        "title": null
                      },
                      {
                        "date": "2026-11-07",
                        "kind": "work",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 16,
                        "hours": 128
                      },
                      {
                        "month": 2,
                        "workingDays": 19,
                        "hours": 151
                      }
                    ],
                    "drift": null,
                    "proposal": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Расхождения, ждущего решения, нет — код no_drift; этот выпуск справочника уже отклонён — drift_rejected.",
            "x-error-codes": [
              "no_drift",
              "drift_rejected"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Решение бывает только accept или reject — код bad_decision; год вне пределов — bad_year. Сохранённый год проверяется так же, как загрузка: день другого года — код day_outside_year, две записи на одну дату — код duplicate_date, неизвестный вид дня — код bad_kind; такой год не применяется. Название дня в сохранённом году длиннее предела — код too_long (details.field = days.title).",
            "x-error-codes": [
              "bad_decision",
              "bad_year",
              "day_outside_year",
              "duplicate_date",
              "bad_kind",
              "too_long"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}/proposal": {
      "post": {
        "operationId": "appDecideWorkCalendarProposal",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Решить, применить ли изменение базового",
        "description": "Год базового календаря записали с другим видом хотя бы одной даты, и регион получил предложение перенести эти даты. Исходов два: apply — применить даты предложения, reject — оставить свои. Решение одно на всё предложение; не нужна одна дата — примените и поправьте день.\n\nrevision обязателен: решение сверяется с показанной редакцией. Пока карточка открыта, второе изменение базового могло слить в предложение новые даты — тогда 409 proposal_changed, ничего не пишется и не снимается.\n\napply сверяет каждую дату: в регионе всё ещё was — ставится becomes; уже becomes — ничего; иное (регион правили после предложения) — дата не трогается и попадает в skipped. Год проверяется как ручная загрузка и записывается с источником manual от имени того, кто решил.\n\nТребует права work_calendar · edit.\n\nreject по году, которого в регионе уже нет (его удалили до решения), предложение снимает и отвечает 204 без тела: года для ответа нет.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarProposalDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Год региона после решения и даты, которые не тронуты",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarProposalDecisionResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "manual",
                    "sourceVersion": null,
                    "loadedAt": "2026-11-18T09:12:40Z",
                    "version": "7d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-05-11",
                        "kind": "rest",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 15,
                        "hours": 120
                      }
                    ],
                    "drift": null,
                    "proposal": null,
                    "skipped": [
                      "2026-11-03"
                    ]
                  }
                }
              }
            }
          },
          "204": {
            "description": "reject принят, а года в регионе уже нет — ответа с годом нет."
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Предложения нет — код no_proposal; редакция устарела — proposal_changed; календарь базовый — not_regional; у года региона ждёт решения расхождение справочника — drift_pending (apply молча ответил бы на него).",
            "x-error-codes": [
              "no_proposal",
              "proposal_changed",
              "not_regional",
              "drift_pending"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Решение бывает только apply или reject — код bad_decision; revision не разбирается — bad_request; год вне пределов — bad_year; года в регионе уже нет — year_not_loaded (reject при этом предложение снимает); год после применения не похож на производственный календарь — year_degenerate, предложение остаётся.",
            "x-error-codes": [
              "bad_decision",
              "bad_request",
              "bad_year",
              "year_not_loaded",
              "year_degenerate"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}/prepare": {
      "get": {
        "operationId": "appWorkCalendarPreparation",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Что предложит «Подготовить» год региона",
        "description": "Год есть в базовом календаре, а в регионе его нет. «Подготовить» записывает его копией года базового; здесь — что эта копия возьмёт и какие свои дни прошлого года регион может перенести: даты, где у региона есть исключение, а у базового того же года его нет или вид другой. Дата переносится на тот же день и месяц; 29 февраля в невисокосный год не предлагается; дата, где у базового нового года уже тот же вид, не предлагается.\n\nТолько чтение: запись пересчитывает кандидатов заново.\n\nТребует права work_calendar · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год, четыре цифры.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Базовый, его год и кандидаты переноса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarPreparation"
                    }
                  }
                },
                "example": {
                  "data": {
                    "base": {
                      "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                      "name": "Россия",
                      "source": "reference",
                      "sourceVersion": "r-3f9c2a71b04e8d56"
                    },
                    "carry": [
                      {
                        "date": "2027-08-30",
                        "from": "2026-08-30",
                        "kind": "holiday",
                        "title": "День республики"
                      }
                    ],
                    "compare": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Год в регионе уже загружен — код year_loaded; календарь базовый — not_regional.",
            "x-error-codes": [
              "year_loaded",
              "not_regional"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Года нет в базовом — код year_not_loaded, details.calendar — базовый, куда его загружать; базового нет — no_default_calendar; год вне пределов — bad_year.",
            "x-error-codes": [
              "year_not_loaded",
              "no_default_calendar",
              "bad_year"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appPrepareWorkCalendarYear",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Подготовить год региона копией базового",
        "description": "Записывает год региона копией года базового с выбранными днями прошлого года (выбранный заменяет исключение базового на ту же дату). Проверка «года в регионе нет» и запись — одной транзакцией: год появился между показом и нажатием — 409 year_loaded, ничего не пишется. Кандидаты пересчитываются при записи: дата не из них — 422 bad_carry. Год проверяется как ручная загрузка и записывается с источником copy от имени того, кто нажал.\n\nОтвет — записанный год, как у GET года: по нему экран открывает правку.\n\nТребует права work_calendar · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkCalendarPrepareRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Записанный год региона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WorkCalendarYearResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "year": 2026,
                    "source": "copy",
                    "sourceVersion": null,
                    "loadedAt": "2026-09-16T08:41:12Z",
                    "version": "0b6f3a4e-9c1d-4f2a-8e7b-5c3d1a2f4e6b",
                    "days": [
                      {
                        "date": "2026-01-01",
                        "kind": "holiday",
                        "title": "Новогодние каникулы"
                      },
                      {
                        "date": "2026-01-07",
                        "kind": "holiday",
                        "title": "Рождество Христово"
                      },
                      {
                        "date": "2026-04-30",
                        "kind": "short",
                        "title": null
                      },
                      {
                        "date": "2026-05-04",
                        "kind": "rest",
                        "title": null
                      },
                      {
                        "date": "2026-11-07",
                        "kind": "work",
                        "title": null
                      }
                    ],
                    "months": [
                      {
                        "month": 1,
                        "workingDays": 16,
                        "hours": 128
                      },
                      {
                        "month": 2,
                        "workingDays": 19,
                        "hours": 151
                      }
                    ],
                    "drift": null,
                    "proposal": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Год в регионе уже загружен — код year_loaded; календарь базовый — not_regional.",
            "x-error-codes": [
              "year_loaded",
              "not_regional"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Дата переноса не из кандидатов или не разбирается — код bad_carry; года нет в базовом — year_not_loaded (details.calendar — базовый); базового нет — no_default_calendar; год после переноса не похож на производственный календарь — year_degenerate; год вне пределов — bad_year.",
            "x-error-codes": [
              "bad_carry",
              "year_not_loaded",
              "no_default_calendar",
              "year_degenerate",
              "bad_year"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/work-calendars/{id}/years/{year}/export": {
      "get": {
        "operationId": "appExportWorkCalendarYear",
        "tags": [
          "Производственный календарь"
        ],
        "summary": "Скачать год файлом",
        "description": "Год календаря книгой xlsx того же шаблона, что принимает загрузка: столбцы «Дата», «Вид дня», «Название», исключения по дате, вид — словом («праздник», «перенесённый выходной», «рабочий день», «сокращённый день»), дата — текстом ДД.ММ.ГГГГ. Скачанный файл, загруженный обратно, даёт статус same.\n\nИмя файла — work-calendar-{год}.xlsx и рядом filename* по RFC 5987 с «{календарь} {год}.xlsx». Выгружается содержимое календаря: года нет — 422 year_not_loaded, подмены базовым нет.\n\nТребует права work_calendar · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id календаря.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "description": "Календарный год, четыре цифры.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Год книгой Excel (xlsx). Имя приезжает в Content-Disposition.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Календаря с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Года в календаре нет — код year_not_loaded; год вне пределов — bad_year.",
            "x-error-codes": [
              "year_not_loaded",
              "bad_year"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/legal-entities": {
      "get": {
        "operationId": "appLegalEntities",
        "tags": [
          "Юрлица"
        ],
        "summary": "Юрлица портала",
        "description": "Юрлица, между которыми переключается раздел.\n\nЮрлицо — ОСЬ, а не фильтр: по каждому ведутся свой график на год, свои нормы, свои приказы и свой обмен. Т-7 подписывает руководитель юрлица, и график «на всю компанию из трёх юрлиц» не подпишет никто.\n\nСправочник — зеркало двух систем: организаций 1С (там договор, приказ и реквизиты форм) и «моих компаний» Б24 (на них построено подписание). Поэтому у юрлица два внешних идентификатора, а строка одна; `linked` говорит, связаны ли они.\n\nУ портала всегда есть хотя бы одно юрлицо: оно заводится вместе с порталом. Пока оно единственное, переключателя на экране нет.\n\nБез параметра список полный, недействующие идут последними. С `active=true` — только юрлица, которые можно выбрать в новом документе: действующие (`active`) и не пропавшие из источника; так их показывают формы шаблона вакансии и заявки.\n\nТребует права legal_entity · view.\n\nИное значение `active`, в том числе false, — 400 invalid_value с полем active.",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "Только действующие юрлица, не пропавшие из источника. Единственное значение — true; без параметра список полный. Иное значение, в том числе false, пустое или повтор параметра, — 400 `invalid_value` (поле `active`).",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Юрлица портала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEntitiesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "entities": [
                      {
                        "id": "9f1c0f8e-5b2a-4c31-9d77-2a6e0b4c1f52",
                        "name": "ООО «Торговый дом»",
                        "inn": "7701234567",
                        "isDefault": true,
                        "active": true,
                        "linked": true,
                        "timezone": "Europe/Moscow",
                        "mine": true
                      },
                      {
                        "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "name": "ООО «Производственный комплекс»",
                        "inn": "7707654321",
                        "isDefault": false,
                        "active": true,
                        "linked": false,
                        "timezone": "Asia/Kamchatka",
                        "mine": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Значение фильтра не принято (active не true) — код invalid_value, details.field называет параметр.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appLegalEntityCreate",
        "tags": [
          "Юрлица"
        ],
        "summary": "Завести юрлицо",
        "description": "Заведение руками. Реквизитов для печатных форм здесь нет: они приедут из CRM или 1С, а выдуманный адрес в приказе хуже пустого.\n\nЮрлицом по умолчанию новое не становится: умолчание одно, и передают его отдельно и осознанно.\n\nТребует права legal_entity · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEntityRequest"
              },
              "example": {
                "name": "ООО «Производственный комплекс»",
                "inn": "7707654321",
                "kpp": "770701001"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Юрлицо заведено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEntity"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "name": "ООО «Производственный комплекс»",
                    "inn": "7707654321",
                    "isDefault": false,
                    "active": true,
                    "linked": false,
                    "timezone": "Europe/Moscow",
                    "mine": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "409": {
            "description": "Юрлицо с таким именем в портале уже есть — код entity_name_taken: два юрлица под одним именем на экранах не различить.",
            "x-error-codes": [
              "entity_name_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Поле не годится. Коды: bad_name — имя пустое или длиннее 255 символов; bad_inn — ИНН не десять и не двенадцать цифр; bad_kpp — КПП не девять цифр; bad_timezone — такого часового пояса нет в базе поясов.",
            "x-error-codes": [
              "bad_name",
              "bad_inn",
              "bad_kpp",
              "bad_timezone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{entryId}/actual": {
      "put": {
        "operationId": "appVacationEntryActual",
        "tags": [
          "График отпусков"
        ],
        "summary": "Факт и перенос по строке графика",
        "description": "Графы 7 и 10 формы Т-7: когда человек ушёл НА САМОМ ДЕЛЕ и примечание, и приказ о предоставлении.\n\nПеренос (графы 8–9) оформляет своя ручка POST …/entries/{entryId}/move. Поля переноса movedTo, basis и order здесь больше не меняются: не пришли — сохранённые остаются (раньше отсутствие стирало их), совпадают с сохранёнными — запрос проходит, отличаются — 422 use_move. Ломающее изменение (ADR-vacation-hr-cycle).\n\nОтдельная ручка, а не поле в замене периодов: замена правит ПЛАН и на утверждённом графике запрещена, а факт отмечают как раз в утверждённом — весь год, по мере того как люди уходят.\n\nПустые поля факта стирают отметку: «факта ещё нет» — такое же состояние, как «ушёл тогда-то», и кадровик, ошибшийся датой, должен уметь её убрать.\n\nФакт и перенос — кадровая работа с Т-6 и Т-7: отмечает их только тот, у кого vacation_schedule_entry · edit = all. Ниже — 403 forbidden, и проверка идёт до поиска строки: отказ не говорит, есть ли она.\n\nОбе даты фактического периода заполняются вместе: «ушёл с пятого» без «по какое» — обрывок, а не факт.\n\nСмена дат — фактических или даты переноса — ложится в историю дат строки: что было, что стало, кто (тот, кто отмечает) и когда, и чем оформлен перенос. По истории печатаются графы 8–9 Т-7 и след печати табеля. Повторное сохранение без правки дат, примечание, основание и приказ записи не оставляют.\n\nТребует права vacation_schedule_entry · edit уровня all.\n\nОснование переноса и примечание — не длиннее 255 символов каждое. Длиннее отвергается сразу и с названием поля: это графы бумажного бланка, и в них пишут строку, а не рассказ.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "description": "public_id строки графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationActualRequest"
              },
              "example": {
                "startsOn": "2027-07-12",
                "endsOn": "2027-07-25",
                "basis": "Приказ от 06.07.2027 № 41-к",
                "movedTo": null,
                "note": "Перенос с письменного согласия работника"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Факт отмечен"
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationActualForbidden"
          },
          "404": {
            "description": "Графика нет, строки с таким id в ЭТОМ графике нет, или приказ из полей order и grantOrder не найден либо не виден пишущему по уровню personnel_order · view — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Приказ из книги другого юрлица — код order_other_entity; приказ отменён — order_cancelled: новую ссылку на отменённый приказ не ставят, прежняя остаётся, пока поле не прислано.",
            "x-error-codes": [
              "order_other_entity",
              "order_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Дата не разбирается — bad_date; у фактического периода заполнена только одна дата — actual_half; конец раньше начала — end_before_start; основание переноса длиннее 255 символов — bad_basis; примечание длиннее 255 символов — bad_note; приказ не того вида или о другом работнике (приказ о предоставлении — Т-6 о человеке строки или Т-6а; приказ переноса — свободная форма без работника или о нём же) — код order_mismatch; поля переноса отличаются от сохранённых — use_move: перенос оформляет POST …/entries/{entryId}/move.",
            "x-error-codes": [
              "bad_date",
              "actual_half",
              "end_before_start",
              "bad_basis",
              "bad_note",
              "order_mismatch",
              "use_move"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{entryId}/move": {
      "post": {
        "operationId": "appVacationMoveEntry",
        "tags": [
          "График отпусков"
        ],
        "summary": "Перенести строку утверждённого графика",
        "description": "Перенос строки утверждённого графика на новую дату без возврата в сбор: состояние графика, замороженные дни и плановые даты прежние. Пишется запись в историю дат строки; Т-7 печатает каждый перенос записью в графах 8–9. Повторный перенос с другой датой — вторая запись; отмены нет, ошибку исправляют следующим переносом.\n\nТа же дата и то же основание — ничего не меняется. Та же дата с другим основанием или приказом — правка последнего переноса на месте, без новой записи истории.\n\nОтказы: график не утверждён — 409 not_approved; у строки отмечен факт — 409 move_after_fact (прошедший уход — факт, а не перенос); основание пустое или длиннее 255 символов — 422 move_basis; дата раньше «сегодня» юрлица — 422 move_past; позже 31 декабря следующего года — 422 move_range (ст. 124).\n\nПеренос оформляет кадровик: требует права vacation_schedule_entry · edit уровня all. Ниже — 403 forbidden, до поиска строки.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "description": "public_id строки графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationMoveRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Перенесено"
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationActualForbidden"
          },
          "404": {
            "description": "Графика нет, строки с таким id в ЭТОМ графике нет, или приказ movedOrder не найден либо не виден пишущему — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График не утверждён — not_approved; у строки отмечен факт — move_after_fact; приказ из книги другого юрлица — order_other_entity; приказ отменён — order_cancelled.",
            "x-error-codes": [
              "not_approved",
              "move_after_fact",
              "order_other_entity",
              "order_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Дата не разбирается — bad_date; основание пустое или длиннее 255 символов — move_basis; дата раньше «сегодня» юрлица — move_past; позже 31 декабря следующего года — move_range; приказ не того вида или о другом работнике — order_mismatch.",
            "x-error-codes": [
              "bad_date",
              "move_basis",
              "move_past",
              "move_range",
              "order_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/cascade": {
      "get": {
        "operationId": "appVacationCascade",
        "tags": [
          "График отпусков"
        ],
        "summary": "Ход сбора графика",
        "description": "Где встала работа: шесть шагов каскада с числами, заполнение по подразделениям и охват сбора.\n\nКаскад считается ПОВЕРХ состояния документа, а не вместо него. Состояние отвечает, что это за документ сейчас; каскад — сколько подразделений раздали, сколько людей внесли даты и сколько руководителей согласовали. Без чисел остаётся «сбор идёт», по которому не позвонишь никому.\n\nЛюди берутся из снимка оргструктуры, а не из внесённых строк: вопрос «кто ещё не внёс» по внесённым не отвечается. Подразделения идут отстающими вверх.\n\nТребует права vacation_schedule · edit: ход сбора называет все отделы области и их счётчики — это работа ведущего сбор, а не читателя графика.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ход сбора",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationCascade"
                    }
                  }
                },
                "example": {
                  "data": {
                    "people": 4200,
                    "filled": 2984,
                    "excluded": 3,
                    "multi": 12,
                    "scope": [],
                    "stages": [
                      {
                        "key": "announced",
                        "done": true,
                        "ready": 64,
                        "of": 64
                      },
                      {
                        "key": "handed",
                        "done": false,
                        "ready": 53,
                        "of": 64
                      },
                      {
                        "key": "filled",
                        "done": false,
                        "ready": 2984,
                        "of": 4200
                      },
                      {
                        "key": "agreed",
                        "done": false,
                        "ready": 28,
                        "of": 64
                      },
                      {
                        "key": "review",
                        "done": false,
                        "ready": 0,
                        "of": 0
                      },
                      {
                        "key": "approved",
                        "done": false,
                        "ready": 0,
                        "of": 0
                      }
                    ],
                    "departments": [
                      {
                        "id": 21,
                        "name": "Казанский филиал",
                        "people": 42,
                        "filled": 7,
                        "agreed": 0,
                        "percent": 16,
                        "noDepartment": false
                      },
                      {
                        "id": 10,
                        "name": "Производство",
                        "people": 120,
                        "filled": 118,
                        "agreed": 118,
                        "percent": 98,
                        "noDepartment": false
                      },
                      {
                        "id": 0,
                        "name": "",
                        "people": 2,
                        "filled": 1,
                        "agreed": 0,
                        "percent": 50,
                        "noDepartment": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/exclusions": {
      "post": {
        "operationId": "appVacationExclude",
        "tags": [
          "График отпусков"
        ],
        "summary": "Отметить «Не планировать в этом году»",
        "description": "Отметка «Не планировать в этом году» — декрет, уход за ребёнком, увольнение: человек остаётся участником сбора, но не входит ни в «внесли», ни в «без дат», ни в N, и утверждение его не ждёт. В Т-7 он печатается строкой без дат с причиной в «Примечании».\n\nТолько в сборе и согласовании; после утверждения отметку нельзя ни поставить, ни снять — только вернув график в сбор. Отметить можно человека без дат: ввод дат снимает отметку.\n\nОдин человек: вне области — 404 not_found, не участник — 404 not_participant, с датами — 409 has_dates. Группа целиком не отклоняется: такие люди пропускаются и названы в skipped с причиной, остальные отмечаются. Повторная отметка меняет причину.\n\nСтавят и снимают кадровик (vacation_schedule_entry · edit = all) — любому участнику сбора — и руководитель (dept) — участникам, чей отдел по снимку в его поддереве. Уровень own получает 404 not_found. Ссылку b24- принимает только запрос из кабинета: ключ API получает 403 forbidden.\n\nТребует права vacation_schedule_entry · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationExclusionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Итог отметки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationExclusionResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "marked": 2,
                    "skipped": [
                      {
                        "person": "b24-481",
                        "reason": "has_dates"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — bad_request; людей нет, больше 500 или ссылка не разбирается, причина вне набора — invalid_value с полем people или reason.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика нет, человек вне области пишущего или уровень own — код not_found; один человек не участник сбора — not_participant.",
            "x-error-codes": [
              "not_found",
              "not_participant"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "У одного человека есть даты — has_dates; график утверждён — schedule_approved; график не в сборе и не в согласовании — not_collecting.",
            "x-error-codes": [
              "has_dates",
              "schedule_approved",
              "not_collecting"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Пояснение длиннее 255 символов — код bad_note.",
            "x-error-codes": [
              "bad_note"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/exclusions/{userId}": {
      "delete": {
        "operationId": "appVacationInclude",
        "tags": [
          "График отпусков"
        ],
        "summary": "Снять отметку «Не планировать»",
        "description": "Снять отметку «Не планировать в этом году» с одного человека: он снова ждёт дат и входит в N. Отметки нет — снимать нечего, ответ тот же. Только в сборе и согласовании.\n\nСтавят и снимают кадровик (vacation_schedule_entry · edit = all) — любому участнику сбора — и руководитель (dept) — участникам, чей отдел по снимку в его поддереве. Уровень own получает 404 not_found. Ссылку b24- принимает только запрос из кабинета: ключ API получает 403 forbidden.\n\nТребует права vacation_schedule_entry · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "public_id человека или b24-<номер в Битрикс24>."
          }
        ],
        "responses": {
          "204": {
            "description": "Отметки нет"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика или человека нет, человек вне области пишущего или уровень own — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График утверждён — schedule_approved; график не в сборе и не в согласовании — not_collecting.",
            "x-error-codes": [
              "schedule_approved",
              "not_collecting"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{entryId}/t6": {
      "get": {
        "operationId": "appVacationEntryT6",
        "tags": [
          "График отпусков"
        ],
        "summary": "Приказ Т-6 по строке утверждённого графика",
        "description": "Отдаёт унифицированную форму Т-6 «Приказ (распоряжение) о предоставлении отпуска работнику» (постановление Госкомстата России от 05.01.2004 № 1) книгой Excel (xlsx) по одной строке графика. Книжный A4, вписывание в страницу — приказ подшивают в личное дело.\n\nПечатается ТОЛЬКО по утверждённому графику: приказ — документ сильнее графика, график обещает, приказ предоставляет. Приказ по строке черновика — это предоставленный отпуск на даты, которые ещё правят. Неутверждённый график отвечает 409, код not_approved.\n\nДаты приказа — фактические, если они у строки уже отмечены, иначе плановые: если человек ушёл не по плану и факт известен, бланк с плановыми датами был бы приказом на отпуск, которого не было. Перенос в приказ не попадает — это намерение, а не период.\n\nЧего сервис не знает, то не выдумывается: табельный номер и ОКПО — пустые клетки, период работы («за период работы с … по …») и раздел Б (иные виды отпуска) — линии под заполнение от руки. Номер и дата приказа — из книги приказов, если строка связана с приказом о предоставлении и печатающий видит книгу целиком (personnel_order · view = all); иначе номер пуст, а дата — день выдачи.\n\nПриказ издаётся от имени организации: права vacation_schedule · view мало — нужен полный уровень на строки (vacation_entry · view). Руководитель отдела видит строки своего отдела, но приказ по ним издавал бы, не имея на это права, — отказ 403.\n\nДни у фактических дат считаются по календарю человека: года нет в региональном, а в базовом есть — по базовому. Года факта нет и в базовом — приказ не печатается, 422 calendar_silent: бланк с днями без праздников подписывался бы как верный.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "description": "public_id строки графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Файл приказа Т-6 — книга Excel (xlsx). Имя вида «T-6-2027.xlsx» приезжает в Content-Disposition.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет, либо строки с таким entryId нет в этом графике — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График не утверждён — приказ печатать нельзя, код not_approved.",
            "x-error-codes": [
              "not_approved"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "У строки отмечен факт, а года факта нет ни в производственном календаре человека, ни (у регионального) в базовом — код calendar_silent с details.year и details.calendar: дни факта не посчитаны, и бланк не печатается.",
            "x-error-codes": [
              "calendar_silent"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/t6a": {
      "get": {
        "operationId": "appVacationScheduleT6a",
        "tags": [
          "График отпусков"
        ],
        "summary": "Сводный приказ Т-6а по выбранным строкам графика",
        "description": "Отдаёт унифицированную форму Т-6а «Приказ (распоряжение) о предоставлении отпуска работникам» (постановление Госкомстата России от 05.01.2004 № 1) книгой Excel (xlsx) по выбранным строкам графика. Альбомный A4, вписывание в ширину, шапка таблицы повторяется на каждой странице.\n\nСтроки выбираются параметром entry, повторяемым: приказ на нескольких — это выбор кадровика (отдел, уходящие в одном месяце), а не весь график. Строки идут в порядке запроса; повторённый адрес даёт одну строку — дважды напечатанный период был бы дважды предоставленным отпуском на подписываемой бумаге. Без единой строки — отказ 422, код no_entries: пустой бланк не документ. Строка, которой в графике нет, портит весь набор — 404, код not_found: молча выкинуть её значило бы выдать приказ не на тех людей.\n\nОстальное — как у Т-6: только по утверждённому графику (409, not_approved), даты фактические при их наличии, неизвестное сервису не выдумывается, печатает тот, кто видит все строки графика (иначе 403).\n\nДни у фактических дат считаются по календарю человека: года нет в региональном, а в базовом есть — по базовому. Года факта нет и в базовом — сводный приказ не печатается, 422 calendar_silent: бланк с днями без праздников подписывался бы как верный.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "query",
            "required": true,
            "description": "public_id строки графика. Повторяется: один параметр на каждую строку приказа.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Файл приказа Т-6а — книга Excel (xlsx). Имя вида «T-6a-2027.xlsx» приезжает в Content-Disposition.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Строк больше 5000 — код bad_request: приказ на столько людей собирается частями.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет, либо одной из выбранных строк нет в этом графике — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График не утверждён — приказ печатать нельзя, код not_approved.",
            "x-error-codes": [
              "not_approved"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Не выбрано ни одной строки — код no_entries. У выбранной строки отмечен факт, а года факта нет ни в календаре человека, ни (у регионального) в базовом — calendar_silent с details.year и details.calendar.",
            "x-error-codes": [
              "no_entries",
              "calendar_silent"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/t7": {
      "get": {
        "operationId": "appVacationScheduleT7",
        "tags": [
          "График отпусков"
        ],
        "summary": "Печатная форма Т-7 по утверждённому графику",
        "description": "Отдаёт унифицированную форму Т-7 «График отпусков» (постановление Госкомстата России от 05.01.2004 № 1) книгой Excel (xlsx) — её открывают Excel, Numbers и Google Таблицы. Настройки печати лежат внутри файла: альбомная, A4, вписывание в ширину, повтор шапки таблицы на каждой странице.\n\nПечатается ТОЛЬКО утверждённый график: форма — документ, а не черновик. Напечатанный «сбор» неотличим на бумаге от настоящего графика, уходит на подпись руководителю юрлица и устаревает в тот же час, когда кто-то допишет себе период. Неутверждённый график отвечает 409, код not_approved.\n\nЮрлицо параметром не передаётся: оно задано у самого графика, и Т-7 подписывает руководитель того юрлица, в котором график собран, а не того, которое назвали в запросе. Реквизиты шапки берутся оттуда же.\n\nЧасть граф бланка печатается пустыми, и это осознанно: код по ОКПО и подписанты лежат в реквизитах юрлица неразобранным JSON, должности в снимке оргструктуры нет вовсе, а табельный номер заводится в 1С и приедет обменом. Выдуманное значение на подписываемом документе хуже пустой клетки.\n\nНомер документа и дата учёта мнения профсоюзного органа в шапке — из графика (t7Number, unionOpinionOn): кадровик вносит их при утверждении и правит PATCH утверждённого графика. Не внесены — графа номера пустая, а строка мнения профсоюза печатается под заполнение от руки. Номер решения органа сервис не спрашивает: место под «№» пустое всегда.\n\nСостав бланка от «сегодня» не зависит: люди со строками графика и все отмеченные «Не планировать в этом году». Отмеченный печатается строкой без дат, причина — словом в «Примечании»: «Декрет», «Уход за ребёнком», «Увольнение», «Другое: <пояснение>» или «Другое». После утверждения отметки заморожены, и бланк не меняется, даже если отмеченного потом выключили в Битрикс24.\n\nГрафы 8–9 — запись на каждый перенос строки по порядку, по истории её дат, а не только последний: основание и дата переноса. Два переноса и больше печатаются с номером в обеих графах. Стёртая дата переноса снимает из граф всю цепочку до неё. Графа 8 называет реквизиты приказа каждого переноса из книги приказов, если печатающий видит книгу целиком (personnel_order · view = all); иначе — текст основания переноса.\n\nБланк печатается целиком или не печатается вовсе: права vacation_schedule · view мало — нужен полный уровень на строки (vacation_entry · view). Иначе сотрудник получил бы Т-7 организации с одной своей строкой, неотличимый на бумаге от настоящего, — отказ 403.\n\nФайл отдаётся потоком, без Content-Length. Сбой после начала передачи — статус 200 уже ушёл, и соединение обрывается: усечённое тело — не файл, его не открывать. Пакетом (POST /api/v1/batch) не вызывается — batch_not_batchable: ответ-файл пакет не принимает.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Файл формы Т-7 — книга Excel (xlsx). Имя вида «T-7-2027.xlsx» приезжает в Content-Disposition.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График не утверждён — печатать нечего, код not_approved.",
            "x-error-codes": [
              "not_approved"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/remind": {
      "post": {
        "operationId": "appVacationRemind",
        "tags": [
          "График отпусков"
        ],
        "summary": "Напомнить отстающим сотрудникам",
        "description": "Уведомление в Битрикс24 самим отстающим — «не внёс» и «внёс не всё». При напоминании по отбору их руководителям — одна сводка по отделам на нажатие; при явном выборе people — только выбранным людям, без сводки руководителям.\n\nУведомлением, а не письмом: рассылки в сервисе нет, и обещать письмо, которого не будет, нельзя. Уходит личным вебхуком нажавшего.\n\nКому — отбор как у списка участников (department, state, issue, q) или явный выбор people; вместе они не принимаются. Тело без полей — всем отстающим области смотрящего. Область — как у списка участников: подразделение вне поддерева, «Без подразделения» на уровне dept и человек вне области — 403 на всё нажатие, ничего не отправляется.\n\nНе чаще раза в сутки одному человеку и одному руководителю об одном отделе — предел в коде: кнопка, нажатая трижды за час, научила бы не читать наши уведомления.\n\nПеред отправкой сервис перепроверяет человека: уже внёсшему и по утверждённому графику напоминание не уходит. Отказ портала по одному не роняет остальных и уезжает своим списком failed с причиной.\n\nНажатие держит свой бюджет времени: не успевшее уходит фоном, его число — remaining.\n\nТребует права vacation_schedule · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationRemindRequest"
              },
              "example": {
                "state": "without",
                "department": 21
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Скольким ушло, кого пропустили и кому не дошло",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationReminded"
                    }
                  }
                },
                "example": {
                  "data": {
                    "sent": 12,
                    "skipped": [
                      {
                        "reason": "recent",
                        "total": 1,
                        "people": [
                          {
                            "user": "0193b0a2-7c1e-7a4b-9d2f-3c5e8a1b2c3d",
                            "b24User": 41,
                            "userName": "Иванова Анна",
                            "email": null
                          }
                        ]
                      }
                    ],
                    "failed": [
                      {
                        "reason": "unavailable",
                        "total": 1,
                        "people": [
                          {
                            "user": null,
                            "b24User": 57,
                            "userName": "",
                            "email": "petrov@corp.example"
                          }
                        ]
                      }
                    ],
                    "remaining": 0,
                    "heads": {
                      "sent": 2,
                      "failed": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается, явный выбор people вместе с отбором, выбор пуст или длиннее 500, состояние не without и не partial, неизвестная проблема, пустой поиск или неразборчивая ссылка на человека — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "У нажавшего нет действующего доступа к порталу — напоминание отправить нечем, код no_hook; чинится его входом в сервис. Напоминание по этому графику уже отправляется соседним нажатием — код remind_busy; повторите, когда оно закончится. График не в сборе и не в согласовании (черновик или утверждён) — код not_collecting; напоминать некому, ничего не ставится.",
            "x-error-codes": [
              "no_hook",
              "remind_busy",
              "not_collecting"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/legal-entities/{id}": {
      "patch": {
        "operationId": "appLegalEntityUpdate",
        "tags": [
          "Юрлица"
        ],
        "summary": "Правка юрлица",
        "description": "Имя, реквизиты, признак действующего, передача умолчания и часовой пояс.\n\nПояс — имя IANA; по нему датируются бланки Т-6, Т-7 и Т-13, чтобы «сегодня» документа было сутками юрлица, а не сервера.\n\nЛиквидированное юрлицо не удаляют, а помечают недействующим: в нём остались графики прошлых лет, а график отпусков — кадровый документ со сроком хранения.\n\nТребует права legal_entity · edit. Local save remains available while synchronization is stopped; local success is not external delivery confirmation. Existing grants, key ceilings and error envelope apply.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalEntityPatchRequest"
              },
              "example": {
                "isDefault": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Юрлицо изменено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LegalEntity"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "name": "ООО «Производственный комплекс»",
                    "inn": "7707654321",
                    "isDefault": true,
                    "active": true,
                    "linked": false,
                    "timezone": "Asia/Kamchatka",
                    "mine": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Умолчанием назначают недействующее юрлицо — код invalid_value, details.field = isDefault: умолчание всегда действующее (включите его той же правкой). Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Юрлица с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Юрлицо по умолчанию не выключается — код entity_is_default: сначала передайте умолчание другому юрлицу. Имя занято другим юрлицом портала — код entity_name_taken.",
            "x-error-codes": [
              "entity_is_default",
              "entity_name_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Поле не годится. Коды: bad_name — имя пустое или длиннее 255 символов; bad_inn — ИНН не десять и не двенадцать цифр; bad_kpp — КПП не девять цифр; bad_timezone — такого часового пояса нет в базе поясов.",
            "x-error-codes": [
              "bad_name",
              "bad_inn",
              "bad_kpp",
              "bad_timezone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appLegalEntityDelete",
        "tags": [
          "Юрлица"
        ],
        "summary": "Убрать юрлицо",
        "description": "Для юрлица, заведённого по ошибке. Три запрета, и все три про то, что уже написано в базе: юрлицо с данными отпусков, табеля или приказов унесло бы с собой кадровые документы (юрлицо, стоящее в шаблоне вакансии или в условиях заявки, держится так же), последнее юрлицо портала оставило бы график без места, а юрлицо по умолчанию держит на себе всех, у кого нет своей привязки.\n\nТребует права legal_entity · edit.\n\nЮрлицо, стоящее в шаблоне вакансии или в условиях заявки, не удаляется: ответ 409 entity_in_use.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Юрлицо убрано"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Юрлица с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Отказ по тому, что уже написано в базе. Коды: entity_is_default — юрлицо назначено умолчанием, сначала передайте умолчание другому; entity_in_use — у юрлица есть данные отпусков, табеля или приказов (графики, нормы, мероприятия, отметки и печать табеля, приказы) или оно стоит в шаблоне вакансии или в условиях заявки; last_entity — это последнее юрлицо портала.",
            "x-error-codes": [
              "entity_is_default",
              "entity_in_use",
              "last_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/absence-scenarios": {
      "get": {
        "operationId": "appAbsenceScenarios",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Каталог сценариев",
        "description": "Тринадцать сценариев мероприятий — состав ТК: у каждого комплект документов и срок в календарных днях от запуска. Маршрут у всех один (комплект → подписание работником → подписание компанией → проведение в 1С:ЗУП), поэтому здесь его нет — отличаются комплект и срок, а не этапы.\n\nРядом с каждым сценарием — то, что портал у него настроил (предлагается ли, какой срок обещан, с какого уровня запускают), и то, чем он живёт: идущих мероприятий, из них просроченных, запущено за тридцать дней. Счётчики считаются по юрлицу и сужены уровнем смотрящего, как список «в работе»: у руководителя это числа его отдела.\n\nНазваний нет: сервер отдаёт коды, названия держит интерфейс на своём языке.\n\nПод правом просмотра мероприятий: кто видит работу, тот видит и из чего она. Требует права absence_process · view.",
        "responses": {
          "200": {
            "description": "Каталог сценариев",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceScenariosResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "scenarios": [
                      {
                        "code": "annual_leave",
                        "kit": [
                          "application",
                          "order_t6",
                          "pay_calc"
                        ],
                        "dueDays": 2,
                        "catalogDueDays": 2,
                        "catalogDue": true,
                        "enabled": true,
                        "launchLevel": "all",
                        "needsPeriod": true,
                        "canLaunch": true,
                        "inWork": 11,
                        "overdue": 2,
                        "lastMonth": 64
                      },
                      {
                        "code": "unpaid_leave",
                        "kit": [
                          "application",
                          "order"
                        ],
                        "dueDays": 5,
                        "catalogDueDays": 2,
                        "catalogDue": false,
                        "enabled": false,
                        "launchLevel": "all",
                        "needsPeriod": true,
                        "canLaunch": false,
                        "inWork": 0,
                        "overdue": 0,
                        "lastMonth": 0
                      }
                    ],
                    "maySetup": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found. Чужое юрлицо отвечает тем же: подтверждать его существование мы не станем.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, по которому считаются счётчики. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/absence-scenarios/{code}": {
      "put": {
        "operationId": "appAbsenceScenarioSetting",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Настроить сценарий",
        "description": "Портал настраивает у сценария то, что от компании к компании МЕНЯЕТСЯ: предлагается ли он, какой срок обещан и с какого уровня права его запускают. Комплект и маршрут не настраиваются — они состав ТК, а не выбор компании.\n\nНастройка портальная, поэтому правит её только тот, кому мероприятия открыты целиком: руководитель со своим отделом менял бы обещание всему порталу. Отвечает каталогом целиком — вместе со сроком меняется и то, кому сценарий доступен.\n\nВыключенный сценарий остаётся в каталоге и перестаёт запускаться, в том числе в обход экрана. Требует права absence_process · edit уровня all.",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Код сценария из каталога."
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, по которому считаются счётчики. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceScenarioSettingRequest"
              },
              "example": {
                "enabled": true,
                "dueDays": 5,
                "launchLevel": "dept"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Каталог сценариев после правки. Пример ниже — ответ на запрос из requestBody: у annual_leave dueDays и launchLevel те, что в теле запроса, а не каталожные по умолчанию.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceScenariosResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "scenarios": [
                      {
                        "code": "annual_leave",
                        "kit": [
                          "application",
                          "order_t6",
                          "pay_calc"
                        ],
                        "dueDays": 5,
                        "catalogDueDays": 2,
                        "catalogDue": true,
                        "enabled": true,
                        "launchLevel": "dept",
                        "needsPeriod": true,
                        "canLaunch": true,
                        "inWork": 11,
                        "overdue": 2,
                        "lastMonth": 64
                      },
                      {
                        "code": "unpaid_leave",
                        "kit": [
                          "application",
                          "order"
                        ],
                        "dueDays": 5,
                        "catalogDueDays": 2,
                        "catalogDue": false,
                        "enabled": false,
                        "launchLevel": "all",
                        "needsPeriod": true,
                        "canLaunch": false,
                        "inWork": 0,
                        "overdue": 0,
                        "lastMonth": 0
                      }
                    ],
                    "maySetup": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Кода сценария нет в каталоге — bad_scenario; срок вне 1—365 дней — bad_due_days; уровень запуска не из трёх — bad_launch_level; код табеля не из неявок формы Т-12 — bad_timesheet_code.",
            "x-error-codes": [
              "bad_scenario",
              "bad_due_days",
              "bad_launch_level",
              "bad_timesheet_code"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/absence-processes": {
      "get": {
        "operationId": "appAbsenceProcesses",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Мероприятия в работе",
        "description": "Идущие мероприятия юрлица: кто, по какому сценарию, на каком этапе, до какого срока. Ближайший срок сверху, просроченные первыми. Законченных и отменённых здесь нет — вкладка про то, где встала работа, а не про историю.\n\n`overdue` считает сервер по своему дню: срок — обещание, а не запрет, и просроченное мероприятие помечается («горит»), но не отменяется само. `attention` — сколько таких в списке.\n\nУровень права сужает список по человеку, как строки графика: работник видит своё, руководитель — свой отдел, кадровик — всё. Комплект в списке только счётчиком: документы отдаёт запуск. Требует права absence_process · view.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, от лица которого ведутся мероприятия. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "responses": {
          "200": {
            "description": "Мероприятия в работе",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceProcessesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "processes": [
                      {
                        "id": "6c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e6f",
                        "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "userName": "Иванов Иван",
                        "scenario": "annual_leave",
                        "stage": "kit",
                        "dueOn": "2026-09-23",
                        "overdue": false,
                        "startedAt": "2026-09-21T09:40:00Z",
                        "startedBy": "Петрова Анна",
                        "docsReady": 0,
                        "docsTotal": 3,
                        "docs": [],
                        "steps": [],
                        "allowed": [
                          "advance",
                          "cancel"
                        ],
                        "finishedAt": null
                      }
                    ],
                    "attention": 0
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found. Чужое юрлицо отвечает тем же: подтверждать его существование мы не станем.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appAbsenceProcessStart",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Запустить мероприятие",
        "description": "Запуск по сценарию на человека. Мероприятие встаёт на первый этап — формирование комплекта — и получает срок: день запуска плюс ДЕЙСТВУЮЩИЙ срок сценария, настроенный порталом. Документы комплекта заводятся сразу и все «не готовы»: так этап с первой секунды показывает, чего не хватает.\n\nЧеловек обязан состоять в юрлице на день запуска — тем же правилом, что у графика: привязан к нему, а без привязок — в юрлице по умолчанию. Иначе приказ печатался бы от чужого лица.\n\nЗапуск и ведение — разные права: продвинуть этап или отменить требует absence_process · edit уровня «отдел» и выше, а сам запуск — absence_process · launch. У сотрудника launch бывает own («на себя») без edit вовсе.\n\nДаты периода (startsOn и endsOn) обязательны, если у сценария в каталоге needsPeriod: без них — 400 period_required. Этот отказ — последний: он приходит после всех прежних проверок (тело, человек, юрлицо, сценарий, уровень, даты, членство), поэтому запрос, получавший другой отказ, получает его же.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, от лица которого ведутся мероприятия. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceStartRequest"
              },
              "example": {
                "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                "scenario": "annual_leave",
                "startsOn": "2027-07-05",
                "endsOn": "2027-07-18"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Мероприятие запущено — с комплектом",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceProcess"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e6f",
                    "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "userName": "Иванов Иван",
                    "scenario": "annual_leave",
                    "stage": "kit",
                    "dueOn": "2026-09-23",
                    "overdue": false,
                    "startedAt": "2026-09-21T09:40:00Z",
                    "startedBy": "Петрова Анна",
                    "docsReady": 0,
                    "docsTotal": 3,
                    "docs": [
                      {
                        "kind": "application",
                        "state": "pending"
                      },
                      {
                        "kind": "order_t6",
                        "state": "pending"
                      },
                      {
                        "kind": "pay_calc",
                        "state": "pending"
                      }
                    ],
                    "steps": [],
                    "allowed": [
                      "advance",
                      "cancel"
                    ],
                    "finishedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; период заявления с одной датой или «по» раньше «с» — bad_period; сценарию с периодом без дат — period_required.",
            "x-error-codes": [
              "bad_request",
              "bad_period",
              "period_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AbsenceLaunchForbidden"
          },
          "404": {
            "description": "Человека с таким адресом в портале нет или он вне уровня запуска смотрящего — одно тело с кодом user_not_found (отказ не подтверждает, что человек есть); юрлицо из параметра entity не найдено — not_found. Тоже not_found — когда запуск записан, но заведённое мероприятие вне уровня ПРОСМОТРА смотрящего (launch шире view): ответ записи несёт тот же предикат, что GET.",
            "x-error-codes": [
              "user_not_found",
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Человек не состоит в этом юрлице на день запуска — код not_in_entity; сценарий выключен на портале — scenario_disabled. В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity.",
            "x-error-codes": [
              "not_in_entity",
              "scenario_disabled",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Кода сценария нет в каталоге — код bad_scenario; дата периода не разбирается — bad_date.",
            "x-error-codes": [
              "bad_scenario",
              "bad_date"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/absence-processes/{id}": {
      "get": {
        "operationId": "appAbsenceProcess",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Карточка мероприятия",
        "description": "Мероприятие целиком: комплект по документам, журнал шагов и что смотрящий может сделать сейчас. `allowed` считает сервер от этапа и права, а не от комплекта — на этапе `kit` `advance` в нём есть и тогда, когда собраны не все документы. Экран правило не дублирует, но и кнопку, обещающую отказ, не прячет: она видна неактивной, а рядом словами — чего в комплекте не хватает (это уже поля `docs`, второго запроса не нужно).\n\nУровень права сужает и карточку: мероприятие вне уровня для смотрящего не существует и отвечает 404, а не 403 — подтверждать существование того, что ему не положено видеть, карточка не станет. Требует права absence_process · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Адрес мероприятия наружу."
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка мероприятия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceProcess"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e6f",
                    "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "userName": "Иванов Иван",
                    "scenario": "unpaid_leave",
                    "stage": "employee_sign",
                    "dueOn": "2026-09-23",
                    "overdue": false,
                    "startedAt": "2026-09-21T09:40:00Z",
                    "startedBy": "Петрова Анна",
                    "docsReady": 2,
                    "docsTotal": 2,
                    "docs": [
                      {
                        "kind": "application",
                        "state": "ready"
                      },
                      {
                        "kind": "order",
                        "state": "ready"
                      }
                    ],
                    "steps": [
                      {
                        "action": "advance",
                        "from": "kit",
                        "to": "employee_sign",
                        "note": null,
                        "at": "2026-09-21T10:15:00Z",
                        "by": "Петрова Анна"
                      }
                    ],
                    "allowed": [
                      "advance",
                      "back",
                      "cancel"
                    ],
                    "finishedAt": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Мероприятия с таким адресом нет или оно вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appAbsenceProcessMove",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Двинуть мероприятие",
        "description": "Дальше по маршруту, на шаг назад или отменить. Маршрут один на все сценарии: комплект → подписание работником → подписание компанией → проведение в 1С:ЗУП → готово; правило движения — на сервере.\n\nДальше первого этапа не пускает без полного комплекта: отказ kit_incomplete называет недостающие документы в `details.missing`. Назад — на один шаг, не на первый попавшийся, и с причиной; отмена — с причиной: возврат без слов о том, чего не хватило, читается как придирка сервиса. Причина пишется в журнал шагов. Готово и отменено — конечные: из них мероприятие не двигается.\n\nОтвечает карточкой целиком, а не 204: вместе с этапом меняются `allowed` и комплект. Требует права absence_process · edit; уровень сужает — двигать можно то, что видишь.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Адрес мероприятия наружу."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceMoveRequest"
              },
              "example": {
                "action": "back",
                "reason": "Работник не подписал: даты не те."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Мероприятие двинуто — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceProcess"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e6f",
                    "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "userName": "Иванов Иван",
                    "scenario": "unpaid_leave",
                    "stage": "employee_sign",
                    "dueOn": "2026-09-23",
                    "overdue": false,
                    "startedAt": "2026-09-21T09:40:00Z",
                    "startedBy": "Петрова Анна",
                    "docsReady": 2,
                    "docsTotal": 2,
                    "docs": [
                      {
                        "kind": "application",
                        "state": "ready"
                      },
                      {
                        "kind": "order",
                        "state": "ready"
                      }
                    ],
                    "steps": [
                      {
                        "action": "advance",
                        "from": "kit",
                        "to": "employee_sign",
                        "note": null,
                        "at": "2026-09-21T10:15:00Z",
                        "by": "Петрова Анна"
                      }
                    ],
                    "allowed": [
                      "advance",
                      "back",
                      "cancel"
                    ],
                    "finishedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Мероприятия с таким адресом нет или оно вне уровня — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Комплект не собран, недостающие документы в details.missing — код kit_incomplete; мероприятие уже закончено или отменено — final_stage; возврат с первого этапа — first_stage; «дальше» на этапе подписи или проведения — external_stage (такой этап закрывается вручную, action=manual с основанием в reason); ручное закрытие не на этих этапах — not_external; мероприятие уже на другом этапе, чем видел экран — stage_changed.",
            "x-error-codes": [
              "kit_incomplete",
              "final_stage",
              "first_stage",
              "external_stage",
              "not_external",
              "stage_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Действие не из трёх известных — код bad_action; у возврата или отмены нет причины — reason_required; причина длиннее предела журнала — bad_reason; не назван этап, с которого переход — from_required.",
            "x-error-codes": [
              "bad_action",
              "reason_required",
              "bad_reason",
              "from_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/absence-processes/{id}/docs/{kind}": {
      "put": {
        "operationId": "appAbsenceProcessDoc",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Отметить документ комплекта",
        "description": "Готов документ или нет. Только на первом этапе — формирование комплекта: после подписи работником менять состав документов значило бы подписывать другое. Вернули на комплект — снова можно.\n\nОтвечает карточкой целиком: вместе с документом меняется счётчик комплекта. Требует права absence_process · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Адрес мероприятия наружу."
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Вид документа — код из комплекта сценария."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AbsenceDocRequest"
              },
              "example": {
                "state": "ready"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Документ отмечен — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AbsenceProcess"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e6f",
                    "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "userName": "Иванов Иван",
                    "scenario": "unpaid_leave",
                    "stage": "employee_sign",
                    "dueOn": "2026-09-23",
                    "overdue": false,
                    "startedAt": "2026-09-21T09:40:00Z",
                    "startedBy": "Петрова Анна",
                    "docsReady": 2,
                    "docsTotal": 2,
                    "docs": [
                      {
                        "kind": "application",
                        "state": "ready"
                      },
                      {
                        "kind": "order",
                        "state": "ready"
                      }
                    ],
                    "steps": [
                      {
                        "action": "advance",
                        "from": "kit",
                        "to": "employee_sign",
                        "note": null,
                        "at": "2026-09-21T10:15:00Z",
                        "by": "Петрова Анна"
                      }
                    ],
                    "allowed": [
                      "advance",
                      "back",
                      "cancel"
                    ],
                    "finishedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Мероприятия нет или оно вне уровня — код not_found; такого документа в комплекте нет — doc_not_found.",
            "x-error-codes": [
              "not_found",
              "doc_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Мероприятие ушло с первого этапа, комплект заморожен — код stage_locked.",
            "x-error-codes": [
              "stage_locked"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Состояние не pending и не ready — код bad_doc_state.",
            "x-error-codes": [
              "bad_doc_state"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/orders": {
      "get": {
        "operationId": "appOrderBook",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Книга приказов юрлица",
        "description": "Приказы по личному составу с реквизитами: номер, дата, вид, о ком. Свежие сверху — так книгу и листают.\n\nКнига отдаётся страницами по limit (по умолчанию 100, не больше 300) в порядке даты приказа и его заведения, свежие сверху; следующая страница — курсором nextCursor.\n\nКнига ведётся ПО ЮРЛИЦУ: приказ подписывает его руководитель, и одна книга на три организации не существует ни на бумаге, ни здесь.\n\nВидно по уровню права personnel_order · view: работнику — приказы о нём, руководителю — о своих людях, кадровику — книгу целиком. Приказ на нескольких виден тому, кому открыты все люди его строк графика (приказом о предоставлении отпуска или основанием переноса); приказ без строк — только тому, кому открыта вся книга.\n\nУ каждой строки — признаки can: можно ли вызывающему исправить и отменить этот приказ. Они считаются тем же правилом, что проверяет исправление и отмену, и одним запросом на страницу книги: кто видит книгу шире, чем правит (видит всё, правит свой отдел), получает признаки только на приказах, которые ему открыты на правку.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чья книга приказов. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор страницы из nextCursor. Неразборчивый или ни на что не указывающий — 400 bad_request."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            },
            "description": "Приказов на страницу. Больше 300 — 300. Не целое или меньше 1 — 400 bad_request."
          }
        ],
        "responses": {
          "200": {
            "description": "Книга приказов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OrdersResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "orders": [
                      {
                        "id": "9c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e60",
                        "kind": "free",
                        "number": "12-к",
                        "issuedOn": "2027-07-03",
                        "requisites": "№ 12-к от 03.07.2027",
                        "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "subjectName": "Иванов Иван",
                        "createdAt": "2027-07-03T08:15:00Z",
                        "status": "active",
                        "cancellation": null,
                        "corrections": [],
                        "linkedRows": 0,
                        "can": {
                          "correct": true,
                          "cancel": true
                        }
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобраны — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appOrderCreate",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Завести приказ",
        "description": "Приказ заводится с реквизитами: вид, номер и дата составления. Номер берётся из книги приказов компании — сервис его не выдумывает, иначе в деле и в сервисе окажутся разные номера одного документа.\n\nНомер уникален в книге юрлица за календарный год даты приказа: компании обычно начинают нумерацию заново каждый год, и № 12-о от 2027 года заводится рядом с № 12-о от 2026-го. Повтор в том же году отвечает duplicate_number, а details несут номер и год (number, year) — экран называет их словами. Два приказа под одним номером в одном году — это либо опечатка, либо потерянный документ, и поймать это дешевле на заведении, чем на проверке.\n\nТребует права personnel_order · edit.\n\nПорядок проверок: реквизиты (номер, дата), затем вид и работник — у Т-6 работник обязателен, у Т-6а недопустим, у свободной формы — по желанию (иначе 400 invalid_value, details.field = subject); затем работник — по адресу и в уровне personnel_order · edit пишущего: «нет такого» и «вне уровня» отвечают одним 404 not_found; затем членство работника в юрлице книги на дату приказа, а когда 1С прислала даты приёма или увольнения, — и работа в этот день (день увольнения — рабочий): иначе 409 not_in_entity. Приказ без работника (Т-6а, свободная без работника) предикат по человеку не сужает, поэтому требует personnel_order · edit уровня «все» — иначе 403 forbidden.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чья книга приказов. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              },
              "example": {
                "kind": "free",
                "number": "12-к",
                "issuedOn": "2027-07-03",
                "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Приказ заведён",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e60",
                    "kind": "free",
                    "number": "12-к",
                    "issuedOn": "2027-07-03",
                    "requisites": "№ 12-к от 03.07.2027",
                    "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "subjectName": "Иванов Иван",
                    "createdAt": "2027-07-03T08:15:00Z",
                    "status": "active",
                    "cancellation": null,
                    "corrections": [],
                    "linkedRows": 0,
                    "can": {
                      "correct": true,
                      "cancel": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; вид приказа не из каталога — bad_kind; дата не разобрана или пуста — bad_date; номер пуст — number_required; номер длиннее книги — bad_number; адрес работника не разобран — bad_subject; у Т-6 нет работника или у Т-6а он указан — код invalid_value, details.field = subject.",
            "x-error-codes": [
              "bad_request",
              "bad_kind",
              "bad_date",
              "number_required",
              "bad_number",
              "bad_subject",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Работника с таким адресом в портале нет или он вне уровня personnel_order · edit пишущего — одним ответом, код not_found; так же — юрлицо из параметра entity не найдено.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Такой номер в книге юрлица за год даты приказа уже есть — код duplicate_number, details: number и year; работник не состоит в юрлице книги или не работает в день приказа — код not_in_entity; приказ другого юрлица — order_other_entity. В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity.",
            "x-error-codes": [
              "duplicate_number",
              "not_in_entity",
              "order_other_entity",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/timesheet": {
      "get": {
        "operationId": "appTimesheetMonth",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Табель за месяц",
        "description": "Табель отдаётся СТРАНИЦАМИ ПО ЛЮДЯМ (500 на страницу, порядок — первый отдел, фамилия, имя; люди без отдела — последними): люди — члены юрлица хотя бы в один день месяца, видимые смотрящему. people — людей в области запроса, documentPeople — людей документа (без подразделения — ровно то, что напечатает Т-13). Счётчики изменений после печати и printable считаются по документу, подсветка клеток — по странице.\n\nТабель учёта рабочего времени юрлица за месяц: люди × дни, у каждого дня буквенный и цифровой коды формы Т-12 и часы.\n\nСЧИТАЕТСЯ КАЖДЫЙ РАЗ, а не читается из таблицы: в базе живут только отметки табельщика — то, чего сервис знать не может. Сохранённая копия табеля разошлась бы с графиком и календарём в тот день, когда кадровик поправит даты задним числом, и разошлась бы молча.\n\nПорядок правил: отметка табельщика сильнее расчёта; отпуск сильнее явки; нерабочий день сильнее явки; в остальные дни явка. Выходной ВНУТРИ отпуска остаётся выходным — нерабочие праздничные в счёт дней отпуска не идут (ст. 120), и табель говорит это тем же способом, что график.\n\nОграничение, названное прямо: режимов работы сервис не ведёт, поэтому «В» ставится по пятидневке производственного календаря. Сменному графику табель посчитается неверно, и до появления режимов работы такие дни правит табельщик руками.\n\nКалендарь берётся по человеку, с наследованием по дереву подразделений. Год, которого нет в региональном календаре человека, считается по году базового — без региональных праздников; такие календари названы в `fallbackCalendars`. Года нет и в базовом — табель отказывает 422 year_not_loaded, а не считает пятидневкой. Отказ — по области ДОКУМЕНТА (все люди, которых напечатает Т-13), а не страницы: страница без людей отвечает так же, как соседняя. `unloadedCalendars` устарело и приходит пустым списком; поле снимут отдельной задачей.\n\nСлед печати: если Т-13 за месяц этого юрлица уже сдавали, ответ несёт последнюю печать (номер, когда, кто) и число изменений с тех пор, а изменившиеся клетки помечены. Изменение находится по времени правки, не по сохранённой копии: отметка, поставленная или переписанная после печати, и строка графика отпусков, у которой после печати поменялись даты — плановые, фактические или дата переноса, — либо которая лежит в графике, правленном после печати (возврат в сбор, утверждение), — её дни по плановым и по фактическим датам и дни, где она стояла до каждой смены после печати (история дат строки), так что видно и куда отпуск пришёл, и откуда ушёл — при любом числе переносов, фактом или заменой набора периодов. Перенесённая строка считается один раз. Примечание, согласование и ссылка на приказ у строки изменением не считаются. Снятая отметка следа не оставляет. Считается по области документа смотрящего.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чей табель. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "Отчётный месяц, YYYY-MM. Не прислан — текущий: табельщик открывает табель ради текущего месяца чаще, чем ради любого другого."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор страницы людей из nextCursor. Неразборчивый или ни на кого не указывающий — 400 bad_request."
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^([1-9][0-9]*|none)$"
            },
            "description": "id подразделения Битрикс24 — люди его поддерева; none — люди без подразделения. Необязательное сужение поверх уровня. Неразборчивое значение — 422 bad_department."
          }
        ],
        "responses": {
          "200": {
            "description": "Табель месяца",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TimesheetResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "from": "2027-07-01",
                    "to": "2027-07-31",
                    "rows": [
                      {
                        "user": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "userName": "Иванов Иван",
                        "department": null,
                        "days": [
                          {
                            "date": "2027-07-01",
                            "code": "Я",
                            "digit": "01",
                            "hours": 8,
                            "source": "service",
                            "note": null,
                            "changed": false,
                            "outside": false
                          },
                          {
                            "date": "2027-07-03",
                            "code": "В",
                            "digit": "26",
                            "hours": 0,
                            "source": "service",
                            "note": null,
                            "changed": false,
                            "outside": false
                          },
                          {
                            "date": "2027-07-05",
                            "code": "ОТ",
                            "digit": "09",
                            "hours": 0,
                            "source": "service",
                            "note": null,
                            "changed": true,
                            "outside": false
                          },
                          {
                            "date": "2027-07-07",
                            "code": "Б",
                            "digit": "19",
                            "hours": 0,
                            "source": "manual",
                            "note": "листок № 12345",
                            "changed": true,
                            "outside": false
                          }
                        ],
                        "totals": {
                          "workedDays": 15,
                          "workedHours": 120,
                          "byCode": {
                            "Я": 15,
                            "В": 9,
                            "ОТ": 6,
                            "Б": 1
                          }
                        }
                      }
                    ],
                    "codes": [
                      {
                        "code": "Я",
                        "digit": "01",
                        "family": null
                      },
                      {
                        "code": "В",
                        "digit": "26",
                        "family": null
                      },
                      {
                        "code": "ОТ",
                        "digit": "09",
                        "family": "leave"
                      },
                      {
                        "code": "Б",
                        "digit": "19",
                        "family": "sick"
                      }
                    ],
                    "print": {
                      "number": 3,
                      "printedAt": "2027-07-30T14:40:00Z",
                      "printedBy": "Петрова Анна",
                      "changedMarks": 1,
                      "changedEntries": 1,
                      "changedEvents": 0
                    },
                    "unloadedCalendars": [],
                    "fallbackCalendars": [],
                    "printable": true,
                    "nextCursor": null,
                    "people": 1,
                    "documentPeople": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Месяц не разобран — код bad_month. Курсор не разобрался или ни на кого не указывает — код bad_request.",
            "x-error-codes": [
              "bad_month",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале нет базового производственного календаря — код no_default_calendar. Сервис заводит календарь «Россия» сам — при подключении портала и фоновым обходом, — поэтому отказ означает сбой или первые минуты после выкладки: повторите позже, а если отказ остаётся — это повод для поддержки, а не для администратора портала.",
            "x-error-codes": [
              "no_default_calendar",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Подразделение не разбирается — код bad_department. Года месяца нет ни в производственном календаре человека, ни (у регионального календаря) в базовом — код year_not_loaded с details.year (год) и details.calendar (id календаря, куда год загружать: базовый, если он есть; null — календаря нет).",
            "x-error-codes": [
              "bad_department",
              "year_not_loaded"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/timesheet/{user}/{day}": {
      "put": {
        "operationId": "appTimesheetMark",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Отметка табельщика",
        "description": "Поставить или переписать отметку на день: больничный, командировку, неявку — то, чего сервис не видел. Отметка сильнее расчёта, и это главное правило табеля: табельщик человека видел, а сервис нет.\n\nОтметка одна на человека, день и юрлицо: вторая означала бы два разных ответа о том, что было с человеком в этот день. Требует права timesheet · edit.",
        "parameters": [
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чей табель. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimesheetMarkRequest"
              },
              "example": {
                "code": "Б",
                "hours": 0,
                "note": "больничный № 12345"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Отметка поставлена"
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; день не разобран — bad_date; часы вне суток — bad_hours; основание длиннее 255 символов — bad_note. Отрезок задом наперёд или через границу месяца — bad_range.",
            "x-error-codes": [
              "bad_request",
              "bad_date",
              "bad_hours",
              "bad_note",
              "bad_range"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Человека с таким адресом нет в портале, он не состоит в юрлице хоть в один из дней, которые пишет запись (членство проверяется на каждый день, а не на первое число), либо он вне уровня правки табеля у пишущего (timesheet · edit = own или dept, а строка чужая) — код user_not_found: чужая строка отвечает так же, как несуществующая, и по ответу их не отличить. Юрлицо не найдено — not_found.",
            "x-error-codes": [
              "not_found",
              "user_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале нет базового производственного календаря — код no_default_calendar. Сервис заводит календарь «Россия» сам — при подключении портала и фоновым обходом, — поэтому отказ означает сбой или первые минуты после выкладки: повторите позже, а если отказ остаётся — это повод для поддержки, а не для администратора портала.",
            "x-error-codes": [
              "no_default_calendar",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Кода нет в каталоге формы Т-12 — код bad_code. На отрезке нечего отмечать (весь в отпуске по графику или в выходных у кода, который на них не ложится) — empty_range. Часы у кода неявки (любой код, кроме «Я») — код hours_on_absence: у неявки часов нет. Явка «Я» без часов — work_without_hours: у явки должны быть часы, «Я 0» в бланке Т-13 — день, которого не было. День раньше даты приёма или позже даты увольнения человека, а у отрезка — человек не работал ни дня из него, — not_employed. Года нет в производственном календаре этого человека и (у регионального) в базовом — year_not_loaded с details.year и details.calendar: отметка не ложится на дни, посчитанные пятидневкой. Проверяется только календарь этого человека.",
            "x-error-codes": [
              "bad_code",
              "empty_range",
              "hours_on_absence",
              "work_without_hours",
              "not_employed",
              "year_not_loaded"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appTimesheetMarkClear",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Снять отметку",
        "description": "Снять отметку: день возвращается к расчёту сервиса. Отдельная операция, а не код пустой строкой: «поставил пусто» и «не ставил ничего» — разные вещи, и вторая обязана вернуть расчёт, а не пустую клетку.",
        "parameters": [
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чей табель. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Последний день снимаемого отрезка: отрезок ставился одной формой и снимается целиком. Нет — снимается один день из адреса.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Отметка снята"
          },
          "400": {
            "description": "День не разобран — код bad_date; отрезок задом наперёд или через границу месяца — bad_range.",
            "x-error-codes": [
              "bad_date",
              "bad_range"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Человека с таким адресом нет в портале, он не состоит в юрлице хоть в один из дней, которые пишет запись (членство проверяется на каждый день, а не на первое число), либо он вне уровня правки табеля у пишущего (timesheet · edit = own или dept, а строка чужая) — код user_not_found: чужая строка отвечает так же, как несуществующая, и по ответу их не отличить. Юрлицо не найдено — not_found.",
            "x-error-codes": [
              "not_found",
              "user_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity. Повтор не поможет: юрлицо заводят на вкладке «Юрлица».",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Отрезок целиком раньше даты приёма или позже даты увольнения человека — код not_employed, тем же правилом, что у постановки. Отметка вне дней работы в табеле не видна, и снятие отрезка её не трогает: в нём снимаются только дни, когда человек работал.",
            "x-error-codes": [
              "not_employed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/timesheet/print": {
      "get": {
        "operationId": "appTimesheetPrint",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Табель бланком Т-13",
        "description": "Тот же табель, что отдаёт экранная ручка, книгой .xlsx по форме Т-13. Год без производственного календаря (нет ни у человека, ни у регионального в базовом) бланк не печатает — 422 year_not_loaded до первого байта. Считается тем же способом: два расчёта — экранный и печатный — разошлись бы в первый же день, когда правило поправят в одном месте, и разошлись бы молча.\n\nВыгрузка того, кто ведёт табель ВСЕГО юрлица (timesheet · view и timesheet · edit на уровне all), — сдача документа: сервис запоминает событие печати (кто, когда, месяц, юрлицо) и ставит в шапку номер документа, порядковый в году отчётного периода и юрлица, и дату составления — день печати. Повторная печать получает следующий номер. Копии табеля при этом не хранится (ADR 2026-09-23): что изменилось после печати, экранная ручка находит по времени правки отметок и строк графика. Выгрузка остальных — работника, руководителя, табельщика отдела — копия для себя: событием печати не считается, номера в шапке не получает и точку отсчёта «что изменилось» не сдвигает.\n\nГрафы вида оплаты и корреспондирующего счёта печатаются пустыми: расчёта зарплаты у сервиса нет, а выдуманный код в подписываемом документе хуже пустой клетки.\n\nБланк печатается целиком, и буквы «скрыто» в нём нет: если в месяц попала хотя бы одна клетка Б, Р или ОЖ, вид которой скрыт от смотрящего правилом видимости (не своя строка, просмотр ниже all, табель этого человека он не правит и портал не включил absence.kind_visible_to_dept), — 403 print_masked. Месяц без таких клеток печатается. Узнать заранее — поле printable ответа GET /api/v1/timesheet.\n\nФайл отдаётся потоком, без Content-Length. Сбой после начала передачи — статус 200 уже ушёл, и соединение обрывается: усечённое тело — не файл, его не открывать; номер документа при этом не расходуется, кроме одного случая: сбой записи центрального каталога после фиксации номера оставляет номер израсходованным (принятая цена, спека масштаба § 6). Пакетом (POST /api/v1/batch) не вызывается — batch_not_batchable: ответ-файл пакет не принимает.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо, чей табель. Не прислано — юрлицо портала по умолчанию, тем же правилом, что у графиков."
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "Отчётный месяц, YYYY-MM. Не прислан — текущий: табельщик открывает табель ради текущего месяца чаще, чем ради любого другого."
          }
        ],
        "responses": {
          "200": {
            "description": "Табель формы Т-13 книгой Excel",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Месяц не разобран — код bad_month.",
            "x-error-codes": [
              "bad_month"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/TimesheetPrintForbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не назначен базовый производственный календарь — код no_default_calendar. Повтор не поможет: администратор назначает календарь в разделе «Календарь». В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity.",
            "x-error-codes": [
              "no_default_calendar",
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "В табеле месяца нет ни одного работника, видимого вызывающему, — код no_rows. Номер документа при этом не выдаётся: пустой табель проверяется до него. Года месяца нет ни в производственном календаре человека, ни (у регионального календаря) в базовом — код year_not_loaded с details.year (год) и details.calendar (id календаря, куда год загружать: базовый, если он есть; null — календаря нет). Отказ — до первого байта бланка: календари людей документа и их месяц читаются заранее, и пачки берут дни из этой памяти.",
            "x-error-codes": [
              "no_rows",
              "year_not_loaded"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/timesheet/departments": {
      "get": {
        "operationId": "appTimesheetDepartments",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Подразделения табеля",
        "description": "Дерево подразделений области табеля месяца — только отделы людей, состоящих в юрлице хотя бы день месяца и видимых смотрящему; предок без таких людей не показывается. people узла — людей области в его поддереве, и оно равно people ответа GET /api/v1/timesheet с этим узлом в department. noDepartment — люди без подразделения (department=none).\n\nТребует права timesheet · view.",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Юрлицо табеля. Не прислано — юрлицо портала по умолчанию."
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}$"
            },
            "description": "Отчётный месяц, YYYY-MM. Не прислан — текущий месяц юрлица."
          }
        ],
        "responses": {
          "200": {
            "description": "Дерево подразделений",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DepartmentTree"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 10,
                        "parent": null,
                        "path": "/10/",
                        "name": "Склад",
                        "people": 42
                      }
                    ],
                    "noDepartment": 310
                  }
                }
              }
            }
          },
          "400": {
            "description": "Месяц не разобран — код bad_month.",
            "x-error-codes": [
              "bad_month"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Юрлицо из параметра entity не найдено — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "В портале не заведено юрлицо по умолчанию, а параметр entity не передан — код no_default_entity.",
            "x-error-codes": [
              "no_default_entity"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/notify": {
      "post": {
        "operationId": "appVacationNotify",
        "tags": [
          "График отпусков"
        ],
        "summary": "Разослать уведомления о начале отпуска",
        "description": "Уведомляет работников о начале отпуска по утверждённому графику (ст. 123 ТК: не позднее чем за две недели). График, снова стоящий в сборе после утверждения, рассылает по строкам, у которых даты те же, что при последнем утверждении (решение владелицы 03.10.2026, №17); кому даты поменяли, ответ называет списком waiting — им уйдёт при утверждении, в remaining они не входят. Уходит тем, у кого отпуск начинается в пределах окна рассылки портала и кому о этой дате ещё не сообщали. Уволенным — выключенным в Битрикс24 или по датам 1С не работающим в день начала отпуска — уведомление не уходит и в журнал не пишется: ответ называет их отдельным списком dismissed, в remaining они не входят. Тот же проход каждую ночь запускает сам сервис: кнопка нужна, чтобы не ждать ночи. Рассылает только тот, кто видит все строки графика — иначе 403 forbidden. Кнопка ограничена временем: новая строка не начинается, если до 15 секунд осталось меньше срока вызова портала и записи журнала; начатый вызов не обрывается. Что не успело — remaining. Двадцать отказов портала подряд одним кодом останавливают рассылку — stoppedCode. Отказ портала одному отправителю повторно в те же сутки юрлица не пробуется. Операция в пакет не входит.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Кому ушло, кому поздно, кому не дошло",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNotified"
                    }
                  }
                },
                "example": {
                  "data": {
                    "sent": [
                      "Иванов Иван"
                    ],
                    "late": [
                      "Петрова Анна"
                    ],
                    "noAccount": [
                      "Сидоров Пётр"
                    ],
                    "refused": [],
                    "moved": [
                      "Кузнецова Ольга"
                    ],
                    "dismissed": [],
                    "notFound": [],
                    "skipped": 0,
                    "remaining": 0,
                    "waiting": [],
                    "stoppedCode": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График ни разу не утверждали — уведомлять не о чем, код not_approved. Или у нажавшего нет личного вебхука, которым отправить, — код no_hook.",
            "x-error-codes": [
              "not_approved",
              "no_hook"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/entries/{entryId}/notify": {
      "post": {
        "operationId": "appVacationNoticeRepeat",
        "tags": [
          "График отпусков"
        ],
        "summary": "Повторить уведомление по строке графика",
        "description": "Отправляет уведомление по одной строке ещё раз. В журнале это вторая запись с отметкой «вручную», первая не подменяется. Уволенному повтор не уходит — 409 worker_dismissed. У графика, снова стоящего в сборе после утверждения, повтор уходит только по строке, у которой даты те же, что при утверждении, иначе — 409 waits_approval. Только для того, кто видит все строки графика.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "description": "public_id строки графика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Чем кончился повтор",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNoticeRepeated"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "sent"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "404": {
            "description": "Графика или строки с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "График ни разу не утверждали — уведомлять не о чем, код not_approved. Или у нажавшего нет личного вебхука, которым отправить, — код no_hook. Или работник уволен — выключен в Битрикс24 либо по датам 1С не работает в день начала отпуска, — код worker_dismissed. Или график снова в сборе, а даты строки поменяли после утверждения, — код waits_approval: уведомление уйдёт при утверждении графика (решение владелицы 03.10.2026, №17).",
            "x-error-codes": [
              "not_approved",
              "no_hook",
              "worker_dismissed",
              "waits_approval"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-schedules/{id}/notices": {
      "get": {
        "operationId": "appVacationNotices",
        "tags": [
          "График отпусков"
        ],
        "summary": "Журнал уведомлений о начале отпуска",
        "description": "Кому и когда ушло уведомление, о какой дате и чем кончилось — и по чьему отпуску оно не отправлено, потому что работника у работодателя уже нет (одна запись на отпуск). С первой страницей тому, кто рассылает, — люди графика, не найденные в Битрикс24 (notFound, notFoundTotal). НОВЫЕ СВЕРХУ, страницами: limit — записей на страницу (по умолчанию 100, предел 500), следующая — курсором nextCursor. Сужен тем же уровнем доступа, что строки графика: руководитель видит уведомления своих людей.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id графика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Курсор следующей страницы из nextCursor. Неразборчивый или ни на что не указывающий — 400 bad_request.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Записей на страницу: по умолчанию 100, больше 500 — 500. Не число или меньше 1 — 400 bad_request.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Записи журнала, новые сверху",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNoticesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "reopened": false,
                    "due": [],
                    "dueMore": false,
                    "notices": [
                      {
                        "entryId": "5d2e8a41-6c3f-4b90-8e17-a2c4f6b8d013",
                        "userName": "Иванов Иван",
                        "startsOn": "2027-07-05",
                        "endsOn": "2027-07-18",
                        "goneOn": null,
                        "about": "plan",
                        "state": "sent",
                        "manualRepeat": false,
                        "portalCode": null,
                        "sentAt": "2027-06-21T03:00:00Z",
                        "byService": true,
                        "late": false
                      }
                    ],
                    "nextCursor": null,
                    "notFound": [],
                    "notFoundTotal": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобраны — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "404": {
            "description": "Графика с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacation-notice-setting": {
      "get": {
        "operationId": "appVacationNoticeSetting",
        "tags": [
          "График отпусков"
        ],
        "summary": "Окно рассылки уведомлений портала",
        "description": "За сколько дней до начала отпуска сервис уведомляет работника. Рядом — значение по умолчанию, граница закона и предел: кадровик видит, что меняет.",
        "responses": {
          "200": {
            "description": "Окно рассылки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNoticeSetting"
                    }
                  }
                },
                "example": {
                  "data": {
                    "windowDays": 14,
                    "defaultDays": 14,
                    "legalDays": 14,
                    "maxDays": 90
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appVacationNoticeSettingSave",
        "tags": [
          "График отпусков"
        ],
        "summary": "Задать окно рассылки уведомлений",
        "description": "Меняет окно рассылки портала. Окно меньше двух недель допустимо, но такие уведомления журнал отмечает как поздние.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VacationNoticeSettingRequest"
              },
              "example": {
                "windowDays": 21
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сохранённое окно",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacationNoticeSetting"
                    }
                  }
                },
                "example": {
                  "data": {
                    "windowDays": 21,
                    "defaultDays": 14,
                    "legalDays": 14,
                    "maxDays": 90
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/VacationWriteForbidden"
          },
          "422": {
            "description": "Окно вне пределов от 1 до 90 дней — код bad_window.",
            "x-error-codes": [
              "bad_window"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios": {
      "get": {
        "operationId": "appGameScenarios",
        "tags": [
          "Геймификация"
        ],
        "summary": "Сценарии игр",
        "description": "Сезоны и слои челленджей портала, новые сверху, страницами по курсору. Отбор по отделу Б24 (departmentId), статусу и типу. Уровень права сужает список: руководитель видит сценарии своих отделов, HR — все. Уровни и задания в списке не отдаются — их несёт карточка. Требует права game_scenario · view.",
        "parameters": [
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Корневой отдел Б24 сценария."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameScenarioStatus"
            },
            "description": "Статус сценария."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameScenarioType"
            },
            "description": "Тип сценария."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии сценария. Пробелы по краям для поиска срезаются, после этого — до 120 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница сценариев",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameScenariosResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "scenarios": [
                      {
                        "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "type": "season",
                        "departmentId": 12,
                        "departmentName": "Цех № 2",
                        "departmentMissing": false,
                        "withSubdepartments": true,
                        "title": "Осенний сезон",
                        "description": "Чистота и безопасность участка",
                        "status": "active",
                        "startsOn": "2026-10-05",
                        "endsOn": "2026-11-15",
                        "weeks": 6,
                        "teamVisibility": "department",
                        "personalVisibility": "self_manager",
                        "leaderboard": false,
                        "seasonAchievementId": null,
                        "streakFreezesPerMonth": null,
                        "templateId": null,
                        "stopReason": null,
                        "points": 340,
                        "activatedAt": "2026-10-05T06:00:00Z",
                        "finishedAt": null
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его. Код invalid_value: q, sort или dir не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}": {
      "get": {
        "operationId": "appGameScenario",
        "tags": [
          "Геймификация"
        ],
        "summary": "Карточка сценария",
        "description": "Сценарий целиком: настройки, уровни с признаком «достигнут», задания по порядку, вехи серий и очки отдела. Требует права game_scenario · view; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка сценария",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameScenario"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "type": "season",
                    "departmentId": 12,
                    "departmentName": "Цех № 2",
                    "departmentMissing": false,
                    "withSubdepartments": true,
                    "title": "Осенний сезон",
                    "description": "Чистота и безопасность участка",
                    "status": "active",
                    "startsOn": "2026-10-05",
                    "endsOn": "2026-11-15",
                    "weeks": 6,
                    "teamVisibility": "department",
                    "personalVisibility": "self_manager",
                    "leaderboard": false,
                    "seasonAchievementId": null,
                    "streakFreezesPerMonth": null,
                    "templateId": null,
                    "stopReason": null,
                    "points": 340,
                    "activatedAt": "2026-10-05T06:00:00Z",
                    "finishedAt": null,
                    "tiers": [
                      {
                        "ordinal": 1,
                        "thresholdPoints": 300,
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "rewardText": null,
                        "reached": true
                      },
                      {
                        "ordinal": 2,
                        "thresholdPoints": 600,
                        "achievementId": null,
                        "rewardText": "Пицца отделу",
                        "reached": false
                      }
                    ],
                    "contracts": [
                      {
                        "code": "safety_walk",
                        "kind": "contract",
                        "title": "Обход участка",
                        "description": "",
                        "points": 20,
                        "repeat": "weekly",
                        "maxCount": null,
                        "weekNo": null,
                        "cadence": null,
                        "activeDays": null,
                        "needsConfirmation": true,
                        "rewardAchievementId": null,
                        "templateId": null,
                        "position": 1,
                        "archivedAt": null
                      }
                    ],
                    "milestones": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appGameScenarioPatch",
        "tags": [
          "Геймификация"
        ],
        "summary": "Править сценарий",
        "description": "Меняет присланные поля; поле без ключа не трогается, seasonAchievementId: null снимает ачивку сезона, tiers и milestones заменяют набор целиком. Что правится, зависит от статуса: у черновика — всё; у scheduled и active сезона — название, описание, видимость, продление на целые недели и уровни выше достигнутого; у active слоя — название, описание, видимость, заморозки и вехи; дальше — только название и описание. Поле не по статусу — 409 invalid_transition с details.field. Ответ — карточка. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameScenarioPatchRequest"
              },
              "example": {
                "title": "Осенний сезон — финал",
                "weeks": 8
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сценарий исправлен — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameScenario"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "type": "season",
                    "departmentId": 12,
                    "departmentName": "Цех № 2",
                    "departmentMissing": false,
                    "withSubdepartments": true,
                    "title": "Осенний сезон",
                    "description": "Чистота и безопасность участка",
                    "status": "active",
                    "startsOn": "2026-10-05",
                    "endsOn": "2026-11-15",
                    "weeks": 6,
                    "teamVisibility": "department",
                    "personalVisibility": "self_manager",
                    "leaderboard": false,
                    "seasonAchievementId": null,
                    "streakFreezesPerMonth": null,
                    "templateId": null,
                    "stopReason": null,
                    "points": 340,
                    "activatedAt": "2026-10-05T06:00:00Z",
                    "finishedAt": null,
                    "tiers": [
                      {
                        "ordinal": 1,
                        "thresholdPoints": 300,
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "rewardText": null,
                        "reached": true
                      },
                      {
                        "ordinal": 2,
                        "thresholdPoints": 600,
                        "achievementId": null,
                        "rewardText": "Пицца отделу",
                        "reached": false
                      }
                    ],
                    "contracts": [
                      {
                        "code": "safety_walk",
                        "kind": "contract",
                        "title": "Обход участка",
                        "description": "",
                        "points": 20,
                        "repeat": "weekly",
                        "maxCount": null,
                        "weekNo": null,
                        "cadence": null,
                        "activeDays": null,
                        "needsConfirmation": true,
                        "rewardAchievementId": null,
                        "templateId": null,
                        "position": 1,
                        "archivedAt": null
                      }
                    ],
                    "milestones": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScenarioWriteForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код invalid_transition — поле не правится в текущем статусе (details.field) или достигнутый уровень тронут. Код season_overlap — продление пересекает другой сезон отдела. Код achievement_source_mismatch — наградой (ачивка сезона, уровня, вехи серии, задания) может быть только достижение источника manual; details.field называет ссылку. Отказ идёт после проверок существования, архива и прав на ачивку; неизменённая ссылка, сохранённая раньше, правке не мешает.",
            "x-error-codes": [
              "invalid_transition",
              "season_overlap",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false,
                        "details": {
                          "field": "tiers[0].achievementId"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Поле не прошло проверки; details.field называет его. Коды scenario_invalid, starts_in_past, season_too_long, tier_thresholds_invalid, leaderboard_needs_visibility, achievement_archived — как при создании.",
            "x-error-codes": [
              "scenario_invalid",
              "starts_in_past",
              "season_too_long",
              "tier_thresholds_invalid",
              "leaderboard_needs_visibility",
              "achievement_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appGameScenarioDelete",
        "tags": [
          "Геймификация"
        ],
        "summary": "Удалить черновик",
        "description": "Удаляет сценарий в статусе draft вместе с уровнями и заданиями. Запущенный сценарий не удаляется — его останавливают. Требует права game_scenario · delete; уровень сужает: сценарий вне уровня отвечает 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "responses": {
          "204": {
            "description": "Черновик удалён"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Сценарий не черновик — код invalid_transition.",
            "x-error-codes": [
              "invalid_transition"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/start": {
      "post": {
        "operationId": "appGameScenarioStart",
        "tags": [
          "Геймификация"
        ],
        "summary": "Запустить сценарий",
        "description": "Переводит черновик сезона в scheduled (начало в будущем) или active (начало сегодня), черновик слоя — в active. Даты сезона сверяются с другими сезонами того же корня под замком. Тела нет. Ответ — карточка. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "responses": {
          "200": {
            "description": "Сценарий запущен — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameScenario"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "type": "season",
                    "departmentId": 12,
                    "departmentName": "Цех № 2",
                    "departmentMissing": false,
                    "withSubdepartments": true,
                    "title": "Осенний сезон",
                    "description": "Чистота и безопасность участка",
                    "status": "active",
                    "startsOn": "2026-10-05",
                    "endsOn": "2026-11-15",
                    "weeks": 6,
                    "teamVisibility": "department",
                    "personalVisibility": "self_manager",
                    "leaderboard": false,
                    "seasonAchievementId": null,
                    "streakFreezesPerMonth": null,
                    "templateId": null,
                    "stopReason": null,
                    "points": 340,
                    "activatedAt": "2026-10-05T06:00:00Z",
                    "finishedAt": null,
                    "tiers": [
                      {
                        "ordinal": 1,
                        "thresholdPoints": 300,
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "rewardText": null,
                        "reached": true
                      },
                      {
                        "ordinal": 2,
                        "thresholdPoints": 600,
                        "achievementId": null,
                        "rewardText": "Пицца отделу",
                        "reached": false
                      }
                    ],
                    "contracts": [
                      {
                        "code": "safety_walk",
                        "kind": "contract",
                        "title": "Обход участка",
                        "description": "",
                        "points": 20,
                        "repeat": "weekly",
                        "maxCount": null,
                        "weekNo": null,
                        "cadence": null,
                        "activeDays": null,
                        "needsConfirmation": true,
                        "rewardAchievementId": null,
                        "templateId": null,
                        "position": 1,
                        "archivedAt": null
                      }
                    ],
                    "milestones": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код invalid_transition — сценарий не черновик. Код season_overlap — даты пересекают другой сезон отдела.",
            "x-error-codes": [
              "invalid_transition",
              "season_overlap"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Начало сезона уже в прошлом — код starts_in_past.",
            "x-error-codes": [
              "starts_in_past"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/stop": {
      "post": {
        "operationId": "appGameScenarioStop",
        "tags": [
          "Геймификация"
        ],
        "summary": "Остановить сценарий",
        "description": "Останавливает draft, scheduled или active сценарий с причиной. Ждущие заявки отклоняются с причиной scenario_stopped, журнал остаётся, ачивки сезона не вручаются. Ответ — карточка. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameReasonRequest"
              },
              "example": {
                "reason": "Отдел расформирован"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Сценарий остановлен — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameScenario"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "type": "season",
                    "departmentId": 12,
                    "departmentName": "Цех № 2",
                    "departmentMissing": false,
                    "withSubdepartments": true,
                    "title": "Осенний сезон",
                    "description": "Чистота и безопасность участка",
                    "status": "stopped",
                    "startsOn": "2026-10-05",
                    "endsOn": "2026-11-15",
                    "weeks": 6,
                    "teamVisibility": "department",
                    "personalVisibility": "self_manager",
                    "leaderboard": false,
                    "seasonAchievementId": null,
                    "streakFreezesPerMonth": null,
                    "templateId": null,
                    "stopReason": "Отдел расформирован",
                    "points": 340,
                    "activatedAt": "2026-10-05T06:00:00Z",
                    "finishedAt": null,
                    "tiers": [
                      {
                        "ordinal": 1,
                        "thresholdPoints": 300,
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "rewardText": null,
                        "reached": true
                      },
                      {
                        "ordinal": 2,
                        "thresholdPoints": 600,
                        "achievementId": null,
                        "rewardText": "Пицца отделу",
                        "reached": false
                      }
                    ],
                    "contracts": [
                      {
                        "code": "safety_walk",
                        "kind": "contract",
                        "title": "Обход участка",
                        "description": "",
                        "points": 20,
                        "repeat": "weekly",
                        "maxCount": null,
                        "weekNo": null,
                        "cadence": null,
                        "activeDays": null,
                        "needsConfirmation": true,
                        "rewardAchievementId": null,
                        "templateId": null,
                        "position": 1,
                        "archivedAt": null
                      }
                    ],
                    "milestones": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Сценарий уже завершён или остановлен — код invalid_transition.",
            "x-error-codes": [
              "invalid_transition"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Причина пуста или длиннее 500 символов — код scenario_invalid, details.field = reason.",
            "x-error-codes": [
              "scenario_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/contracts": {
      "post": {
        "operationId": "appGameContractAdd",
        "tags": [
          "Геймификация"
        ],
        "summary": "Добавить задание",
        "description": "Добавляет задание в конец сценария: контракт сезона или челлендж слоя — вид по типу сценария. Сценарий — черновик или идущий. При строгом режиме HR — только из библиотеки (templateId), иначе 403 catalog_only. Ответ — задание. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameContractWrite"
              },
              "example": {
                "code": "idea",
                "title": "Идея по улучшению",
                "points": 50,
                "repeat": "limited",
                "maxCount": 3
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Задание добавлено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameContract"
                    }
                  }
                },
                "example": {
                  "data": {
                    "code": "idea",
                    "kind": "contract",
                    "title": "Идея по улучшению",
                    "description": "",
                    "points": 50,
                    "repeat": "limited",
                    "maxCount": 3,
                    "weekNo": null,
                    "cadence": null,
                    "activeDays": null,
                    "needsConfirmation": true,
                    "rewardAchievementId": null,
                    "templateId": null,
                    "position": 2,
                    "archivedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameContractAddForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Сценарий завершён или остановлен — код invalid_transition. Код achievement_source_mismatch — наградой (ачивка сезона, уровня, вехи серии, задания) может быть только достижение источника manual; details.field называет ссылку. Отказ идёт после проверок существования, архива и прав на ачивку; неизменённая ссылка, сохранённая раньше, правке не мешает. Ссылка из применённого шаблона задания судится так же.",
            "x-error-codes": [
              "invalid_transition",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false,
                        "details": {
                          "field": "rewardAchievementId"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код contract_invalid — недопустимое сочетание полей или занятый код (details.field). Код scenario_invalid — у сценария уже предел заданий. Код achievement_archived — ачивка-награда в архиве.",
            "x-error-codes": [
              "contract_invalid",
              "scenario_invalid",
              "achievement_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/contracts/{code}": {
      "patch": {
        "operationId": "appGameContractPatch",
        "tags": [
          "Геймификация"
        ],
        "summary": "Править задание",
        "description": "Правит название, описание, очки, проверку, ачивку-награду (null снимает), дни дневного челленджа и архив (archived). Вид, код, повтор, неделя и ритм после добавления не меняются: другое задание — архив и новое. У закрывающегося, завершённого и остановленного сценария — только название и описание. Правка очков прошлых зачётов не меняет. Ответ — задание. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_-]{1,64}$"
            },
            "description": "Код задания в сценарии."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameContractPatchRequest"
              },
              "example": {
                "points": 25,
                "archived": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Задание исправлено",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameContract"
                    }
                  }
                },
                "example": {
                  "data": {
                    "code": "safety_walk",
                    "kind": "contract",
                    "title": "Обход участка",
                    "description": "",
                    "points": 25,
                    "repeat": "weekly",
                    "maxCount": null,
                    "weekNo": null,
                    "cadence": null,
                    "activeDays": null,
                    "needsConfirmation": true,
                    "rewardAchievementId": null,
                    "templateId": null,
                    "position": 1,
                    "archivedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScenarioWriteForbidden"
          },
          "404": {
            "description": "Сценария или задания с таким кодом нет, либо сценарий вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Поле не правится в текущем статусе сценария — код invalid_transition, details.field называет поле. Код achievement_source_mismatch — наградой (ачивка сезона, уровня, вехи серии, задания) может быть только достижение источника manual; details.field называет ссылку. Отказ идёт после проверок существования, архива и прав на ачивку; неизменённая ссылка, сохранённая раньше, правке не мешает.",
            "x-error-codes": [
              "invalid_transition",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false,
                        "details": {
                          "field": "rewardAchievementId"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код contract_invalid — поле задания вне допустимого (details.field). Код scenario_invalid — возврат из архива сверх предела заданий. Код achievement_archived — ачивка-награда в архиве.",
            "x-error-codes": [
              "contract_invalid",
              "scenario_invalid",
              "achievement_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/people": {
      "get": {
        "operationId": "appGameScenarioPeople",
        "tags": [
          "Геймификация"
        ],
        "summary": "Люди охвата сценария",
        "description": "Активные люди корневого отдела сценария (с подотделами, если сценарий их включает) по текущей оргструктуре — для выбора игроков зачёта, с поиском по ФИО (q). По возрастанию b24UserId; курсор — b24UserId последнего отданного, он же в nextCursor. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня отвечает 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Поиск по ФИО: слова через пробел, каждое — часть фамилии или имени; применяются первые три."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница людей охвата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCoveragePeople"
                    }
                  }
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "b24UserId": 4512,
                        "lastName": "Иванов",
                        "firstName": "Иван"
                      }
                    ],
                    "nextCursor": "4512"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: курсор или limit не разобрались. Код invalid_value: строка поиска длиннее 100 символов — details.field = q.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Оргструктура портала ещё не загружена — код org_snapshot_missing.",
            "x-error-codes": [
              "org_snapshot_missing"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/credits": {
      "post": {
        "operationId": "appGameCreditRecord",
        "tags": [
          "Геймификация"
        ],
        "summary": "Засчитать задание",
        "description": "Атомарный зачёт задания contractCode одному или нескольким игрокам (до 50): любой отказ по любому элементу отклоняет весь вызов, details.index — номер элемента. Игрок — b24UserId или playerId; userId в этой поставке отклоняется кодом player_unknown. occurredOn — по умолчанию сегодня в поясе игр.\n\nИдемпотентность — по externalId элемента: повтор с тем же телом элемента возвращает найденную запись в её текущем статусе, с другим — 409 external_id_conflict. Ответ — записи в порядке элементов: 201, если создана хоть одна, иначе 200. Задание с проверкой, засчитанное руководителем или ключом, подтверждено сразу. Требует права game_scenario · edit; уровень сужает: сценарий вне уровня отвечает 404. Ответ перечитывается под game_scenario · view: ключ, у которого правка шире просмотра, зачёт запишет, но получит 404 — повтор такого вызова без externalId запишет зачёт ещё раз, поэтому интеграции передают externalId, и повтор безопасен.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameCreditRequest"
              },
              "example": {
                "contractCode": "safety_walk",
                "occurredOn": "2026-10-12",
                "comment": "Обход участка 3",
                "players": [
                  {
                    "b24UserId": 4512,
                    "externalId": "1c:doc:000123"
                  },
                  {
                    "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "externalId": "1c:doc:000124"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Все записи найдены по externalId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCreditsResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "credits": [
                      {
                        "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                        "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "contractCode": "safety_walk",
                        "contractTitle": "Обход участка",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "points": 20,
                        "occurredOn": "2026-10-12",
                        "source": "api",
                        "status": "confirmed",
                        "externalId": "1c:doc:000123",
                        "comment": "Обход участка 3",
                        "reason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "201": {
            "description": "Создана хоть одна запись",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCreditsResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "credits": [
                      {
                        "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                        "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "contractCode": "safety_walk",
                        "contractTitle": "Обход участка",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "points": 20,
                        "occurredOn": "2026-10-12",
                        "source": "api",
                        "status": "confirmed",
                        "externalId": "1c:doc:000123",
                        "comment": "Обход участка 3",
                        "reason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameCreditWriteForbidden"
          },
          "404": {
            "description": "Сценария нет, он вне уровня смотрящего или в нём нет задания с таким кодом — код not_found. Ключу, у которого game_scenario · edit шире view, 404 приходит и после записи: зачёт уже сохранён, а ответ перечитывается под view — повторяйте вызов с теми же externalId.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код scenario_not_active — сценарий не идёт. Код contract_limit_reached — предел повторов задания у игрока выбран. Код external_id_conflict — externalId уже использован с другим телом элемента. Код org_snapshot_missing — оргструктура не загружена. details.index — номер элемента. Код achievement_source_mismatch — награда задания — достижение источника hrm или external, а зачёт вручает только manual: вызов отклонён целиком, до проверок игроков и очков.",
            "x-error-codes": [
              "scenario_not_active",
              "contract_limit_reached",
              "external_id_conflict",
              "org_snapshot_missing",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Элемент или поле вызова не принято; details.index — номер элемента, details.field — поле. Код credit_invalid — число элементов, комментарий или externalId вне допустимого. Код contract_archived — задание в архиве. Код contract_period_closed — день вне дат задания. Код occurred_in_future — день не наступил. Код player_unknown — игрок не найден или передан userId. Код player_not_in_scenario — человек вне охвата (details.hint). Код player_inactive — уволен или пропал из оргструктуры. Код duplicate_item — игрок повторён.",
            "x-error-codes": [
              "credit_invalid",
              "contract_archived",
              "contract_period_closed",
              "occurred_in_future",
              "player_unknown",
              "player_not_in_scenario",
              "player_inactive",
              "duplicate_item"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appGameCredits",
        "tags": [
          "Геймификация"
        ],
        "summary": "Журнал зачётов",
        "description": "Записи журнала сценария, новые сверху, страницами по курсору; отбор по статусу, игроку (playerId) и коду задания. Неизвестные игрок и задание дают пустую страницу. Требует права game_scenario · view; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameCreditStatus"
            },
            "description": "Статус записи."
          },
          {
            "name": "playerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id игрока."
          },
          {
            "name": "contractCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Код задания."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница журнала",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCreditsPage"
                    }
                  }
                },
                "example": {
                  "data": {
                    "credits": [
                      {
                        "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                        "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "contractCode": "safety_walk",
                        "contractTitle": "Обход участка",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "points": 20,
                        "occurredOn": "2026-10-12",
                        "source": "api",
                        "status": "confirmed",
                        "externalId": "1c:doc:000123",
                        "comment": "Обход участка 3",
                        "reason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/credits/{id}/confirm": {
      "post": {
        "operationId": "appGameCreditConfirm",
        "tags": [
          "Геймификация"
        ],
        "summary": "Подтвердить заявку",
        "description": "Ждущая заявка игрока становится подтверждённым зачётом с очками. Подтверждающий — не сам игрок (403 self_credit); сценарий — active или closing. Тела нет. Ответ — запись. Требует права game_scenario · edit на сценарий записи; вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id записи журнала."
          }
        ],
        "responses": {
          "200": {
            "description": "Заявка подтверждена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCredit"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                    "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "contractCode": "safety_walk",
                    "contractTitle": "Обход участка",
                    "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "b24UserId": 4512,
                    "playerName": "Иванов Иван Петрович",
                    "points": 20,
                    "occurredOn": "2026-10-12",
                    "source": "claim",
                    "status": "confirmed",
                    "externalId": "1c:doc:000123",
                    "comment": "Обход участка 3",
                    "reason": null,
                    "createdAt": "2026-10-12T09:15:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameCreditWriteForbidden"
          },
          "404": {
            "description": "Записи с таким id нет или её сценарий вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код invalid_transition — запись не ждёт решения. Код scenario_not_active — сценарий не идёт. Код achievement_source_mismatch — награда задания заявки — достижение источника hrm или external: заявка остаётся ждать, очков и вручения нет.",
            "x-error-codes": [
              "invalid_transition",
              "scenario_not_active",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/credits/{id}/reject": {
      "post": {
        "operationId": "appGameCreditReject",
        "tags": [
          "Геймификация"
        ],
        "summary": "Отклонить заявку",
        "description": "Ждущая заявка отклоняется с причиной; слот повтора освобождается. Ответ — запись. Требует права game_scenario · edit на сценарий записи; вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id записи журнала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameReasonRequest"
              },
              "example": {
                "reason": "Нет фото обхода"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Заявка отклонена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCredit"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                    "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "contractCode": "safety_walk",
                    "contractTitle": "Обход участка",
                    "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "b24UserId": 4512,
                    "playerName": "Иванов Иван Петрович",
                    "points": 20,
                    "occurredOn": "2026-10-12",
                    "source": "claim",
                    "status": "rejected",
                    "externalId": "1c:doc:000123",
                    "comment": "Обход участка 3",
                    "reason": "Нет фото обхода",
                    "createdAt": "2026-10-12T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Записи с таким id нет или её сценарий вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Запись не ждёт решения — код invalid_transition.",
            "x-error-codes": [
              "invalid_transition"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Причина пуста или длиннее 500 символов — код credit_invalid, details.field = reason.",
            "x-error-codes": [
              "credit_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/credits/{id}/reverse": {
      "post": {
        "operationId": "appGameCreditReverse",
        "tags": [
          "Геймификация"
        ],
        "summary": "Сторнировать зачёт",
        "description": "Подтверждённый зачёт сторнируется с причиной: очки снимаются, достигнутые уровни, награды, серии и ачивки остаются. Сценарий — active или closing. Новый зачёт после сторно — с новым externalId. Ответ — запись. Требует права game_scenario · edit на сценарий записи; вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id записи журнала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameReasonRequest"
              },
              "example": {
                "reason": "Отметили по ошибке"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Зачёт сторнирован",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCredit"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                    "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "contractCode": "safety_walk",
                    "contractTitle": "Обход участка",
                    "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "b24UserId": 4512,
                    "playerName": "Иванов Иван Петрович",
                    "points": 20,
                    "occurredOn": "2026-10-12",
                    "source": "api",
                    "status": "reversed",
                    "externalId": "1c:doc:000123",
                    "comment": "Обход участка 3",
                    "reason": "Отметили по ошибке",
                    "createdAt": "2026-10-12T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Записи с таким id нет или её сценарий вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код invalid_transition — зачёт не подтверждён. Код scenario_not_active — сценарий не идёт.",
            "x-error-codes": [
              "invalid_transition",
              "scenario_not_active"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Причина пуста или длиннее 500 символов — код credit_invalid, details.field = reason.",
            "x-error-codes": [
              "credit_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/scenarios/{id}/rewards": {
      "get": {
        "operationId": "appGameRewards",
        "tags": [
          "Геймификация"
        ],
        "summary": "Награды уровней",
        "description": "Награды достигнутых уровней сезона по порядку уровней: когда достигнут, текст реальной награды и отметка выдачи. Награда создаётся всегда, когда очки отдела впервые достигают порога; сторно её не отбирает. Требует права game_scenario · view; уровень сужает: сценарий вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id сценария."
          }
        ],
        "responses": {
          "200": {
            "description": "Награды уровней",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameRewardsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "rewards": [
                      {
                        "id": "7e6d5c4b-3a29-4180-9f7e-6d5c4b3a2918",
                        "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "ordinal": 2,
                        "thresholdPoints": 600,
                        "rewardText": "Пицца отделу",
                        "achievementId": null,
                        "reachedAt": "2026-10-20T11:00:00Z",
                        "status": "issued",
                        "issuedAt": "2026-10-23T15:00:00Z",
                        "issuedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "issueNote": "В пятницу"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Сценария с таким id нет или он вне уровня смотрящего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/rewards/{id}/issue": {
      "post": {
        "operationId": "appGameRewardIssue",
        "tags": [
          "Геймификация"
        ],
        "summary": "Отметить выдачу награды",
        "description": "Отмечает, что реальная награда уровня выдана: кто и когда, с необязательной отметкой note до 500 символов. Только у уровня с rewardText и один раз — иначе 409 reward_not_issuable; сезон — active или closing. Тело необязательно. Ответ — награда. Требует права game_scenario · edit на сценарий награды; вне уровня — 404.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id награды уровня."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameRewardIssueRequest"
              },
              "example": {
                "note": "В пятницу"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Выдача отмечена",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameReward"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7e6d5c4b-3a29-4180-9f7e-6d5c4b3a2918",
                    "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "ordinal": 2,
                    "thresholdPoints": 600,
                    "rewardText": "Пицца отделу",
                    "achievementId": null,
                    "reachedAt": "2026-10-20T11:00:00Z",
                    "status": "issued",
                    "issuedAt": "2026-10-23T15:00:00Z",
                    "issuedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "issueNote": "В пятницу"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameScopedWriteForbidden"
          },
          "404": {
            "description": "Награды с таким id нет или её сценарий вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код reward_not_issuable — у уровня нет rewardText или награда уже выдана. Код scenario_not_active — сезон не идёт.",
            "x-error-codes": [
              "reward_not_issuable",
              "scenario_not_active"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Отметка длиннее 500 символов — код scenario_invalid, details.field = note.",
            "x-error-codes": [
              "scenario_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/approvals": {
      "get": {
        "operationId": "appGameApprovals",
        "tags": [
          "Геймификация"
        ],
        "summary": "Очередь заявок",
        "description": "Ждущие заявки игроков, которые смотрящий может решить: сценарий в его уровне правки, заявка не его собственная. Старые сверху, страницами по курсору. Требует права game_scenario · edit.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии сценария заявки (scenarioTitle); sort=alpha — по названию сценария, затем по id заявки. Пробелы по краям для поиска срезаются, после этого — до 120 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница заявок",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameApprovalsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "approvals": [
                      {
                        "id": "4c3b2a19-0f8e-4d7c-9b6a-5f4e3d2c1b0a",
                        "scenarioId": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "contractCode": "safety_walk",
                        "contractTitle": "Обход участка",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "points": 20,
                        "occurredOn": "2026-10-12",
                        "source": "claim",
                        "status": "pending",
                        "externalId": null,
                        "comment": null,
                        "reason": null,
                        "createdAt": "2026-10-12T09:15:00Z",
                        "scenarioTitle": "Осенний сезон",
                        "scenarioType": "season"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобрались — код bad_request. Код invalid_value: q, sort или dir не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievements": {
      "get": {
        "operationId": "appGameAchievements",
        "tags": [
          "Геймификация"
        ],
        "summary": "Ачивки",
        "description": "Определения ачивок портала со сводкой holders (сколько людей держат ачивку), новые сверху, страницами по курсору. Отбор по отделу Б24 (departmentId) и архиву (archived). Уровень права сужает список: на уровне «отдел» видны ачивки своих отделов и созданные смотрящим, ачивки компании — только на уровне «все». Требует права game_achievement · view. Отбор по набору (setId), поиск по названию (q) и алфавитный порядок (sort, dir). Отбор по источнику результата (resultSource).",
        "parameters": [
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Отдел Б24 ачивки."
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "true — только архивные, false — только живые; без параметра — все."
          },
          {
            "name": "setId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Только ачивки набора. Неразборчивый id — 400 invalid_value; неизвестный или чужой набор — пустая страница."
          },
          {
            "name": "resultSource",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hrm",
                "manual",
                "external"
              ]
            },
            "example": "manual",
            "description": "Только определения этого источника результата. Не больше одного раза; другое значение (и пустое) или повтор — 400 invalid_value, details.field — resultSource. Отбор — до страницы и курсора, сочетается с остальными отборами, поиском и порядком."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии ачивки. Пробелы по краям для поиска срезаются, после этого — до 60 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница ачивок",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAchievementsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "achievements": [
                      {
                        "id": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "departmentId": null,
                        "title": "Наставник квартала",
                        "description": "Помог новичку освоиться за первый месяц",
                        "appearance": {
                          "v": 1,
                          "shape": "medal",
                          "fill": {
                            "from": "blue",
                            "to": "indigo"
                          },
                          "icon": "crown",
                          "ribbon": "Наставник"
                        },
                        "rarity": "gold",
                        "repeatable": true,
                        "maxVisibility": "company",
                        "holders": 12,
                        "archivedAt": null,
                        "setId": "8d2c1b0a-9f8e-4d6c-8b5a-2b9e8d7c6b5a",
                        "origin": "custom",
                        "builtinCode": null,
                        "resultSource": "manual",
                        "ruleCode": null,
                        "conditionText": "Вручную по решению уполномоченного сотрудника.",
                        "companyExplanation": "",
                        "enabled": true,
                        "hideEarned": false,
                        "sourceState": "ready",
                        "sourceMessage": null
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его. Код invalid_value: q, sort, dir или resultSource не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievements/{id}": {
      "get": {
        "operationId": "appGameAchievement",
        "tags": [
          "Геймификация"
        ],
        "summary": "Ачивка",
        "description": "Определение ачивки со сводкой holders. Требует права game_achievement · view; уровень сужает: ачивка вне уровня смотрящего отвечает 404, а не 403.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id ачивки."
          }
        ],
        "responses": {
          "200": {
            "description": "Ачивка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAchievement"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "departmentId": null,
                    "title": "Наставник квартала",
                    "description": "Помог новичку освоиться за первый месяц",
                    "appearance": {
                      "v": 1,
                      "shape": "medal",
                      "fill": {
                        "from": "blue",
                        "to": "indigo"
                      },
                      "icon": "crown",
                      "ribbon": "Наставник"
                    },
                    "rarity": "gold",
                    "repeatable": true,
                    "maxVisibility": "company",
                    "holders": 12,
                    "archivedAt": null,
                    "setId": "8d2c1b0a-9f8e-4d6c-8b5a-2b9e8d7c6b5a",
                    "origin": "custom",
                    "builtinCode": null,
                    "resultSource": "manual",
                    "ruleCode": null,
                    "conditionText": "Вручную по решению уполномоченного сотрудника.",
                    "companyExplanation": "",
                    "enabled": true,
                    "hideEarned": false,
                    "sourceState": "ready",
                    "sourceMessage": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Ачивки с таким id нет или она вне уровня смотрящего — код not_found. Чужая и несуществующая отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievements/{id}/awards": {
      "post": {
        "operationId": "appGameAchievementAward",
        "tags": [
          "Геймификация"
        ],
        "summary": "Вручить ачивку",
        "description": "Атомарное вручение ачивки одному или нескольким получателям (до 50): любой отказ по любому элементу отклоняет весь вызов, details.index — номер элемента. Получатель — b24UserId или playerId; userId в этой поставке отклоняется кодом player_unknown. Получатель — активный человек оргструктуры в охвате вручающего по game_award · edit (руководитель — люди своих отделов с подотделами); ачивка — компании или та, которую вручающий может править. Себе не вручают. awardedOn — по умолчанию сегодня в поясе игр.\n\nИдемпотентность — по externalId элемента: повтор с тем же телом элемента возвращает найденное вручение в его текущем статусе, с другим — 409 external_id_conflict. Ответ — вручения в порядке получателей: 201, если создано хоть одно, иначе 200. Требует права game_award · edit; ачивка вне уровня game_achievement · view отвечает 404. Отключённое определение (жизненный цикл, enabled: false) или определение, чей текущий интервал включения не покрывает момент вручения, отвечает 409 achievement_disabled до записи; включённость судится в момент коммита, awardedOn — только дата показа. Порядок отказов: повтор по externalId (200 с прежним вручением, в том числе ключу без gameScope) → архивная (422 achievement_archived) → achievement_out_of_scope → область ключа (403 game_scope_denied: по ключу вручается только собственное external-достижение из gameScope ключа с явным потолком) → источник (409 achievement_source_mismatch: hrm руками не вручается) → отказы получателей → отключённое (409 achievement_disabled).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id ачивки."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameAwardRequest"
              },
              "example": {
                "comment": "Наставник квартала",
                "awardedOn": "2026-10-12",
                "recipients": [
                  {
                    "b24UserId": 4512,
                    "externalId": "lms:course:77:4512"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Все вручения найдены по externalId",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAwardsResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "awards": [
                      {
                        "id": "5d4c3b2a-1908-4f7e-8d6c-5b4a39281706",
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "achievementTitle": "Наставник квартала",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "source": "api",
                        "awardedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "comment": "Наставник квартала",
                        "externalId": "lms:course:77:4512",
                        "awardedOn": "2026-10-12",
                        "visibility": null,
                        "status": "active",
                        "revokedAt": null,
                        "revokedBy": null,
                        "revokeReason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "201": {
            "description": "Создано хоть одно вручение",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAwardsResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "awards": [
                      {
                        "id": "5d4c3b2a-1908-4f7e-8d6c-5b4a39281706",
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "achievementTitle": "Наставник квартала",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "source": "api",
                        "awardedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "comment": "Наставник квартала",
                        "externalId": "lms:course:77:4512",
                        "awardedOn": "2026-10-12",
                        "visibility": null,
                        "status": "active",
                        "revokedAt": null,
                        "revokedBy": null,
                        "revokeReason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameAwardWriteForbidden"
          },
          "404": {
            "description": "Ачивки с таким id нет или она вне уровня смотрящего — код not_found. Чужая и несуществующая отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код achievement_already_awarded — неповторяемая ачивка у получателя уже есть. Код external_id_conflict — externalId уже использован с другим телом элемента. details.index — номер элемента. Код achievement_disabled — определение отключено или момент вручения вне его текущего интервала включения; повтор по externalId уже сделанного вручения отвечает 200 раньше этого отказа. Код achievement_source_mismatch — источник определения не допускает ручного вручения (hrm вручает только автоматический зачёт HRM); отказ идёт после прав на ачивку и раньше проверок получателей и achievement_disabled.",
            "x-error-codes": [
              "achievement_already_awarded",
              "achievement_disabled",
              "external_id_conflict",
              "achievement_source_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "achievement_disabled": {
                    "value": {
                      "error": {
                        "code": "achievement_disabled",
                        "message": "достижение отключено: новые вручения не принимаются",
                        "retryable": false
                      }
                    }
                  },
                  "achievement_already_awarded": {
                    "value": {
                      "error": {
                        "code": "achievement_already_awarded",
                        "message": "эта ачивка у человека уже есть",
                        "retryable": false,
                        "details": {
                          "index": 0
                        }
                      }
                    }
                  },
                  "external_id_conflict": {
                    "value": {
                      "error": {
                        "code": "external_id_conflict",
                        "message": "externalId уже использован с другими данными",
                        "retryable": false,
                        "details": {
                          "index": 0
                        }
                      }
                    }
                  },
                  "achievement_source_mismatch": {
                    "value": {
                      "error": {
                        "code": "achievement_source_mismatch",
                        "message": "источник достижения не допускает этот способ вручения",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Элемент или поле вызова не принято; details.index — номер элемента, details.field — поле. Код award_invalid — число получателей, комментарий или externalId вне допустимого. Код achievement_archived — ачивка в архиве. Код occurred_in_future — awardedOn ещё не наступил. Код player_unknown — получатель не найден или передан userId. Код player_inactive — уволен или пропал из оргструктуры. Код duplicate_item — получатель повторён.",
            "x-error-codes": [
              "award_invalid",
              "achievement_archived",
              "occurred_in_future",
              "player_unknown",
              "player_inactive",
              "duplicate_item"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/awards": {
      "get": {
        "operationId": "appGameAwards",
        "tags": [
          "Геймификация"
        ],
        "summary": "Журнал вручений",
        "description": "Вручения ачивок портала, новые сверху, страницами по курсору: ручные, по ключу и автоматические (задание, серия, уровень, сезон), включая отозванные. Отбор по ачивке, получателю (playerId или b24UserId), источнику и статусу; неизвестные ачивка и игрок дают пустую страницу. Уровень права сужает журнал: на уровне «отдел» — вручения людям своих отделов и сделанные смотрящим. Требует права game_award · view.",
        "parameters": [
          {
            "name": "achievementId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id ачивки."
          },
          {
            "name": "playerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id получателя."
          },
          {
            "name": "b24UserId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Получатель — человек Б24."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameAwardSource"
            },
            "description": "Источник вручения."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/GameAwardStatus"
            },
            "description": "Статус вручения."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница журнала вручений",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAwardsPage"
                    }
                  }
                },
                "example": {
                  "data": {
                    "awards": [
                      {
                        "id": "5d4c3b2a-1908-4f7e-8d6c-5b4a39281706",
                        "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "achievementTitle": "Наставник квартала",
                        "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                        "b24UserId": 4512,
                        "playerName": "Иванов Иван Петрович",
                        "source": "api",
                        "awardedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                        "comment": "Наставник квартала",
                        "externalId": "lms:course:77:4512",
                        "awardedOn": "2026-10-12",
                        "visibility": null,
                        "status": "active",
                        "revokedAt": null,
                        "revokedBy": null,
                        "revokeReason": null,
                        "createdAt": "2026-10-12T09:15:00Z"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: тело, курсор или limit не разобрались. Код invalid_value: значение параметра или поля не принято — details.field называет его.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/GameReadUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/awards/{id}/revoke": {
      "post": {
        "operationId": "appGameAwardRevoke",
        "tags": [
          "Геймификация"
        ],
        "summary": "Отозвать вручение",
        "description": "Отзывает активное вручение с причиной: с витрины оно исчезает, в журнале остаётся. Отзывает человек с правом вручения на получателя (охват — по получателю, а не по тому, кто вручал); своё вручение получатель не отзывает — спрятать его можно сужением видимости. Автоматически ничего не отзывается. Ответ — вручение. Требует права game_award · edit; вручение вне уровня отвечает 404. По ключу API отзывается только вручение собственного external-достижения из gameScope ключа (ключ с явным потолком), в том числе достижения, ушедшего в архив после сохранения ключа; остальные — 403 game_scope_denied, после проверок охвата и своего вручения.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id вручения."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameReasonRequest"
              },
              "example": {
                "reason": "Вручили по ошибке"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Вручение отозвано",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAward"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5d4c3b2a-1908-4f7e-8d6c-5b4a39281706",
                    "achievementId": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "achievementTitle": "Наставник квартала",
                    "playerId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                    "b24UserId": 4512,
                    "playerName": "Иванов Иван Петрович",
                    "source": "api",
                    "awardedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "comment": "Наставник квартала",
                    "externalId": "lms:course:77:4512",
                    "awardedOn": "2026-10-12",
                    "visibility": null,
                    "status": "revoked",
                    "revokedAt": "2026-10-13T08:00:00Z",
                    "revokedBy": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                    "revokeReason": "Вручили по ошибке",
                    "createdAt": "2026-10-12T09:15:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось, больше 64 КБ или несёт лишнее поле — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameAwardRevokeForbidden"
          },
          "404": {
            "description": "Вручения с таким id нет или оно вне уровня смотрящего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Вручение уже отозвано — код invalid_transition.",
            "x-error-codes": [
              "invalid_transition"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Причина пуста или длиннее 500 символов — код award_invalid, details.field = reason.",
            "x-error-codes": [
              "award_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/people": {
      "get": {
        "operationId": "appGamePeople",
        "tags": [
          "Геймификация"
        ],
        "summary": "Люди для вручения",
        "description": "Активные люди оргструктуры, которым смотрящий может вручить ачивку: на уровне game_award · edit «все» — люди портала, на уровне «отдел» — люди отделов, где смотрящий состоит или которыми руководит, с подотделами. Сам смотрящий в выдаче не бывает: себе не вручают. По возрастанию b24UserId, с поиском по ФИО (q); курсор — b24UserId последнего отданного, он же в nextCursor. Требует права game_award · edit.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Поиск по ФИО: слова через пробел, каждое — часть фамилии или имени; применяются первые три."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница людей",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameCoveragePeople"
                    }
                  }
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "b24UserId": 4512,
                        "lastName": "Иванов",
                        "firstName": "Иван"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: курсор или limit не разобрались. Код invalid_value: строка поиска длиннее 100 символов — details.field = q.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievement-departments": {
      "get": {
        "operationId": "appGameAchievementDepartments",
        "tags": [
          "Геймификация"
        ],
        "summary": "Отделы для ачивки",
        "description": "Живые именованные отделы текущего портала, на которые смотрящий может создать ачивку отдела. Требует game_achievement · edit, независимо от прав на сценарии, людей или доступ. На уровне «все» доступны все живые отделы, ниже — поддеревья отделов членства и руководства, как при создании ачивки; без права — 403 forbidden. Отдел компании не добавляется: компания выбирается отдельно только при edit = all. Ключ API действует текущими правами владельца, суженными потолком. Порядок по возрастанию id отдела Б24; курсор — id последнего отданного. Неизвестный, чужой или исчезнувший курсор возвращает пустую страницу. mine означает точное членство или руководство.",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "id отдела Б24 из nextCursor прошлого ответа; порядок по id. Неверное или неположительное целое — 400 bad_request."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница отделов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameDepartmentsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 1,
                        "parentId": null,
                        "name": "Производство",
                        "path": "/1/",
                        "mine": false
                      },
                      {
                        "id": 12,
                        "parentId": 1,
                        "name": "Цех № 2",
                        "path": "/1/12/",
                        "mine": true
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобрались — код bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/templates": {
      "get": {
        "operationId": "appGameSeasonTemplates",
        "tags": [
          "Геймификация"
        ],
        "summary": "Шаблоны сезонов",
        "description": "Шаблоны сезонов. Каталог HR текущего портала. Требует game_template · view на уровне «все»; руководитель может читать.",
        "responses": {
          "200": {
            "description": "Шаблоны сезонов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameSeasonTemplatesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "templates": [
                      {
                        "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                        "title": "Осенний сезон",
                        "description": "Чистота и безопасность",
                        "weeks": 6,
                        "teamVisibility": "department",
                        "personalVisibility": "self_manager",
                        "leaderboard": false,
                        "seasonAchievementId": null,
                        "tiers": [
                          {
                            "thresholdPoints": 300,
                            "achievementId": null,
                            "rewardText": "Пицца отделу"
                          }
                        ],
                        "archivedAt": null
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобрались — bad_request; недопустимый limit — invalid_value. Код invalid_value: q, sort или dir не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии шаблона. Пробелы по краям для поиска срезаются, после этого — до 120 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "nextCursor прошлого ответа. Курсор чужого портала даёт пустую страницу."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Размер страницы: по умолчанию 50, больше 100 не отдаётся."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/templates/{id}": {
      "get": {
        "operationId": "appGameSeasonTemplate",
        "tags": [
          "Геймификация"
        ],
        "summary": "Шаблон: Шаблоны сезонов",
        "description": "Шаблоны сезонов. Каталог HR текущего портала. Требует game_template · view на уровне «все»; руководитель может читать. Архивный шаблон доступен по id.",
        "responses": {
          "200": {
            "description": "Шаблон: Шаблоны сезонов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameSeasonTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b",
                    "title": "Осенний сезон",
                    "description": "Чистота и безопасность",
                    "weeks": 6,
                    "teamVisibility": "department",
                    "personalVisibility": "self_manager",
                    "leaderboard": false,
                    "seasonAchievementId": null,
                    "tiers": [
                      {
                        "thresholdPoints": 300,
                        "achievementId": null,
                        "rewardText": "Пицца отделу"
                      }
                    ],
                    "archivedAt": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Публичного id нет в текущем портале, ссылка не разобралась или право view закрывает ответ записи — not_found. Чужая и несуществующая ссылки отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Публичный идентификатор."
            },
            "description": "Публичный id шаблона."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/contract-templates": {
      "get": {
        "operationId": "appGameContractTemplates",
        "tags": [
          "Геймификация"
        ],
        "summary": "Библиотека заданий",
        "description": "Библиотека заданий. Каталог HR текущего портала. Требует game_template · view на уровне «все»; руководитель может читать.",
        "responses": {
          "200": {
            "description": "Библиотека заданий",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameContractTemplatesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "templates": [
                      {
                        "id": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                        "kind": "contract",
                        "code": "safety_walk",
                        "title": "Обход участка",
                        "description": "Проверка безопасности",
                        "points": 20,
                        "repeat": "weekly",
                        "maxCount": null,
                        "cadence": null,
                        "activeDays": null,
                        "needsConfirmation": true,
                        "rewardAchievementId": null,
                        "archivedAt": null
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Курсор или limit не разобрались — bad_request; недопустимый limit — invalid_value. Код invalid_value: q, sort или dir не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии задания. Пробелы по краям для поиска срезаются, после этого — до 120 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "nextCursor прошлого ответа. Курсор чужого портала даёт пустую страницу."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "Размер страницы: по умолчанию 50, больше 100 не отдаётся."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/contract-templates/{id}": {
      "get": {
        "operationId": "appGameContractTemplate",
        "tags": [
          "Геймификация"
        ],
        "summary": "Шаблон: Библиотека заданий",
        "description": "Библиотека заданий. Каталог HR текущего портала. Требует game_template · view на уровне «все»; руководитель может читать. Архивный шаблон доступен по id.",
        "responses": {
          "200": {
            "description": "Шаблон: Библиотека заданий",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameContractTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2b9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "kind": "contract",
                    "code": "safety_walk",
                    "title": "Обход участка",
                    "description": "Проверка безопасности",
                    "points": 20,
                    "repeat": "weekly",
                    "maxCount": null,
                    "cadence": null,
                    "activeDays": null,
                    "needsConfirmation": true,
                    "rewardAchievementId": null,
                    "archivedAt": null
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Публичного id нет в текущем портале, ссылка не разобралась или право view закрывает ответ записи — not_found. Чужая и несуществующая ссылки отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Публичный идентификатор."
            },
            "description": "Публичный id шаблона."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/settings": {
      "get": {
        "operationId": "appGameSettings",
        "tags": [
          "Геймификация"
        ],
        "summary": "Настройки игр",
        "description": "Строгий режим HR и пояс игр текущего портала. Настройки игр закрыты от общего каталога portal_setting. Требует game_template · view на уровне «все».",
        "responses": {
          "200": {
            "description": "Настройки игр",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameSettings"
                    }
                  }
                },
                "example": {
                  "data": {
                    "catalogOnly": false,
                    "timeZone": "Europe/Moscow"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Публичного id нет в текущем портале, ссылка не разобралась или право view закрывает ответ записи — not_found. Чужая и несуществующая ссылки отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys": {
      "get": {
        "operationId": "appSurveyList",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Список опросов",
        "description": "Опросы, которые смотрящий ведёт (survey · view по уровню строки), и запущенные опросы, ответы которых ему открыты правом «Ответы опросов с именами» (survey_answer · view): own — опросы, где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Без ведения и без доступа к ответам — пустой список с emptyReason, а не 403. Ключ требует также точную суженную матрицу survey.view, иначе 403; ответы ключу открывает только клетка survey_answer в потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "creatorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "startsAt",
                "endsAt",
                "title",
                "state",
                "submitted"
              ],
              "default": "startsAt"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "surveys": [],
                    "nextCursor": "",
                    "emptyReason": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveyCreate",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Создать опрос из готовой анкеты",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Автоматический анализ (settings.analysisMode = automatic) включает только тот, кому разрешено запускать анализ этого опроса; иначе — 403 survey_automatic_forbidden, без тихого перехода на ручной режим. Правило разрешения — в описании ответа 403 (SurveyAutomaticForbidden). Включивший записывается инициатором режима: его действующие права проверяются при запуске и перед каждой постановкой анализа.",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunSettingsForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCreateSurvey"
              },
              "example": {
                "formId": "00000000-0000-4000-8000-000000000001",
                "settings": {
                  "title": "Обратная связь",
                  "description": "",
                  "startsAt": "2026-10-07T09:00:00Z",
                  "endsAt": "2026-10-14T09:00:00Z",
                  "timeZone": "Europe/Moscow",
                  "audience": {
                    "anyone": false,
                    "employees": [
                      42
                    ],
                    "departments": [],
                    "departmentHeads": []
                  },
                  "controllers": {
                    "anyone": false,
                    "employees": [
                      43
                    ],
                    "departments": [],
                    "departmentHeads": []
                  },
                  "organizerResults": false,
                  "analysisMode": "manual",
                  "notifications": {
                    "remindersEnabled": false,
                    "reminderDays": [],
                    "reminderTime": "",
                    "digestEnabled": false,
                    "digestTime": ""
                  }
                },
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/counts": {
      "get": {
        "operationId": "appSurveyCounts",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Числа быстрых фильтров списка опросов",
        "description": "Числа быстрых фильтров «Мои» и «Активные» списка опросов одним ответом: mine — опросы, где автор — смотрящий (как creatorId списка), running — идущие (как state=running). Права и видимость — те же, что у GET /api/v1/surveys: опросы, которые смотрящий ведёт (survey · view по уровню строки), и запущенные опросы, ответы которых ему открыты правом «Ответы опросов с именами» (survey_answer · view); ключ требует также суженную survey.view, иначе 403. Прочие оси списка (поиск, анкета, подразделение, период) числа не сужают. Параметров нет: любой параметр — 400. Тому, кто не ведёт опросы и кому не открыты ответы ни одного опроса, — нули, как у списка пустая страница.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCounts"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "mine": 2,
                    "running": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}": {
      "get": {
        "operationId": "appSurveyGet",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Карточка опроса",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Флаги visibility отвечают на запросы этого субъекта: results — ответы открыты, runAI — можно запускать анализ; resultsAudience называет, кто видит ответы, для пояснения у замка.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appSurveySave",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Сохранить настройки и критерии",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Автоматический анализ: включение режима, повторное подтверждение (reconfirmAutomatic) и смена контролирующих или включения организатора при режиме automatic проверяют правящего тем же правилом, что POST /api/v1/surveys, и записывают его инициатором; обычная правка инициатора не меняет, отказ — 403 survey_automatic_forbidden. Режим automatic без инициатора (automaticNeedsConfirm в карточке; так остались настройки, включённые до появления инициатора) новых заданий анализа не ставит, а черновик с ним не запускается — ни вручную (403 survey_automatic_forbidden), ни по плану (startError survey_automatic_forbidden, опрос снимается с плана), пока режим не включит заново тот, кому разрешено запускать анализ: перевести в manual и обратно в automatic либо сохранить правку с reconfirmAutomatic: true. Без поля правка согласия не приписывает. Норму можно править до запуска; после запуска она заморожена.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request, survey_norm_null. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request",
              "survey_norm_null"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_norm_null": {
                    "value": {
                      "error": {
                        "code": "survey_norm_null",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunSettingsForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_anonymous_automatic — режим automatic у опроса, признак анонимности которого уже сохранён включённым. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty",
              "survey_anonymous_automatic"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_anonymous_automatic": {
                    "value": {
                      "error": {
                        "code": "survey_anonymous_automatic",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySaveSurvey"
              },
              "example": {
                "revision": 0,
                "settings": {
                  "title": "Обратная связь",
                  "description": "",
                  "startsAt": "2026-10-07T09:00:00Z",
                  "endsAt": "2026-10-14T09:00:00Z",
                  "timeZone": "Europe/Moscow",
                  "audience": {
                    "anyone": false,
                    "employees": [
                      42
                    ],
                    "departments": [],
                    "departmentHeads": []
                  },
                  "controllers": {
                    "anyone": false,
                    "employees": [
                      43
                    ],
                    "departments": [],
                    "departmentHeads": []
                  },
                  "organizerResults": false,
                  "analysisMode": "manual",
                  "notifications": {
                    "remindersEnabled": false,
                    "reminderDays": [],
                    "reminderTime": "",
                    "digestEnabled": false,
                    "digestTime": ""
                  }
                },
                "goal": "",
                "criteria": []
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/start": {
      "post": {
        "operationId": "appSurveyStart",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Запустить опрос",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Запуск фиксирует answerPolicy = permissions: ответы опроса открывает право «Ответы опросов с именами». Автоматический анализ проверяется при запуске: право запускать анализ этого опроса по действующим правам должно быть и у сохранённого инициатора режима, и у запускающего; держателю all без назначения оно считается под новым правилом, которое пишет этот же запуск. Режим automatic без инициатора (automaticNeedsConfirm) не запускается, пока его не включат заново. Отказ — 403 survey_automatic_forbidden, опрос остаётся черновиком.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "permissions",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAutomaticForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_controllers_no_access. survey_controllers_no_access — контролирующие есть, но ни один не получит доступа к ответам опроса (survey_answer · view ниже own по текущим правам); кого назвать, показывает noAccessControllers предпросмотра. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty",
              "survey_controllers_no_access"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_no_access": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_no_access",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRunCommand"
              },
              "example": {
                "revision": 0,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/schedule": {
      "post": {
        "operationId": "appSurveySchedule",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Запланировать старт",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. План права контролирующих и автоматический режим не проверяет: их проверяет запуск по плану тем же правилом, что POST /api/v1/surveys/{id}/start. Отказ остаётся в startError карточки (survey_controllers_no_access, survey_automatic_forbidden и другие), и опрос снимается с плана.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRunCommand"
              },
              "example": {
                "revision": 0,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/unschedule": {
      "post": {
        "operationId": "appSurveyUnschedule",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Отменить запланированный старт",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRunCommand"
              },
              "example": {
                "revision": 0,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/complete": {
      "post": {
        "operationId": "appSurveyComplete",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Завершить опрос",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRunCommand"
              },
              "example": {
                "revision": 0,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/copy": {
      "post": {
        "operationId": "appSurveyCopy",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Скопировать опрос без результатов",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Копия — черновик без признака политики (answerPolicy станет permissions при её запуске) и без инициатора источника: автоматический режим копии проверяется для копирующего, и он становится инициатором; не разрешён — 403 survey_automatic_forbidden. Правило разрешения — в описании ответа 403 (SurveyAutomaticForbidden).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAutomaticForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCopyForm"
              },
              "example": {
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/refresh-form": {
      "post": {
        "operationId": "appSurveyRefreshForm",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Обновить копию анкеты до старта",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "creatorId": "00000000-0000-4000-8000-000000000001",
                    "id": "00000000-0000-4000-8000-000000000001",
                    "formId": "00000000-0000-4000-8000-000000000001",
                    "revision": 0,
                    "state": "",
                    "scheduled": false,
                    "startError": "",
                    "completionReason": "",
                    "actualStartedAt": null,
                    "completedAt": null,
                    "settings": {
                      "title": "",
                      "description": "",
                      "startsAt": "2026-10-07T09:00:00Z",
                      "endsAt": "2026-10-07T09:00:00Z",
                      "timeZone": "",
                      "audience": {
                        "anyone": false,
                        "employees": [],
                        "departments": [
                          1
                        ],
                        "departmentHeads": []
                      },
                      "controllers": {
                        "anyone": false,
                        "employees": [],
                        "departments": [],
                        "departmentHeads": []
                      },
                      "organizerResults": false,
                      "analysisMode": "manual",
                      "notifications": {
                        "remindersEnabled": false,
                        "reminderDays": [],
                        "reminderTime": "",
                        "digestEnabled": false,
                        "digestTime": ""
                      }
                    },
                    "audienceSummary": {
                      "anyone": false,
                      "items": [
                        {
                          "kind": "departments",
                          "id": 1,
                          "name": "Отдел продаж"
                        }
                      ],
                      "more": 0
                    },
                    "content": {
                      "title": "",
                      "description": "",
                      "questions": [],
                      "goal": "",
                      "criteria": []
                    },
                    "visibility": {
                      "manage": false,
                      "results": false,
                      "participant": false,
                      "edit": false,
                      "runAI": false
                    },
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "resultsAudience": {
                      "controllers": [],
                      "roles": []
                    },
                    "automaticNeedsConfirm": false,
                    "answerPolicy": "controllers",
                    "norm": {
                      "enabled": true,
                      "scales": []
                    },
                    "anonymous": false,
                    "smallGroupMin": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_closed, survey_already_started, survey_form_archived, survey_command_conflict. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_closed",
              "survey_already_started",
              "survey_form_archived",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_already_started": {
                    "value": {
                      "error": {
                        "code": "survey_already_started",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_form_archived": {
                    "value": {
                      "error": {
                        "code": "survey_form_archived",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRefreshForm"
              },
              "example": {
                "revision": 0,
                "formId": "00000000-0000-4000-8000-000000000001",
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/preflight": {
      "get": {
        "operationId": "appSurveyPreflight",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Проверить готовность к запуску",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyPreflight"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "questionsValid": false,
                    "audienceCount": 0,
                    "controllerCount": 0,
                    "noAccessControllers": [],
                    "noAccessControllerCount": 0,
                    "startsAt": "2026-10-07T09:00:00Z",
                    "endsAt": "2026-10-07T09:00:00Z",
                    "timeZone": "",
                    "errors": [],
                    "revision": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/participants": {
      "get": {
        "operationId": "appSurveyParticipants",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Участники и прогресс без текстов ответов",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Ход — участники и их выгрузка — открыт тому, кто опрос ведёт, и тому, кому открыты его ответы.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "progress",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "submitted",
                "draft",
                "not_started",
                "pending"
              ]
            },
            "description": "Отбор по прогрессу. У анонимного опроса отбора нет: любое значение — 422 survey_anonymous_progress."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока имени участника из снимка опроса без учёта регистра; пробелы по краям обрезаются. Не более 255 символов, пустое значение и повтор параметра — 400.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyParticipantPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "participants": [],
                    "progress": {
                      "participants": 0,
                      "unstarted": 0,
                      "missing": 0,
                      "available": 0,
                      "submitted": 0,
                      "drafts": 0,
                      "pendingDelivery": 0,
                      "sentDelivery": 0,
                      "skippedDelivery": 0,
                      "failedDelivery": 0,
                      "analysisQueued": 0,
                      "analysisReady": 0,
                      "analysisFailed": 0
                    },
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_anonymous_progress. Отправленные значения не включаются в ошибку. survey_anonymous_progress — опрос анонимный: отбора по прогрессу у его участников нет.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty",
              "survey_anonymous_progress"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_anonymous_progress": {
                    "value": {
                      "error": {
                        "code": "survey_anonymous_progress",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/answers": {
      "get": {
        "operationId": "appSurveyAnswers",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Отправленные ответы",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Ответы, карточку ответа и выгрузку получает только тот, кому ответы этого опроса открыты (visibility.results): ведение опроса без этого права их не даёт — 403. Поля сигнала (signalId, signalState) и фильтры signalState/hasSignal ключу открыты только при survey_signal.view=all в его потолке: иначе поля пусты, а фильтр по сигналу — forbidden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "submittedFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "submittedUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "overall",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "criterionKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "categoryKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "analysisState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signalState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "normStatus",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "norm",
                "below",
                "critical",
                "none"
              ]
            },
            "description": "Один статус по норме или none — ответы без статуса."
          },
          {
            "name": "hasSignal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "submittedAt",
                "person",
                "overall",
                "analysisState",
                "norm"
              ],
              "default": "submittedAt"
            },
            "description": "norm при order=asc: критично, ниже нормы, норма, без статуса; при order=desc — наоборот."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnswerPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "answers": [],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnswersForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/answers/{answerId}": {
      "get": {
        "operationId": "appSurveyAnswer",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Последняя отправленная версия ответа",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Ответы, карточку ответа и выгрузку получает только тот, кому ответы этого опроса открыты (visibility.results): ведение опроса без этого права их не даёт — 403. Поля сигнала (signalId, signalReason) ключу открыты только при survey_signal.view=all в его потолке: иначе signalId пуст, signalReason — null.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "answerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyControllerAnswer"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "person": {
                      "employeeId": 0,
                      "name": "",
                      "departments": [],
                      "available": false
                    },
                    "submittedAt": "2026-10-07T09:00:00Z",
                    "version": 0,
                    "overall": "",
                    "analysisState": "",
                    "signalId": "",
                    "values": {},
                    "currentAnalysis": null,
                    "criteria": [],
                    "signalState": "",
                    "previousAnalysis": null,
                    "normStatus": null,
                    "redFlags": 0,
                    "norm": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnswersForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/answers/export": {
      "get": {
        "operationId": "appSurveyExportAnswers",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Выгрузить отправленные ответы в CSV",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Ответы, карточку ответа и выгрузку получает только тот, кому ответы этого опроса открыты (visibility.results): ведение опроса без этого права их не даёт — 403. Поле signal и фильтры signalState/hasSignal ключу открыты только при survey_signal.view=all в его потолке: иначе поле signal пусто, а фильтр по сигналу — forbidden.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "submittedFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "submittedUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "overall",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "criterionKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "categoryKey",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "analysisState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signalState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "normStatus",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "norm",
                "below",
                "critical",
                "none"
              ]
            },
            "description": "Один статус по норме или none — ответы без статуса."
          },
          {
            "name": "hasSignal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "submittedAt",
                "person",
                "overall",
                "analysisState",
                "norm"
              ],
              "default": "submittedAt"
            },
            "description": "norm при order=asc: критично, ниже нормы, норма, без статуса; при order=desc — наоборот."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Поток CSV UTF-8 с теми же фильтрами и правами, без личных черновиков.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "employee_id,name,progress\r\n42,Employee,submitted\r\n"
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnswersForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/participants/export": {
      "get": {
        "operationId": "appSurveyExportParticipants",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Выгрузить участников и прогресс в CSV",
        "description": "Текущий активный субъект. Опрос видит тот, кто его ведёт (survey · view по уровню строки), и тот, кому ответы этого запущенного опроса открыты правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и опросы, запущенные после обновления правил доступа к ответам. Назначение контролирующим при итоговом none ничего не открывает; под эмуляцией платформы ответы закрыты. Ключ требует также точную суженную матрицу survey.view; ответы ключу открывает только клетка survey_answer · view в явном потолке. Исключённый из контролирующих организатор управляет опросом, а ответы видит, только если их открывает уровень all на опросе, запущенном после обновления правил доступа к ответам. Личные операции и лента отвергают ключ. Чужой портал — 404. Проверка прав предшествует разбору записи. Ход — участники и их выгрузка — открыт тому, кто опрос ведёт, и тому, кому открыты его ответы.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "progress",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "submitted",
                "draft",
                "not_started",
                "pending"
              ]
            },
            "description": "Отбор по прогрессу. У анонимного опроса отбора нет: любое значение — 422 survey_anonymous_progress."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока имени участника из снимка опроса без учёта регистра; пробелы по краям обрезаются. Не более 255 символов, пустое значение и повтор параметра — 400.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Поток CSV UTF-8 с теми же фильтрами и правами, без личных черновиков.",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "employee_id,name,progress\r\n42,Employee,submitted\r\n"
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_anonymous_progress. Отправленные значения не включаются в ошибку. survey_anonymous_progress — опрос анонимный: отбора по прогрессу у его участников нет.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty",
              "survey_anonymous_progress"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_anonymous_progress": {
                    "value": {
                      "error": {
                        "code": "survey_anonymous_progress",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/departments": {
      "get": {
        "operationId": "appSurveyDepartments",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Подразделения фиксированного списка участников",
        "description": "Постраничные id/name только из снимка участников этого опроса, с поиском по историческому имени. Те же проверки текущего субъекта и операционного доступа, что для participants: ведение опроса либо доступ к его ответам (survey_answer · view: own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам); ключ дополнительно ограничен матрицей survey.view. Cookie и Embed без права вести опросы (survey · none) доступны тому, кому открыты ответы опроса. Чужой портал — 404. Живой справочник портала не используется.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1020
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyDepartmentPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 11,
                        "name": "Product"
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/deliveries": {
      "get": {
        "operationId": "appSurveyDeliveries",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Технический прогресс рассылок",
        "description": "Активный текущий Subject. Без права вести опросы (survey · none) Ход открыт по cookie/embed тому, кому открыты ответы этого опроса правом «Ответы опросов с именами» (survey_answer · view: own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам), включая напоминание и повтор. Управление чтением — row-filtered survey.view, запись — survey.view+edit; ключи дополнительно требуют соответствующие суженные матрицы view/edit. Технические счётчики без ответов, оценок и AI evidence; отправлено означает ACK, не прочитано. Чужой портал —404. UUID commandKey и structural fingerprint обеспечивают идемпотентность записи; доступ перепроверяется в транзакции. allPending фиксируется сервером по отсутствию принятой версии, черновик остаётся pending. Каждый внешний send/fallback перепроверяет доступность, срок и принятую версию. Повтор неоднозначной внешней отправки может дать дубликат. Retry переиспользует delivery ID и только terminal dead attempt; одновременно не меняет владельца курьера. У анонимного опроса «всем, кто не прошёл» — участники без отметки о прохождении: строку доставки получает каждый участник, прошедший — сразу пропуском already_submitted, поэтому counts.waiting в ответе команды — число участников, а retryable следует отметке. Напоминание выбранным людям у анонимного опроса — 422 survey_anonymous_selected: итог кампании по адресатам сказал бы, кто уже прошёл. У причин newcomer_chat_initiator_* поля reasons[].initiators и reasons[].initiatorsMore называют, кто пригласил новичков; их видит только тот, кто может править опрос, у прочих причин и читателей — пустой массив и 0.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный технический результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyDeliveryPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "campaigns": [],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty. Без отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/remind": {
      "post": {
        "operationId": "appSurveyRemind",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Напомнить выбранным или всем не подавшим ответ",
        "description": "Активный текущий Subject. Без права вести опросы (survey · none) Ход открыт по cookie/embed тому, кому открыты ответы этого опроса правом «Ответы опросов с именами» (survey_answer · view: own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам), включая напоминание и повтор. Управление чтением — row-filtered survey.view, запись — survey.view+edit; ключи дополнительно требуют соответствующие суженные матрицы view/edit. Технические счётчики без ответов, оценок и AI evidence; отправлено означает ACK, не прочитано. Чужой портал —404. UUID commandKey и structural fingerprint обеспечивают идемпотентность записи; доступ перепроверяется в транзакции. allPending фиксируется сервером по отсутствию принятой версии, черновик остаётся pending. Каждый внешний send/fallback перепроверяет доступность, срок и принятую версию. Повтор неоднозначной внешней отправки может дать дубликат. Retry переиспользует delivery ID и только terminal dead attempt; одновременно не меняет владельца курьера. У анонимного опроса «всем, кто не прошёл» — участники без отметки о прохождении: строку доставки получает каждый участник, прошедший — сразу пропуском already_submitted, поэтому counts.waiting в ответе команды — число участников, а retryable следует отметке. Напоминание выбранным людям у анонимного опроса — 422 survey_anonymous_selected: итог кампании по адресатам сказал бы, кто уже прошёл.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успешный технический результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyRemindResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "campaignId": 1,
                    "counts": {
                      "waiting": 3,
                      "sent": 0,
                      "skipped": 0,
                      "error": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_anonymous_selected. Без отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_anonymous_selected"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_anonymous_selected": {
                    "value": {
                      "error": {
                        "code": "survey_anonymous_selected",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyRemind"
              },
              "example": {
                "employeeIds": [],
                "allPending": true,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/deliveries/retry": {
      "post": {
        "operationId": "appSurveyDeliveryRetry",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Повторить до100 завершившихся ошибкой доставок",
        "description": "Активный текущий Subject. Без права вести опросы (survey · none) Ход открыт по cookie/embed тому, кому открыты ответы этого опроса правом «Ответы опросов с именами» (survey_answer · view: own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам), включая напоминание и повтор. Управление чтением — row-filtered survey.view, запись — survey.view+edit; ключи дополнительно требуют соответствующие суженные матрицы view/edit. Технические счётчики без ответов, оценок и AI evidence; отправлено означает ACK, не прочитано. Чужой портал —404. UUID commandKey и structural fingerprint обеспечивают идемпотентность записи; доступ перепроверяется в транзакции. allPending фиксируется сервером по отсутствию принятой версии, черновик остаётся pending. Каждый внешний send/fallback перепроверяет доступность, срок и принятую версию. Повтор неоднозначной внешней отправки может дать дубликат. Retry переиспользует delivery ID и только terminal dead attempt; одновременно не меняет владельца курьера. У анонимного опроса «всем, кто не прошёл» — участники без отметки о прохождении: строку доставки получает каждый участник, прошедший — сразу пропуском already_submitted, поэтому counts.waiting в ответе команды — число участников, а retryable следует отметке. Напоминание выбранным людям у анонимного опроса — 422 survey_anonymous_selected: итог кампании по адресатам сказал бы, кто уже прошёл.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный технический результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyRemindResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "campaignId": 1,
                    "counts": {
                      "waiting": 1,
                      "sent": 0,
                      "skipped": 0,
                      "error": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty. Без отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyDeliveryRetry"
              },
              "example": {
                "campaignId": 1,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/analyze": {
      "post": {
        "operationId": "appSurveyAnalyze",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Запросить анализ выбранных принятых ответов",
        "description": "Запустить анализ может тот, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view) и кто назначен в нём контролирующим или правит опрос (survey · edit на строку); держателю all без того и другого — forbidden, под эмуляцией — тоже. Право вести опросы без доступа к ответам этого не даёт. API-ключу нужны клетка survey_answer · view в явном потолке и точные суженные survey.view и survey.edit на строку опроса. Каждый принятый ответ получает монотонное поколение; повтор commandKey возвращает исходный accepted, изменённый запрос даёт survey_command_conflict. force=false пропускает актуальные оценки. Черновики не анализируются. Квота и подключение ИИ не блокируют приём команды; результат доступен отдельно. Оценка публикуется только для текущей принятой версии и последнего запрошенного поколения.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Число принятых задач анализа",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalyzeAck"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "accepted": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyzeForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty. Без отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyAnalyze"
              },
              "example": {
                "answerIds": [
                  "00000000-0000-4000-8000-000000000002"
                ],
                "force": false,
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/answers/{answerId}/analysis-parts": {
      "get": {
        "operationId": "appSurveyAnalysisParts",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Прочитать подтверждающие части анализа",
        "description": "Только тому, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам; под эмуляцией — forbidden. API-ключу нужны клетка survey_answer · view в явном потолке и точный суженный survey.view, включая владение строкой опроса. generation выбирает неизменяемые части этого ответа; исторические поколения доступны по тем же правам. supporting=true обозначает отдельную подтверждающую часть, а не текущую готовую оценку. Сервер возвращает не более двух частей за страницу для ограничения расшифровки и размера ответа. Черновики и личный кабинет участника части анализа не получают; организатор — только если ответы ему открыты.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "answerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "generation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ограниченная страница подтверждающих частей",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalysisPartsPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "generation": 1,
                    "parts": [],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnswersForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals": {
      "get": {
        "operationId": "appSurveySignals",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Список сигналов",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — пустая страница. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404. Человеку, которому не открыты ответы ни одного опроса, или человеку без привязки к сотруднику Битрикс24 — пустая страница, а не forbidden; ключу, выпустивший которого не привязан к сотруднику, — forbidden. Неверный surveyId — 400 и тогда, когда страница была бы пустой. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. SQL-фильтры применяются только к разрешённым опросам. Только мои использует доверенного B24-сотрудника. Состояния new/in_progress/processed можно запрашивать отдельными страницами. Порядок важности: ordinary < important < urgent; пустой срок сортируется последним при asc. Курсор привязан к оси сортировки. Несовместимое изменение 2026-10-09: answerId карточки — пустая строка, пока сотрудник не ответил; signalReason.analysis — null у сигнала без анализа; ключ без потолка получает forbidden.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока имени сотрудника из снимка опроса или названия опроса без учёта регистра; пробелы по краям обрезаются. Не более 255 символов, пустое значение и повтор параметра — 400.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "surveyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "importance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ordinary",
                "important",
                "urgent"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "in_progress",
                "processed"
              ]
            }
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "onlyMine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "dueFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "dueUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "updated_at",
                "due_at",
                "importance"
              ],
              "default": "created_at"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "signals": [
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "surveyId": "00000000-0000-4000-8000-000000000001",
                        "surveyTitle": "Обратная связь",
                        "answerId": "00000000-0000-4000-8000-000000000002",
                        "person": {
                          "employeeId": 102,
                          "name": "Сотрудник",
                          "departments": [],
                          "available": true
                        },
                        "state": "new",
                        "revision": 1,
                        "assignee": null,
                        "dueAt": null,
                        "importance": "important",
                        "needsAttention": true,
                        "reasonsStale": false,
                        "newData": false,
                        "outcome": "",
                        "resolution": "",
                        "currentAnalysis": null,
                        "createdAt": "2026-10-07T09:00:00Z",
                        "updatedAt": "2026-10-07T09:00:00Z",
                        "signalReason": {
                          "id": "00000000-0000-4000-8000-000000000005",
                          "state": "new",
                          "importance": "important",
                          "version": 1,
                          "generation": 1,
                          "needsAttention": true,
                          "newData": false,
                          "stale": false,
                          "analysis": {
                            "answerId": "00000000-0000-4000-8000-000000000002",
                            "version": 1,
                            "generation": 1,
                            "overall": "attention",
                            "importance": "important",
                            "reason": "Нужна помощь",
                            "evidence": [],
                            "criteria": [],
                            "insights": []
                          },
                          "manualReasons": [],
                          "norm": {
                            "status": "below",
                            "redFlags": 1
                          }
                        },
                        "allowedActions": [
                          "comment",
                          "set_due",
                          "claim",
                          "assign"
                        ],
                        "source": "ai"
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveySignalCreate",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Ручное заведение сигнала",
        "description": "Текущий активный доверенный Subject. Завести сигнал — работа, а не чтение: только контролирующему выбранного опроса, которому открыты его ответы (survey_answer · view); держателю all без назначения — forbidden. Опрос — запущенный или завершённый. Право проверяется раньше существования: неизвестный опрос, опрос чужого портала и опрос, где работа с сигналами вызывающему закрыта, — один отказ forbidden. Клетки survey и survey_signal у человека сервер не проверяет; во встроенном режиме ручки нет. API-ключ — только с явным потолком survey_signal.view=all и survey_signal.edit=all с клеткой survey_answer · view и с точной суженной survey.view/survey.edit по исходному создателю опроса; ключ без потолка — forbidden независимо от прав выпустившего. Сотрудник — участник из снимка опроса (иначе survey_invalid с полем employeeId), ответивший или нет; ответственный — действующий контролирующий с доступом к ответам по текущим правам (иначе survey_invalid с полем assignee). Один сигнал на пару «опрос + сотрудник»: уже заведённый — 409 survey_signal_exists с details.signalId. Отправленный ответ привязывается сразу, иначе — при первой отправке. Причина хранится шифром и выводится в signalReason.manualReasons; важность — максимум причин. Состояние in_progress при заданном ответственном, иначе new; в историю пишется signal_created с автором. UUID commandKey обязателен; идентичный повтор возвращает тот же сигнал, изменённый — survey_command_conflict. Тело до 256 KiB. Причина — по правилам текста ленты: \\r\\n и \\r приводятся к \\n, края обрезаются, управляющие символы (кроме \\n и \\t) и символы управления направлением отклоняются — survey_invalid с полем reason.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySignalCreate"
              },
              "example": {
                "surveyId": "00000000-0000-4000-8000-000000000001",
                "employeeId": 102,
                "importance": "important",
                "reason": "Просил о встрече",
                "assignee": 103,
                "commandKey": "00000000-0000-4000-8000-000000000006"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Сигнал заведён",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000007",
                    "surveyId": "00000000-0000-4000-8000-000000000001",
                    "surveyTitle": "Обратная связь",
                    "answerId": "",
                    "person": {
                      "employeeId": 102,
                      "name": "Сотрудник",
                      "departments": [],
                      "available": true
                    },
                    "state": "in_progress",
                    "revision": 1,
                    "assignee": {
                      "employeeId": 103,
                      "name": "Контролирующий",
                      "departments": [],
                      "available": true
                    },
                    "dueAt": null,
                    "importance": "important",
                    "needsAttention": true,
                    "reasonsStale": false,
                    "newData": false,
                    "outcome": "",
                    "resolution": "",
                    "currentAnalysis": null,
                    "createdAt": "2026-10-08T09:00:00Z",
                    "updatedAt": "2026-10-08T09:00:00Z",
                    "source": "manual",
                    "signalReason": {
                      "id": "00000000-0000-4000-8000-000000000007",
                      "state": "in_progress",
                      "importance": "important",
                      "version": 0,
                      "generation": 0,
                      "needsAttention": true,
                      "newData": false,
                      "stale": false,
                      "analysis": null,
                      "manualReasons": [
                        {
                          "author": {
                            "employeeId": 103,
                            "name": "Контролирующий",
                            "departments": [],
                            "available": true
                          },
                          "importance": "important",
                          "text": "Просил о встрече",
                          "createdAt": "2026-10-08T09:00:00Z"
                        }
                      ],
                      "norm": null
                    },
                    "allowedActions": [
                      "comment",
                      "set_due",
                      "update_work",
                      "assign",
                      "resolve"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalCreateForbidden"
          },
          "409": {
            "description": "Коды: survey_signal_exists, survey_command_conflict. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_signal_exists",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_signal_exists": {
                    "value": {
                      "error": {
                        "code": "survey_signal_exists",
                        "message": "операция с сигналом отклонена",
                        "retryable": false,
                        "details": {
                          "signalId": "00000000-0000-4000-8000-000000000005"
                        }
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false,
                        "details": {
                          "fields": [
                            {
                              "path": "employeeId",
                              "code": "not_participant"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals/counts": {
      "get": {
        "operationId": "appSurveySignalCounts",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Числа быстрых фильтров списка сигналов",
        "description": "Числа быстрых фильтров «Мои» и «Новые» списка сигналов одним ответом: mine — сигналы, где ответственный — доверенный B24-сотрудник смотрящего (как onlyMine списка), new — ждущие разбора (как state=new). Права, субъект и видимость — те же, что у GET /api/v1/survey-signals: сигналы опросов, ответы которых смотрящему открыты правом «Ответы опросов с именами» (survey_answer · view); клетки survey и survey_signal у человека сервер не проверяет. Ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view; ключ без потолка — forbidden. Человеку, которому не открыты ответы ни одного опроса, или человеку без привязки к сотруднику Битрикс24 — нули, а не forbidden. Прочие оси списка числа не сужают. Параметров нет: любой параметр — 400. new — то же число, что у счётчика меню surveySignalsNew.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalCounts"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "mine": 1,
                    "new": 3
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals/{signalId}": {
      "get": {
        "operationId": "appSurveySignal",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Карточка сигнала",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — forbidden. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404, отсутствие доступа — forbidden. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. signalReason хранит последние опубликованные причины, пока новое поколение ожидается или завершилось ошибкой; currentAnalysis содержит только точный текущий готовый анализ. reasonsStale учитывает и версию ответа, и запрошенное поколение. История доступна через /feed. Несовместимое изменение 2026-10-09: answerId карточки — пустая строка, пока сотрудник не ответил; signalReason.analysis — null у сигнала без анализа; ключ без потолка получает forbidden.",
        "parameters": [
          {
            "name": "signalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000005",
                    "surveyId": "00000000-0000-4000-8000-000000000001",
                    "surveyTitle": "Обратная связь",
                    "answerId": "00000000-0000-4000-8000-000000000002",
                    "person": {
                      "employeeId": 102,
                      "name": "Сотрудник",
                      "departments": [],
                      "available": true
                    },
                    "state": "new",
                    "revision": 1,
                    "assignee": null,
                    "dueAt": null,
                    "importance": "important",
                    "needsAttention": true,
                    "reasonsStale": false,
                    "newData": false,
                    "outcome": "",
                    "resolution": "",
                    "currentAnalysis": null,
                    "createdAt": "2026-10-07T09:00:00Z",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "signalReason": {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "state": "new",
                      "importance": "important",
                      "version": 1,
                      "generation": 1,
                      "needsAttention": true,
                      "newData": false,
                      "stale": false,
                      "analysis": {
                        "answerId": "00000000-0000-4000-8000-000000000002",
                        "version": 1,
                        "generation": 1,
                        "overall": "attention",
                        "importance": "important",
                        "reason": "Нужна помощь",
                        "evidence": [],
                        "criteria": [],
                        "insights": []
                      },
                      "manualReasons": [],
                      "norm": {
                        "status": "below",
                        "redFlags": 1
                      }
                    },
                    "allowedActions": [
                      "comment",
                      "set_due",
                      "claim",
                      "assign"
                    ],
                    "source": "ai"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appSurveySignalApply",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Действие по сигналу",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — forbidden. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404, отсутствие доступа — forbidden. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. claim: new без ответственного → in_progress; assign: действующий контролирующий опроса с доступом к ответам по текущим правам (survey_answer · view не ниже own). comment и set_due доступны контролирующим с доступом к ответам; null dueAt снимает срок. update_work меняет ответственного и срок одной ревизией (блок «Работа») и правит только присланные поля: отсутствующий dueAt срок не трогает, null снимает, значение — целевое; отсутствующий assignee оставляет прежнего, null снимает ответственного (in_progress возвращается в new, событие signal_assigned без refs.assignee), значение — действующий контролирующий с доступом к ответам, иначе 422 survey_invalid с полем assignee (not_controller). Смена и снятие ответственного недоступны у processed (survey_signal_state); смена переводит new в in_progress; без изменений ревизия не растёт. null у assignee допустим только в update_work. resolve только из in_progress для ответственного либо первоначального создателя опроса, если он контролирующий с доступом к ответам, требует непустую запись ≤10000 Unicode-символов и outcome resolved/not_needed/unresolved. reopen: processed → in_progress, сохраняет доступного ответственного или назначает заявителя и снимает newData. Итог остаётся историческим. Список new→in_progress вызывает claim, переход в processed требует явного resolve с диалогом итога. Одновременное взятие даёт одному победу, другому 409 survey_signal_taken только с доступными данными ответственного. UUID commandKey обязателен; идентичный повтор возвращает текущую разрешённую карточку, изменённый — survey_command_conflict. Максимум тела comment/resolve 256 KiB, структурных действий 64 KiB. ИИ не закрывает сигнал и не сбрасывает ручное состояние. Несовместимое изменение 2026-10-09: answerId карточки — пустая строка, пока сотрудник не ответил; signalReason.analysis — null у сигнала без анализа; ключ без потолка получает forbidden. Текст comment и resolve подчиняется тем же правилам, что лента: \\r\\n и \\r приводятся к \\n, края обрезаются, прочие управляющие символы и символы управления направлением отклоняются; упоминание @[uuid] — только человека с доступом к записи сигнала, иначе 422 survey_invalid с полем comment и кодом mention.",
        "parameters": [
          {
            "name": "signalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000005",
                    "surveyId": "00000000-0000-4000-8000-000000000001",
                    "surveyTitle": "Обратная связь",
                    "answerId": "00000000-0000-4000-8000-000000000002",
                    "person": {
                      "employeeId": 102,
                      "name": "Сотрудник",
                      "departments": [],
                      "available": true
                    },
                    "state": "in_progress",
                    "revision": 2,
                    "assignee": {
                      "employeeId": 101,
                      "name": "Контролирующий",
                      "departments": [],
                      "available": true
                    },
                    "dueAt": null,
                    "importance": "important",
                    "needsAttention": true,
                    "reasonsStale": false,
                    "newData": false,
                    "outcome": "",
                    "resolution": "",
                    "currentAnalysis": null,
                    "createdAt": "2026-10-07T09:00:00Z",
                    "updatedAt": "2026-10-07T09:00:00Z",
                    "signalReason": {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "state": "in_progress",
                      "importance": "important",
                      "version": 1,
                      "generation": 1,
                      "needsAttention": true,
                      "newData": false,
                      "stale": false,
                      "analysis": {
                        "answerId": "00000000-0000-4000-8000-000000000002",
                        "version": 1,
                        "generation": 1,
                        "overall": "attention",
                        "importance": "important",
                        "reason": "Нужна помощь",
                        "evidence": [],
                        "criteria": [],
                        "insights": []
                      },
                      "manualReasons": [],
                      "norm": {
                        "status": "below",
                        "redFlags": 1
                      }
                    },
                    "allowedActions": [
                      "comment",
                      "set_due",
                      "claim",
                      "assign"
                    ],
                    "source": "ai"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_command_conflict, survey_signal_state, survey_signal_taken. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_command_conflict",
              "survey_signal_state",
              "survey_signal_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_signal_state": {
                    "value": {
                      "error": {
                        "code": "survey_signal_state",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_signal_taken": {
                    "value": {
                      "error": {
                        "code": "survey_signal_taken",
                        "message": "операция с сигналом отклонена",
                        "retryable": false,
                        "details": {
                          "assignee": {
                            "employeeId": 103,
                            "name": "Контролирующий",
                            "departments": [],
                            "available": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySignalAction"
              },
              "example": {
                "action": "claim",
                "revision": 1,
                "commandKey": "00000000-0000-4000-8000-000000000006"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals/{signalId}/feed": {
      "get": {
        "operationId": "appSurveySignalFeed",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "История сигнала",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — forbidden. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404, отсутствие доступа — forbidden. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. Создание, новые причины, назначения, записи, сроки, обработка и возврат. Только результаты этого сигнала; текст хранится зашифрованным и никогда не попадает в личное заполнение.",
        "parameters": [
          {
            "name": "signalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFeedPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "entries": [],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveySignalComment",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Запись в историю сигнала",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — forbidden. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404, отсутствие доступа — forbidden. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. Непустой текст до 10000 Unicode-символов и UUID commandKey; тело до 256 KiB. Повтор возвращает ту же запись, изменённый текст — survey_command_conflict. Сериализация под блокировкой опроса и сигнала; независима от клиентской ревизии. Текст комментария: \\r\\n и \\r приводятся к \\n; прочие управляющие символы, кроме \\n и \\t, и символы управления направлением (U+202A–U+202E, U+2066–U+2069) отклоняются — 422 survey_invalid. Края текста обрезаются, предел — в символах обрезанного. Упоминание @[uuid] — только действующего человека портала с доступом к записи, иначе 422 survey_invalid с полем comment и кодом mention; упомянутые попадают в индекс чипа «Упомянули меня», как у ленты. Несовместимое изменение 2026-10-09: правила текста и упоминаний (422 там, где прежде текст принимался как есть).",
        "parameters": [
          {
            "name": "signalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFeedEntry"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000005",
                    "kind": "signal_commented",
                    "actorId": "00000000-0000-4000-8000-000000000005",
                    "createdAt": "2026-10-07T09:00:00Z",
                    "refs": {
                      "signalId": "00000000-0000-4000-8000-000000000005",
                      "surveyId": "00000000-0000-4000-8000-000000000001",
                      "answerId": "00000000-0000-4000-8000-000000000002",
                      "revision": 2,
                      "fields": [
                        "comment"
                      ]
                    },
                    "text": "Что сделано"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_command_conflict, survey_signal_state, survey_signal_taken. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_command_conflict",
              "survey_signal_state",
              "survey_signal_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_revision_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_revision_conflict",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_signal_state": {
                    "value": {
                      "error": {
                        "code": "survey_signal_state",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_signal_taken": {
                    "value": {
                      "error": {
                        "code": "survey_signal_taken",
                        "message": "операция с сигналом отклонена",
                        "retryable": false,
                        "details": {
                          "assignee": {
                            "employeeId": 103,
                            "name": "Контролирующий",
                            "departments": [],
                            "available": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_body_too_large": {
                    "value": {
                      "error": {
                        "code": "survey_body_too_large",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySignalComment"
              },
              "example": {
                "comment": "Что сделано",
                "commandKey": "00000000-0000-4000-8000-000000000006"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals/{signalId}/assignees": {
      "get": {
        "operationId": "appSurveySignalAssignees",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Варианты ответственного",
        "description": "Текущий активный доверенный Subject. Сигнал несёт человека, ответ и цитаты, поэтому читает его тот, кому открыты ответы его опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам. Назначение при итоговом none ничего не открывает, под эмуляцией — forbidden. Работа — взять, назначить, комментировать, поставить срок, закрыть — только контролирующему этого опроса с доступом к ответам: держатель all без назначения сигнал читает, но не работает с ним. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком, где survey_signal.view=all и есть клетка survey_answer · view, и с точной суженной survey.view по исходному создателю опроса; запись требует также survey_signal.edit=all в потолке и survey.edit. Ключ без потолка получает forbidden независимо от прав выпустившего. Чужой портал — 404, отсутствие доступа — forbidden. Историческая принадлежность сохраняется, деактивация портала или сотрудника закрывает доступ. Постраничный список только действующих контролирующих данного опроса с доступом к ответам по текущим правам (survey_answer · view не ниже own). Отсутствующий HRM-user допускается; существующий archived исключается. Роли и назначения в других опросах не расширяют список. Варианты ответственного — часть работы с сигналом, а не чтения: их получает только тот, кто может назначить ответственного, — контролирующий этого опроса с правом на ответы; ключу нужна и запись (survey_signal.edit=all в потолке и survey.edit). Читатель сигнала без назначения получает forbidden.",
        "parameters": [
          {
            "name": "signalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalAssigneePage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "employeeId": 103,
                        "name": "Контролирующий",
                        "departments": [],
                        "available": true
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/summary": {
      "get": {
        "operationId": "appSurveySummaryGet",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Получить сводку опроса",
        "description": "Только тому, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам; под эмуляцией — forbidden. Сводка цитирует ответы, поэтому право то же, что у них. Ключу нужны клетка survey_answer · view в явном потолке и суженная survey.view. latestAttempt описывает последнее запрошенное поколение. Остальные поля сохраняют последнее опубликованное содержимое под исходным поколением, временем, статистикой и источниками; при замене оно stale до новой публикации. Если публикации ещё нет, поля описывают текущую попытку. GET ничего не записывает.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Состояние и охват снимка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySummaryCard"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "generation": 1,
                    "state": "waiting_limit",
                    "stale": false,
                    "partial": true,
                    "stats": {
                      "participants": 2,
                      "submitted": 1,
                      "analyzed": 0,
                      "pending": 1,
                      "errors": 0,
                      "insufficient": 0,
                      "overall": {},
                      "criteria": {}
                    },
                    "themes": [],
                    "insights": [],
                    "recommendations": [],
                    "createdAt": "2026-10-07T09:00:00Z",
                    "latestAttempt": {
                      "generation": 1,
                      "state": "waiting_limit",
                      "createdAt": "2026-10-07T09:00:00Z"
                    },
                    "explanation": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict, survey_picture_unavailable. survey_picture_unavailable — опрос анонимный, а его картина не готова или не прошла порог малой группы: сводка есть только по готовой картине. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict",
              "survey_picture_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_picture_unavailable": {
                    "value": {
                      "error": {
                        "code": "survey_picture_unavailable",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Нет отправленных ответов: survey_no_answers.",
            "x-error-codes": [
              "survey_no_answers"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_no_answers": {
                    "value": {
                      "error": {
                        "code": "survey_no_answers",
                        "message": "нет отправленных ответов",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveySummaryRequest",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Запросить суммарный анализ всех принятых ответов",
        "description": "Запросить сводку может тот, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view) и кто назначен в нём контролирующим или правит опрос (survey · edit на строку); держателю all без того и другого — forbidden, под эмуляцией — тоже. Право вести опросы без доступа к ответам этого не даёт. API-ключу нужны клетка survey_answer · view в явном потолке и точные права survey.view и survey.edit. Снимок содержит все последние отправленные версии и точные поколения анализа, независимо от фильтров грида. Недостающий анализ ставится в очередь перед фиксацией эпохи; требует расхода общего лимита ИИ. Числа рассчитывает SQL. Частичный результат имеет partial=true и waiting_limit; изменения версий/поколений делают снимок stale. Повтор commandKey возвращает исходное подтверждение. Нет ответов: survey_no_answers, без вызова ИИ.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Поколение снимка и число поставленных задач анализа",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySummaryRequest"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "generation": 1,
                    "responses": 1,
                    "needsAnalysis": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict, survey_picture_unavailable. survey_picture_unavailable — опрос анонимный, а его картина не готова или не прошла порог малой группы: сводка есть только по готовой картине. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict",
              "survey_picture_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_picture_unavailable": {
                    "value": {
                      "error": {
                        "code": "survey_picture_unavailable",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Некорректный UUID commandKey: survey_invalid. Нет отправленных ответов: survey_no_answers.",
            "x-error-codes": [
              "survey_invalid",
              "survey_no_answers"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_no_answers": {
                    "value": {
                      "error": {
                        "code": "survey_no_answers",
                        "message": "нет отправленных ответов",
                        "retryable": false
                      }
                    }
                  },
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "неверный ключ команды",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveySummaryCommand"
              },
              "example": {
                "commandKey": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/numbers": {
      "get": {
        "operationId": "appSurveyNumbersGet",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Получить числа опроса",
        "description": "Только тому, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам; под эмуляцией — forbidden. Ключу нужны клетка survey_answer · view в явном потолке и суженная survey.view. Числа считаются при каждом запросе по текущим версиям ответов, поэтому читайте их по необходимости, а не по таймеру. GET ничего не записывает.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Числа опроса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyNumbers"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "participants": 6,
                    "answered": 5,
                    "norm": {
                      "enabled": true,
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "normFrom": 3.5,
                          "criticalBelow": 3,
                          "redFlagTo": 2
                        }
                      ]
                    },
                    "questions": [
                      {
                        "key": "00000000-0000-4000-8000-000000000010",
                        "answered": 5,
                        "mean": 3.8,
                        "status": "norm",
                        "distribution": [
                          {
                            "value": 1,
                            "count": 0
                          },
                          {
                            "value": 2,
                            "count": 1
                          },
                          {
                            "value": 3,
                            "count": 1
                          },
                          {
                            "value": 4,
                            "count": 1
                          },
                          {
                            "value": 5,
                            "count": 2
                          }
                        ]
                      }
                    ],
                    "blocks": [
                      {
                        "index": 0,
                        "title": "Нагрузка",
                        "scales": [
                          {
                            "min": 1,
                            "max": 5,
                            "mean": 3.8,
                            "status": "norm"
                          }
                        ],
                        "status": "norm"
                      }
                    ],
                    "survey": {
                      "scales": [
                        {
                          "min": 1,
                          "max": 5,
                          "mean": 3.8,
                          "status": "norm"
                        }
                      ],
                      "status": "norm"
                    },
                    "statuses": {
                      "norm": 3,
                      "below": 1,
                      "critical": 1,
                      "none": 0
                    },
                    "redFlagged": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnswersForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-signals/filter-options": {
      "get": {
        "operationId": "appSurveySignalFilterOptions",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Варианты фильтров сигналов",
        "description": "Тот же текущий активный доверенный Subject, предикат доступа и суженные права ключа, что у списка сигналов: варианты берутся из сигналов, которые смотрящий читает, — сигналов опросов, чьи ответы ему открыты (survey_answer · view; own — где он действующий контролирующий, all — ещё и опросы, запущенные после обновления правил доступа к ответам). Клетки survey и survey_signal у человека сервер не проверяет; ключ — только с явным потолком survey_signal.view=all, клеткой survey_answer · view и точной суженной survey.view; ключ без потолка или с выпустившим без привязки к сотруднику — forbidden. Человеку, которому не открыты ответы ни одного опроса, или человеку без привязки к сотруднику Битрикс24 — пустой список вариантов, а не forbidden. Только ID и замороженные имена сотрудников или текущих ответственных из фактически доступных сигналов, независимо от состояния, важности, только моих и страницы результатов. Не служит списком кандидатов для назначения. kind выбирает person, assignee или survey; surveyId ограничивает доступным опросом. Постраничная выдача по employeeId, поиск по детерминированному замороженному имени (минимальное имя среди доступных опросов). selectedId отдельно возвращает доступный выбранный вариант независимо от поиска и страницы; недоступный вариант — null. kind=survey — ось «Опрос»: запущенные опросы, сигналы которых смотрящий читает, тем же правилом, что список сигналов (survey_answer · view, в том числе all без назначения на опросах нового правила), от позднего фактического старта к раннему; поиск q — по названию опроса; варианты — в surveys, people пуст, selected — null; selectedId и surveyId у этой оси — bad_request. У осей людей surveys пуст. Курсор связан с порталом, текущим Subject, kind, surveyId и поиском. Анализ, основания, разрешения и приватные ответы не читаются.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "person",
                "assignee",
                "survey"
              ]
            }
          },
          {
            "name": "surveyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "selectedId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySignalFilterPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "employeeId": 102,
                        "name": "Сотрудник"
                      }
                    ],
                    "surveys": [],
                    "selected": {
                      "employeeId": 103,
                      "name": "Выбранный вариант"
                    },
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/interviews/{id}/send": {
      "post": {
        "operationId": "appInterviewSend",
        "tags": [
          "Собеседования"
        ],
        "summary": "Отправить или повторно отправить приглашение",
        "description": "Ставит письмо со ссылкой в очередь доставки кандидату. Путей два, и выбирает их наличие токен-ссылки у приглашения. Есть токен — секрет восстановить нельзя (в базе лежит только его хеш), поэтому каждый вызов ПЕРЕВЫПУСКАЕТ его: старая ссылка гаснет в тот же момент, новая уходит в письме, а прежние неотправленные письма этого приглашения гасятся вместе с ней. Токена нет (приглашение ведёт кандидата в кабинет постоянной ссылкой) — письмо уходит с той же ссылкой, ничего не перевыпускается и не гаснет.\n\nТребует права interview · edit, тот же уровень, что у отмены: отправка — действие над строкой приглашения, отдельного права «отправлять» нет. Вне уровня смотрящего отвечает 404, как и несуществующее. Контакт phone отправляет СМС, email — письмо. СМС требует явного действия отправки.\n\nОтправка на сохранённый контакт phone дополнительно требует порталовый флаг sms-scenarios; отказ не перевыпускает токен. При выключенном флаге — 403 feature_disabled, при недоступном снимке или identity — 503 feature_flags_unavailable до побочных эффектов. Почта, ручные и базовые операции без нового SMS-выбора не зависят от флага. При deliveryChannel=telegram исходный private чат берётся из нового подтверждённого отклика без username или повторного Start. Создание и отправка повторно проверяют права и маршрут под замком отклика. 61сек при lease120сек повтор запрещён даже с подтверждением; после аренды неизвестный исход требует confirmPossibleDuplicate=true и может привести к дублю. Решение о почте email: режимы skip и provide (любой, кроме saved) принимаются только от того, кто может готовить чат этого кандидата, — пригласившего с личным вебхуком Битрикс24 и правами на кандидата и отклик; остальным доступен только saved, иначе 403 authorization_unproven до любого эффекта. Записанный раньше отказ кандидата от Битрикс24 соблюдается; когда чат заведомо недоступен, сервер сам отправляет выбранным каналом.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-HRM-Telegram-Scenarios-Version",
            "in": "header",
            "required": false,
            "description": "Один захват версии Telegram-сценариев. Пустое значение, повтор, составное значение, ведущие нули и выход из диапазона uint64 отклоняются. Проверяется при изменении Telegram-сценария. Существующий клиент без заголовка захватывает текущую версию на входе.",
            "schema": {
              "$ref": "#/components/schemas/TelegramScenariosVersion"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Приглашение, письмо поставлено в очередь",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InterviewCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9d40c7b2-e81a-4f36-b5c9-072ad3e16f85",
                    "application": null,
                    "candidateName": "Иван Иванов",
                    "candidateContact": "kandidat@example.com",
                    "contactKind": "email",
                    "durationMin": 60,
                    "tz": "Europe/Kaliningrad",
                    "status": "pending",
                    "leadB24UserId": 15,
                    "b24EventId": null,
                    "bookedAt": null,
                    "expiresAt": "2026-10-01T09:00:00Z",
                    "attendees": [
                      15,
                      17
                    ],
                    "slots": [
                      {
                        "from": "2026-09-21T07:00:00Z",
                        "to": "2026-09-21T08:00:00Z"
                      },
                      {
                        "from": "2026-09-22T07:00:00Z",
                        "to": "2026-09-22T08:00:00Z"
                      }
                    ],
                    "chosenSlot": null,
                    "link": "",
                    "b24EventRemoved": null,
                    "delivery": {
                      "state": "queued",
                      "sentCount": 1
                    },
                    "calendarOperation": null,
                    "calendarRemoval": null,
                    "telegramRecipientRetired": false,
                    "b24": {
                      "state": "not_applicable"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код invalid_value: некорректное поле подтверждения. Почтовый шаблон не применён: template_data_missing — не хватает данных подстановки, template_too_large — превышен размер письма, template_invalid — некорректный исходник; письмо не поставлено в очередь. Дополнительные коды: bad_request.",
            "x-error-codes": [
              "invalid_value",
              "template_data_missing",
              "template_too_large",
              "template_invalid",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appCreateInterviewFeatureForbidden"
          },
          "404": {
            "description": "Код not_found: приглашения нет, или оно вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код delivery_not_configured: провайдер почты не настроен — сервис поднят, не поднята одна возможность (409, а не 503: позже само не починится). Код delivery_unroutable: этим контактом доставить нечем (вида контакта нет, или для него нет канала). Код invite_gone: приглашение больше не живое — отменено, вышел срок или время по нему уже выбрано. Код resend_limit: потолок отправок на приглашение исчерпан. Код delivery_bad_address: адрес не принят; телефон должен быть международным, страна — разрешённой. Telegram: telegram_recipient_unbound, telegram_recipient_blocked, telegram_recipient_expired, telegram_bot_changed, candidate_purged, delivery_outcome_unknown. delivery_outcome_unknown несёт details.resendBlockedUntil при активной аренде. candidate_b24_email_required, contact_taken, intent_conflict, action_target_gone, login_unavailable. action_intent_no_effect. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Код candidate_employee — кандидат отклика переведён в сотрудники: ссылки кандидата ему не отправляются. Дополнительные коды: telegram_scenarios_changed.",
            "x-error-codes": [
              "delivery_not_configured",
              "delivery_unroutable",
              "invite_gone",
              "resend_limit",
              "telegram_recipient_unbound",
              "telegram_recipient_blocked",
              "telegram_recipient_expired",
              "telegram_bot_changed",
              "candidate_purged",
              "delivery_outcome_unknown",
              "delivery_bad_address",
              "candidate_b24_email_required",
              "contact_taken",
              "intent_conflict",
              "action_target_gone",
              "login_unavailable",
              "action_intent_no_effect",
              "communication_email_unresolved",
              "candidate_employee",
              "telegram_scenarios_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "delivery_bad_address",
                    "message": "номер не в международном формате или страна не разрешена"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Код invalid_value: некорректное поле подтверждения. invalid_email.",
            "x-error-codes": [
              "invalid_value",
              "invalid_email"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/InterviewSendRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Interview operation refusal codes: delivery_not_configured, feature_flags_unavailable. Дополнительные коды: telegram_scenarios_busy.",
            "x-error-codes": [
              "delivery_not_configured",
              "feature_flags_unavailable",
              "telegram_scenarios_busy"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InterviewSendRequest"
              },
              "example": {
                "confirmPossibleDuplicate": true
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/summary/preflight": {
      "get": {
        "operationId": "appSurveySummaryPreflight",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Статистика перед построением сводки",
        "description": "Только тому, кому открыты ответы опроса правом «Ответы опросов с именами» (survey_answer · view): own — действующему контролирующему, all — ещё и на опросах, запущенных после обновления правил доступа к ответам; под эмуляцией — forbidden. Ключу нужны клетка survey_answer · view в явном потолке и суженная survey.view. Агрегат SQL по всем принятым ответам опроса, независимо от фильтров. GET ничего не записывает, не расшифровывает личные значения и не расходует ИИ. Доступность квоты определяется отдельным чтением.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Состояние и охват снимка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveySummaryPreflight"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "ready": 1,
                    "new": 2,
                    "stale": 3,
                    "pending": 4,
                    "errors": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_closed, survey_command_conflict, survey_picture_unavailable. survey_picture_unavailable — опрос анонимный, а его картина не готова или не прошла порог малой группы: сводка есть только по готовой картине. Без отправленных значений.",
            "x-error-codes": [
              "survey_closed",
              "survey_command_conflict",
              "survey_picture_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_closed": {
                    "value": {
                      "error": {
                        "code": "survey_closed",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_command_conflict": {
                    "value": {
                      "error": {
                        "code": "survey_command_conflict",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_picture_unavailable": {
                    "value": {
                      "error": {
                        "code": "survey_picture_unavailable",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Нет отправленных ответов: survey_no_answers.",
            "x-error-codes": [
              "survey_no_answers"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_no_answers": {
                    "value": {
                      "error": {
                        "code": "survey_no_answers",
                        "message": "нет отправленных ответов",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/filter-departments": {
      "get": {
        "operationId": "appSurveyFilterDepartments",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Подразделения для фильтра списка опросов",
        "description": "Ограниченная постраничная проекция подразделений фиксированных участников только доступных опросов. Ведение по survey.view (включая own) либо доступ к ответам опросов (survey_answer · view) — то же правило, что у списка опросов, но без того и другого — forbidden, а не пустота; API-ключ дополнительно ограничен survey.view. Поиск по детерминированному историческому имени, selectedId разрешает доступное выбранное имя независимо от страницы/поиска. Курсор связан с порталом, пользователем и поиском. Не читает живой справочник или личные ответы и ничего не записывает.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1020
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "selectedId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFilterDepartmentPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "departments": [
                      {
                        "id": 11,
                        "name": "Product"
                      }
                    ],
                    "nextCursor": "",
                    "selected": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_audience_empty, survey_controllers_empty. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid",
              "survey_audience_empty",
              "survey_controllers_empty"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_audience_empty": {
                    "value": {
                      "error": {
                        "code": "survey_audience_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  },
                  "survey_controllers_empty": {
                    "value": {
                      "error": {
                        "code": "survey_controllers_empty",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/feature-flags/resolve": {
      "get": {
        "operationId": "appFeatureFlagsResolve",
        "tags": [
          "Кабинет"
        ],
        "summary": "Фича-флаги текущего пользователя",
        "description": "Только карта известных code → boolean для аутентифицированного текущего пользователя и портала. Доступна по cookie, ключу API и embed-сессии; отдельного бизнес-права не требует. Контекст берётся из принципала, параметры запроса его не подменяют. Персональная аудитория определяется по последней активной Network identity текущей учётки независимо от способа входа. Не раскрывает аудиторию, историю или идентификатор Network.\n\nКлиентское разрешение не даёт права выполнить операцию: каждый потребитель проверяет тот же флаг на сервере перед побочными эффектами, затем обычные grants. Подтверждённое выключение потребителя даёт 403 feature_disabled; неподтверждённый снимок — 503 feature_flags_unavailable. Карта может измениться в течение 30 секунд после изменения в другом процессе; повторяйте запрос при смене контекста. Флаг telegram-scenarios истинен при All и настроенном BotID. При успешной отдельной проверке текущее значение telegramScenariosVersion присутствует и для All, и для Off. Ошибка этой проверки закрывает только Telegram и опускает версию. Остальные значения flags сохраняются.",
        "responses": {
          "200": {
            "description": "Успешный результат.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FeatureFlagResolveResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "flags": {}
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Ответ не сохраняется в кэше.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AccessRestricted"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/templates": {
      "get": {
        "operationId": "appEmployeeProcessTemplatesList",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Список шаблонов",
        "description": "Требует employee_process_template · view или employee_process_launch · edit. Запускающий без права чтения каталога получает только активные источники; это не разрешает менять шаблоны и не открывает произвольные кадровые данные.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов. Полный снимок не включается в список; откройте отдельную карточку по id.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTemplateList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                        "key": "",
                        "title": "Подготовка",
                        "scenario": "onboarding",
                        "state": "active",
                        "revision": 1,
                        "applicability": {
                          "company": true,
                          "departments": null
                        },
                        "itemCount": 1,
                        "updatedAt": "2026-10-06T10:00:00Z"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "in": "query",
            "name": "scenario",
            "schema": {
              "type": "string",
              "enum": [
                "onboarding",
                "offboarding",
                "mentoring",
                "transfer",
                "development",
                "return",
                "other"
              ]
            }
          },
          {
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "active",
                "archived"
              ]
            }
          },
          {
            "in": "query",
            "name": "department",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appEmployeeProcessTemplateCreate",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Создать шаблон",
        "description": "Требует employee_process_template · edit. Автор берётся из принципала; числовые внутренние ID и неизвестные поля тела не принимаются. Сроки и роли опубликованного шаблона сохраняются для новых запусков; существующие снимки не меняются.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.\n\nСтадии: stages и items[].stageKey необязательны. Без stages (или с null) сервер сохраняет стадии прежней редакции, сам упорядочивает пункты по стадиям, не требует непустых стадий и раннего предшественника; [] удаляет все стадии. Пункт без stageKey сохраняет стадию прежней редакции по ключу, новый пункт берёт стадию предыдущего; пустая строка — «Новый». Удалённая стадия оставляет след в retiredStages; следы ведёт сервер, в теле поле принимается и игнорируется. group устарело (заменено стадиями) и возвращается как получено. Причины details.reason правил стадий: retired_limit — поле stages, удалённых стадий больше 200, заведите новый шаблон; empty — stages.N, стадия без пунктов при активации; order — items.N.stageKey, пункты идут не по порядку стадий; stage_order — items.N.predecessor, предшественник в более поздней стадии; unknown — items.N.stageKey, такой стадии в шаблоне нет.",
        "responses": {
          "201": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "state": "draft",
                    "revision": 1,
                    "key": "",
                    "title": "Подготовка",
                    "description": "Чек-лист",
                    "scenario": "onboarding",
                    "applicability": {
                      "company": true,
                      "departments": null
                    },
                    "items": [
                      {
                        "key": "prepare",
                        "title": "Подготовить рабочее место",
                        "instruction": "Проверьте доступы",
                        "group": "Доступы",
                        "assigneeRole": "it",
                        "controllerRole": "",
                        "assigneeId": null,
                        "controllerId": null,
                        "offsetDays": 0,
                        "durationDays": 1,
                        "delayDays": 0,
                        "predecessor": "",
                        "workingDays": false,
                        "requirements": {
                          "rating": false,
                          "ratingRequired": false,
                          "commentRequired": false,
                          "question": "",
                          "scale": null,
                          "metricKey": ""
                        },
                        "stageKey": "preparation"
                      }
                    ],
                    "stages": [
                      {
                        "key": "preparation",
                        "title": "Подготовка",
                        "tone": "accent",
                        "description": "До выхода сотрудника"
                      }
                    ],
                    "retiredStages": []
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessTemplateRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/templates/{id}": {
      "get": {
        "operationId": "appEmployeeProcessTemplateDetail",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Карточка шаблона",
        "description": "Требует employee_process_template · view или employee_process_launch · edit. Запускающий без права чтения каталога получает только активные источники; это не разрешает менять шаблоны и не открывает произвольные кадровые данные.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "state": "draft",
                    "revision": 1,
                    "key": "",
                    "title": "Подготовка",
                    "description": "Чек-лист",
                    "scenario": "onboarding",
                    "applicability": {
                      "company": true,
                      "departments": null
                    },
                    "items": [
                      {
                        "key": "prepare",
                        "title": "Подготовить рабочее место",
                        "instruction": "Проверьте доступы",
                        "group": "Доступы",
                        "assigneeRole": "it",
                        "controllerRole": "",
                        "assigneeId": null,
                        "controllerId": null,
                        "offsetDays": 0,
                        "durationDays": 1,
                        "delayDays": 0,
                        "predecessor": "",
                        "workingDays": false,
                        "requirements": {
                          "rating": false,
                          "ratingRequired": false,
                          "commentRequired": false,
                          "question": "",
                          "scale": null,
                          "metricKey": ""
                        },
                        "stageKey": "preparation"
                      }
                    ],
                    "stages": [
                      {
                        "key": "preparation",
                        "title": "Подготовка",
                        "tone": "accent",
                        "description": "До выхода сотрудника"
                      }
                    ],
                    "retiredStages": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appEmployeeProcessTemplateUpdate",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Изменить шаблон",
        "description": "Требует employee_process_template · edit. Автор берётся из принципала; числовые внутренние ID и неизвестные поля тела не принимаются. Сроки и роли опубликованного шаблона сохраняются для новых запусков; существующие снимки не меняются.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.\n\nСтадии: stages и items[].stageKey необязательны. Без stages (или с null) сервер сохраняет стадии прежней редакции, сам упорядочивает пункты по стадиям, не требует непустых стадий и раннего предшественника; [] удаляет все стадии. Пункт без stageKey сохраняет стадию прежней редакции по ключу, новый пункт берёт стадию предыдущего; пустая строка — «Новый». Удалённая стадия оставляет след в retiredStages; следы ведёт сервер, в теле поле принимается и игнорируется. group устарело (заменено стадиями) и возвращается как получено. Причины details.reason правил стадий: retired_limit — поле stages, удалённых стадий больше 200, заведите новый шаблон; empty — stages.N, стадия без пунктов при активации; order — items.N.stageKey, пункты идут не по порядку стадий; stage_order — items.N.predecessor, предшественник в более поздней стадии; unknown — items.N.stageKey, такой стадии в шаблоне нет.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "state": "draft",
                    "revision": 1,
                    "key": "",
                    "title": "Подготовка",
                    "description": "Чек-лист",
                    "scenario": "onboarding",
                    "applicability": {
                      "company": true,
                      "departments": null
                    },
                    "items": [
                      {
                        "key": "prepare",
                        "title": "Подготовить рабочее место",
                        "instruction": "Проверьте доступы",
                        "group": "Доступы",
                        "assigneeRole": "it",
                        "controllerRole": "",
                        "assigneeId": null,
                        "controllerId": null,
                        "offsetDays": 0,
                        "durationDays": 1,
                        "delayDays": 0,
                        "predecessor": "",
                        "workingDays": false,
                        "requirements": {
                          "rating": false,
                          "ratingRequired": false,
                          "commentRequired": false,
                          "question": "",
                          "scale": null,
                          "metricKey": ""
                        },
                        "stageKey": "preparation"
                      }
                    ],
                    "stages": [
                      {
                        "key": "preparation",
                        "title": "Подготовка",
                        "tone": "accent",
                        "description": "До выхода сотрудника"
                      }
                    ],
                    "retiredStages": []
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessTemplateRequest"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/library": {
      "get": {
        "operationId": "appEmployeeProcessLibraryList",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Семь заготовок",
        "description": "Требует employee_process_template · view или employee_process_launch · edit. Запускающий без права чтения каталога получает только активные источники; это не разрешает менять шаблоны и не открывает произвольные кадровые данные.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessLibraryList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/library/{key}/copy": {
      "post": {
        "operationId": "appEmployeeProcessLibraryCopy",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Скопировать заготовку в редактируемый черновик",
        "description": "Требует employee_process_template · edit. Автор берётся из принципала; числовые внутренние ID и неизвестные поля тела не принимаются. Сроки и роли опубликованного шаблона сохраняются для новых запусков; существующие снимки не меняются.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "201": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTemplate"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                    "state": "draft",
                    "revision": 1,
                    "key": "",
                    "title": "Подготовка",
                    "description": "Чек-лист",
                    "scenario": "onboarding",
                    "applicability": {
                      "company": true,
                      "departments": null
                    },
                    "items": [
                      {
                        "key": "prepare",
                        "title": "Подготовить рабочее место",
                        "instruction": "Проверьте доступы",
                        "group": "Доступы",
                        "assigneeRole": "it",
                        "controllerRole": "",
                        "assigneeId": null,
                        "controllerId": null,
                        "offsetDays": 0,
                        "durationDays": 1,
                        "delayDays": 0,
                        "predecessor": "",
                        "workingDays": false,
                        "requirements": {
                          "rating": false,
                          "ratingRequired": false,
                          "commentRequired": false,
                          "question": "",
                          "scale": null,
                          "metricKey": ""
                        },
                        "stageKey": ""
                      }
                    ],
                    "stages": [],
                    "retiredStages": []
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/roles": {
      "get": {
        "operationId": "appEmployeeProcessRolesList",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Источники ролей",
        "description": "Требует employee_process_template · view или employee_process_launch · edit. Запускающий без права чтения каталога получает только активные источники; это не разрешает менять шаблоны и не открывает произвольные кадровые данные.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessRoleList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "Количество пользовательских ролей; первая страница дополнительно содержит шесть встроенных ролей."
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Курсор next предыдущей страницы этого портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appEmployeeProcessRoleSave",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Сохранить роль и назначение компании",
        "description": "Требует employee_process_template · edit. Автор берётся из принципала; числовые внутренние ID и неизвестные поля тела не принимаются. Сроки и роли опубликованного шаблона сохраняются для новых запусков; существующие снимки не меняются.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessRole"
                    }
                  }
                },
                "example": {
                  "data": {
                    "key": "mentor",
                    "name": "Наставник",
                    "defaultUserId": null,
                    "archived": false,
                    "builtin": true,
                    "revision": 1
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessRoleRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/settings": {
      "get": {
        "operationId": "appEmployeeProcessSettings",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Пояс компании для процессов",
        "description": "Требует employee_process_template · view или employee_process_launch · edit. Запускающий без права чтения каталога получает только активные источники; это не разрешает менять шаблоны и не открывает произвольные кадровые данные.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessSettings"
                    }
                  }
                },
                "example": {
                  "data": {
                    "zone": "Europe/Kaliningrad",
                    "revision": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appEmployeeProcessSettingsSave",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Изменить пояс для новых процессов",
        "description": "Требует employee_process_template · edit. Автор берётся из принципала; числовые внутренние ID и неизвестные поля тела не принимаются. Сроки и роли опубликованного шаблона сохраняются для новых запусков; существующие снимки не меняются.\n\nОшибки полей возвращают validation_failed с details.field и details.reason. Конфликт версии — conflict; отсутствующий или чужой объект — not_found. Тексты инструкций/описания ограничены 16000 символами Unicode, сериализованный источник — 12 MiB JSON; тело сохранения — до 13 MiB. Не более 500 пунктов.",
        "responses": {
          "200": {
            "description": "Результат операции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessSettings"
                    }
                  }
                },
                "example": {
                  "data": {
                    "zone": "Europe/Kaliningrad",
                    "revision": 1
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessSettingsRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Мета-процессы сотрудников",
        "description": "Постраничная текущая проекция с правом employee_process.view и серверным построчным фильтром. Участие координатора открывает свой мета-процесс только человеку; исполнители и контролёры видят свои задания отдельно. Ключ не получает участия. Внутренние идентификаторы не возвращаются. Поиск по названию запуска или текущему ФИО сотрудника. coordinator — публичный UUID текущего координатора, problems — строго true/false. Все фильтры применяются в SQL до пагинации и текущие права перепроверяются. state=open выбирает planned/in_progress; state=all или отсутствие state сохраняют полное чтение. Имена/отделы — текущие связанные люди/отделы Б24; problems считает только незавершённые проблемы неотменённых процессов по тому же предикату, что задания.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Название мета-процесса или ФИО сотрудника."
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "onboarding",
                "offboarding",
                "mentoring",
                "transfer",
                "development",
                "return",
                "other"
              ]
            }
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "all",
                "planned",
                "in_progress",
                "completed",
                "cancelled"
              ]
            }
          },
          {
            "name": "coordinator",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "problems",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessMetaList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessesList",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Карточка мета-процесса",
        "description": "Постраничная текущая проекция с правом employee_process.view и серверным построчным фильтром. Участие координатора открывает свой мета-процесс только человеку; исполнители и контролёры видят свои задания отдельно. Ключ не получает участия. Внутренние идентификаторы не возвращаются.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessMeta"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "employeeId": null,
                    "coordinatorId": null,
                    "authorId": null,
                    "title": "Адаптация",
                    "scenario": "onboarding",
                    "anchor": "2026-10-06",
                    "revision": 1,
                    "state": "in_progress",
                    "canManage": false,
                    "summary": {
                      "state": "in_progress",
                      "total": 10,
                      "completed": 3,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": 30
                    },
                    "employeeName": "Сотрудник",
                    "coordinatorName": "Координатор",
                    "departments": [],
                    "problems": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessDetail",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appEmployeeProcessManagementConfirm",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Подтвердить управление процессом",
        "description": "Требуется текущее process.edit; только previewId в теле. Сервер проверяет активного автора, портал, срок, версию и соответствие мета-процессу из пути до записи (несовпадение404). Применяет замороженные последствия атомарно. Повтор подтверждения409 не повторяет события.200 — текущая карточка через обычный process.view/участие;204 без тела, если просмотр недоступен.",
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessMeta"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "employeeId": null,
                    "coordinatorId": null,
                    "authorId": null,
                    "title": "Адаптация",
                    "scenario": "onboarding",
                    "anchor": "2026-10-06",
                    "revision": 1,
                    "state": "in_progress",
                    "canManage": false,
                    "summary": {
                      "state": "in_progress",
                      "total": 10,
                      "completed": 3,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": 30
                    },
                    "employeeName": "Сотрудник",
                    "coordinatorName": "Координатор",
                    "departments": [],
                    "problems": 0
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessManagementConfirmRequest"
              },
              "example": {
                "previewId": "11111111-1111-1111-1111-111111111111"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/instances": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Самостоятельные вложенные процессы",
        "description": "Постраничная текущая проекция с правом employee_process.view и серверным построчным фильтром. Участие координатора открывает свой мета-процесс только человеку; исполнители и контролёры видят свои задания отдельно. Ключ не получает участия. Внутренние идентификаторы не возвращаются.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessInstanceList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessInstancesList",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/tasks": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Задания мета-процесса",
        "description": "Постраничная текущая проекция с правом employee_process.view и серверным построчным фильтром. Участие координатора открывает свой мета-процесс только человеку; исполнители и контролёры видят свои задания отдельно. Ключ не получает участия. Внутренние идентификаторы не возвращаются.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "onboarding",
                "offboarding",
                "mentoring",
                "transfer",
                "development",
                "return",
                "other"
              ]
            }
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "processId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "planned",
                "available",
                "completed",
                "skipped",
                "cancelled",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTaskList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTasksList",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Три таба заданий",
        "description": "Постраничная текущая проекция с правом employee_process.view и серверным построчным фильтром. Участие координатора открывает свой мета-процесс только человеку; исполнители и контролёры видят свои задания отдельно. Ключ не получает участия. Внутренние идентификаторы не возвращаются.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "onboarding",
                "offboarding",
                "mentoring",
                "transfer",
                "development",
                "return",
                "other"
              ]
            }
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "metaId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "processId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tab",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "attention",
                "assigned",
                "control"
              ],
              "default": "attention"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "planned",
                "available",
                "completed",
                "skipped",
                "cancelled",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTaskList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessPersonalTasksList",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks/departments": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Отделы сотрудников в моих заданиях",
        "description": "Текущие отделы Б24 сотрудников только из доступных назначенных или контролируемых заданий. Участие действует для куки; ключ проверяется текущим явным process.view. Закрытые задания сохраняют варианты для фильтров all/cancelled. Чужие, недоступные и отсутствующие в текущем снимке отделы исключены. search ищет буквально в имени отдела; department разрешает подпись выбранного отдела из URL в том же скоупе. По умолчанию25, максимум100; after — непрозрачная позиция, связанная с порталом, пользователем, ключом и фильтрами.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTaskDepartmentList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": 42,
                        "name": "Разработка"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTaskDepartmentsList",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks/{id}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Карточка задания",
        "description": "Текущая карточка с замороженной инструкцией, требованиями и результатом. employee_process.view применяется построчно; cookie-участник видит только своё задание. Личный черновик доступен только текущему исполнителю-человеку, сохранившему его; контролёр, HR и API-ключ получают draft=null. canManage отражает текущее право управления мета-процессом. Все ссылки — публичные UUID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTaskCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "metaId": "11111111-1111-1111-1111-111111111111",
                    "processId": "11111111-1111-1111-1111-111111111111",
                    "title": "Знакомство",
                    "metaTitle": "Адаптация",
                    "processTitle": "Первая неделя",
                    "scenario": "onboarding",
                    "state": "available",
                    "revision": 1,
                    "assigneeId": null,
                    "controllerId": null,
                    "startAt": null,
                    "dueBefore": null,
                    "originalDueBefore": null,
                    "assigneeInactive": false,
                    "controllerInactive": false,
                    "help": false,
                    "needsCalendar": false,
                    "overdue": false,
                    "problem": false,
                    "item": {
                      "key": "prepare",
                      "title": "Подготовить рабочее место",
                      "instruction": "Проверьте доступы",
                      "group": "Доступы",
                      "assigneeRole": "it",
                      "controllerRole": "",
                      "assigneeId": null,
                      "controllerId": null,
                      "offsetDays": 0,
                      "durationDays": 1,
                      "delayDays": 0,
                      "predecessor": "",
                      "workingDays": false,
                      "requirements": {
                        "rating": false,
                        "ratingRequired": false,
                        "commentRequired": false,
                        "question": "",
                        "scale": null,
                        "metricKey": ""
                      },
                      "stageKey": ""
                    },
                    "result": null,
                    "draft": null,
                    "dateOverridden": false,
                    "assignmentSource": "",
                    "controlSource": "",
                    "finishedAt": null,
                    "finishedBy": null,
                    "canManage": false,
                    "zone": "Europe/Kaliningrad",
                    "people": [],
                    "canComplete": false,
                    "canHelp": false,
                    "canComment": true,
                    "canControl": false,
                    "employeeId": null,
                    "employeeName": "Employee",
                    "assigneeName": "Assignee",
                    "controllerName": "Controller"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTaskDetail",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appEmployeeProcessTaskCommand",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Изменить задание процесса",
        "description": "Выполнение/сохранение результата и отметка помощи доступны только действующему исполнителю по cookie после открытия (помощь возможна до открытия); ключи не выполняют эти действия. Управление требует employee_process.edit на текущем мета-процессе; участие контролёра не даёт управление. expectedRevision обязателен; устаревшая версия409, повтор того же успешного завершения не создаёт второй факт. Действия имеют отдельные поля; неизвестные/посторонние поля400. Оценка0 означает без оценки и проходит только если она не обязательна в замороженных требованиях. Отмена предшественника требует cascade либо reparent с replacementKey; операция атомарна, завершённые факты сохраняются. Причины skip/cancel/reopen/restore обязательны. reschedule принимает явные startAt/dueBefore (исключительная граница) в UTC диапазоне1000–9999, сохраняет первоначальный срок. instruction/comment/reason до16000 Unicode символов.128 КиБ кодированного JSON. Новые участники — активные публичные UUID текущего портала. Ответ200 проходит тот же текущий фильтр, что GET карточки; при потере права чтения204 без тела. Сырая история/числовые ID/чужие черновики не возвращаются.",
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessTaskCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "metaId": "11111111-1111-1111-1111-111111111111",
                    "processId": "11111111-1111-1111-1111-111111111111",
                    "title": "Знакомство",
                    "metaTitle": "Адаптация",
                    "processTitle": "Первая неделя",
                    "scenario": "onboarding",
                    "state": "available",
                    "revision": 1,
                    "assigneeId": null,
                    "controllerId": null,
                    "startAt": null,
                    "dueBefore": null,
                    "originalDueBefore": null,
                    "assigneeInactive": false,
                    "controllerInactive": false,
                    "help": false,
                    "needsCalendar": false,
                    "overdue": false,
                    "problem": false,
                    "item": {
                      "key": "prepare",
                      "title": "Подготовить рабочее место",
                      "instruction": "Проверьте доступы",
                      "group": "Доступы",
                      "assigneeRole": "it",
                      "controllerRole": "",
                      "assigneeId": null,
                      "controllerId": null,
                      "offsetDays": 0,
                      "durationDays": 1,
                      "delayDays": 0,
                      "predecessor": "",
                      "workingDays": false,
                      "requirements": {
                        "rating": false,
                        "ratingRequired": false,
                        "commentRequired": false,
                        "question": "",
                        "scale": null,
                        "metricKey": ""
                      },
                      "stageKey": ""
                    },
                    "result": null,
                    "draft": null,
                    "dateOverridden": false,
                    "assignmentSource": "",
                    "controlSource": "",
                    "finishedAt": null,
                    "finishedBy": null,
                    "canManage": false,
                    "zone": "Europe/Kaliningrad",
                    "people": [],
                    "canComplete": false,
                    "canHelp": false,
                    "canComment": true,
                    "canControl": false,
                    "employeeId": null,
                    "employeeName": "Employee",
                    "assigneeName": "Assignee",
                    "controllerName": "Controller"
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение выполнено; текущие права не разрешают читать карточку. Тело отсутствует."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Для режима рабочих дней отсутствует календарь или необходимый загруженный год. Пересчёт идёт по снимку календаря, замороженному при запуске (годы подмены — из снимка), и в отказе calendar_coverage_required details.year — год без календаря, а details.calendar = null: снимок не хранит, какой календарь был базовым.",
            "x-error-codes": [
              "calendar_coverage_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessTaskCommandRequest"
              },
              "example": {
                "action": "complete",
                "expectedRevision": 3,
                "rating": 0,
                "comment": "Готово"
              }
            }
          }
        },
        "parameters": [],
        "x-max-body-bytes": 131072,
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/previews/{id}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Заголовок предпросмотра запуска",
        "description": "Требуется employee_process_launch.edit. Только активный автор в текущем портале читает свой неистекший предпросмотр. Снимок сохраняет исходные сроки, роли и шаблоны после правок источников; подтверждение запуска отдельно проверяет актуальность источников. Заголовок не содержит тел заданий; задания выдаются страницами 25 (максимум 100), курсор связан с предпросмотром и выбранным шаблоном. Все ссылки на участников — публичные UUID. Явный hire требует текущие process.edit и analytics.view; заявки дополнительно application.view, явное оформление onboarding.view. Блок сохранённого hire читается по текущим правам; отзыв скрывает его без закрытия общего предпросмотра. KЭДО ссылка/статус отдельно закрыты без onboarding.view. Изменённый источник остаётся читаемым, но подтверждение конфликтует.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessLaunchPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "expiresAt": "2026-10-07T12:00:00Z",
                    "employeeId": "11111111-1111-1111-1111-111111111111",
                    "coordinatorId": "11111111-1111-1111-1111-111111111111",
                    "title": "Адаптация",
                    "scenario": "onboarding",
                    "anchor": "2026-10-06",
                    "actualStartDate": null,
                    "zone": "Europe/Kaliningrad",
                    "calendarId": null,
                    "calendarName": "",
                    "calendarSource": "weekdays",
                    "roles": {
                      "hr": "11111111-1111-1111-1111-111111111111"
                    },
                    "companyRoles": {},
                    "processes": [
                      {
                        "template": {
                          "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                          "key": "",
                          "title": "Подготовка",
                          "scenario": "onboarding",
                          "state": "active",
                          "revision": 1,
                          "applicability": {
                            "company": true,
                            "departments": null
                          },
                          "itemCount": 1,
                          "updatedAt": "2026-10-06T10:00:00Z"
                        },
                        "roles": {},
                        "controllerId": null,
                        "summary": {
                          "state": "planned",
                          "total": 2,
                          "completed": 0,
                          "skipped": 0,
                          "cancelled": 0,
                          "cancelledProcesses": 0,
                          "percent": 0
                        }
                      }
                    ],
                    "calendarYears": [],
                    "summary": {
                      "state": "planned",
                      "total": 2,
                      "completed": 0,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": 0
                    },
                    "duplicateCount": 0,
                    "duplicateLinks": [],
                    "canManageAfterLaunch": true,
                    "hireAccess": "none",
                    "hire": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк срок предпросмотра. Создайте новый.",
            "x-error-codes": [
              "preview_expired"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessLaunchPreview",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/previews/{id}/processes/{templateId}/tasks": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Задания предпросмотра запуска",
        "description": "Требуется employee_process_launch.edit. Только активный автор в текущем портале читает свой неистекший предпросмотр. Снимок сохраняет исходные сроки, роли и шаблоны после правок источников; подтверждение запуска отдельно проверяет актуальность источников. Заголовок не содержит тел заданий; задания выдаются страницами 25 (максимум 100), курсор связан с предпросмотром и выбранным шаблоном. Все ссылки на участников — публичные UUID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessPreviewTaskList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "item": {
                          "key": "prepare",
                          "title": "Подготовить рабочее место",
                          "instruction": "Проверьте доступы",
                          "group": "Доступы",
                          "assigneeRole": "it",
                          "controllerRole": "",
                          "assigneeId": null,
                          "controllerId": null,
                          "offsetDays": 0,
                          "durationDays": 1,
                          "delayDays": 0,
                          "predecessor": "",
                          "workingDays": false,
                          "requirements": {
                            "rating": false,
                            "ratingRequired": false,
                            "commentRequired": false,
                            "question": "",
                            "scale": null,
                            "metricKey": ""
                          },
                          "stageKey": ""
                        },
                        "startAt": null,
                        "dueBefore": null,
                        "conditional": true,
                        "originalDueBefore": null,
                        "dateOverridden": false,
                        "assigneeId": "11111111-1111-1111-1111-111111111111",
                        "controllerId": null,
                        "assignmentSource": "employee",
                        "controlSource": "",
                        "completion": null,
                        "overdue": false
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк срок предпросмотра. Создайте новый.",
            "x-error-codes": [
              "preview_expired"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessLaunchPreviewTasks",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/launch": {
      "post": {
        "operationId": "appEmployeeProcessLaunchConfirm",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Подтвердить запуск процессов",
        "description": "Требуется employee_process_launch.edit. Подтверждает собственный неистекший предпросмотр в текущем портале; передаются только previewId, idempotencyKey (1–128 печатных ASCII без пробелов) и duplicateConfirmed. Изменённые источники требуют нового предпросмотра. Повтор с тем же ключом после потерянного ответа возвращает тот же процесс без новых заданий. Если актуальное право чтения скрывает созданный процесс, ответ 204 без карточки. Автор и снимок задаются сервером.",
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessMeta"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "employeeId": null,
                    "coordinatorId": null,
                    "authorId": null,
                    "title": "Адаптация",
                    "scenario": "onboarding",
                    "anchor": "2026-10-06",
                    "revision": 1,
                    "state": "in_progress",
                    "canManage": false,
                    "summary": {
                      "state": "in_progress",
                      "total": 10,
                      "completed": 3,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": 30
                    },
                    "employeeName": "Сотрудник",
                    "coordinatorName": "Координатор",
                    "departments": [],
                    "problems": 0
                  }
                }
              }
            }
          },
          "204": {
            "description": "Изменение сохранено. Карточка не возвращается, если право чтения не открывает результат."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessLaunchConfirmRequest"
              },
              "example": {
                "previewId": "11111111-1111-1111-1111-111111111111",
                "idempotencyKey": "launch-2026-10-06-1",
                "duplicateConfirmed": false
              }
            }
          }
        },
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/previews": {
      "post": {
        "operationId": "appEmployeeProcessLaunchPreviewCreate",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Создать предпросмотр запуска",
        "description": "Требуется employee_process_launch.edit. Общая опорная дата может быть в прошлом, настоящем или будущем. Выберите до20 дополняющих активных шаблонов, до500 заданий каждого. Вход использует публичные UUID активных участников текущего портала; числовые ID, автор и вычисленные источники не принимаются. Глобальные роли и локальные назначения/контроль/сроки/ретроспективные факты задаются отдельно для выбранных шаблонов. Календарь, пояс и настройки ролей компании фиксирует сервер. Результат201 — только заголовок замороженного предпросмотра; задания читаются отдельными страницами. Бюджет кодированного JSON128 МиБ (включая пробелы/escape); превышение400 bad_request до создания предпросмотра, без усечения.16000 Unicode-символов на комментарий сохраняются; чрезмерный суммарный текст надо уменьшить перед повтором. Моменты времени должны попадать в диапазон UTC1000–9999; рабочие дни требуют загруженных календарных лет. actualStartDate — отдельная фактическая дата, не заполняется автоматически из якоря. Явный hire требует текущие process.edit и analytics.view; заявки дополнительно application.view, явное оформление onboarding.view. Блок сохранённого hire читается по текущим правам; отзыв скрывает его без закрытия общего предпросмотра. KЭДО ссылка/статус отдельно закрыты без onboarding.view. Изменённый источник остаётся читаемым, но подтверждение конфликтует.\n\nКалендарь сотрудника — по его подразделениям с наследованием по дереву (ближайший привязанный предок). Года нет в региональном календаре, а в базовом есть — сроки рабочих дней считаются по базовому без региональных праздников, и снимок называет такие годы (calendarFallbackYears предпросмотра).",
        "responses": {
          "201": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessLaunchPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "expiresAt": "2026-10-07T12:00:00Z",
                    "employeeId": "11111111-1111-1111-1111-111111111111",
                    "coordinatorId": "11111111-1111-1111-1111-111111111111",
                    "title": "Адаптация",
                    "scenario": "onboarding",
                    "anchor": "2026-10-06",
                    "actualStartDate": null,
                    "zone": "Europe/Kaliningrad",
                    "calendarId": null,
                    "calendarName": "",
                    "calendarSource": "weekdays",
                    "roles": {
                      "hr": "11111111-1111-1111-1111-111111111111"
                    },
                    "companyRoles": {},
                    "processes": [
                      {
                        "template": {
                          "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                          "key": "",
                          "title": "Подготовка",
                          "scenario": "onboarding",
                          "state": "active",
                          "revision": 1,
                          "applicability": {
                            "company": true,
                            "departments": null
                          },
                          "itemCount": 1,
                          "updatedAt": "2026-10-06T10:00:00Z"
                        },
                        "roles": {},
                        "controllerId": null,
                        "summary": {
                          "state": "planned",
                          "total": 2,
                          "completed": 0,
                          "skipped": 0,
                          "cancelled": 0,
                          "cancelledProcesses": 0,
                          "percent": 0
                        }
                      }
                    ],
                    "calendarYears": [],
                    "summary": {
                      "state": "planned",
                      "total": 2,
                      "completed": 0,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": 0
                    },
                    "duplicateCount": 0,
                    "duplicateLinks": [],
                    "canManageAfterLaunch": true,
                    "hireAccess": "none",
                    "hire": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Версия изменилась; перечитайте объект.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Для режима рабочих дней отсутствует календарь или необходимый загруженный год. Года нет ни в календаре, ни (у регионального) в базовом — calendar_coverage_required с details.year (год) и details.calendar (id календаря, куда год загружать: базовый, если он есть; null — календаря нет вовсе).",
            "x-error-codes": [
              "calendar_coverage_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessLaunchRequest"
              },
              "example": {
                "employeeId": "11111111-1111-1111-1111-111111111111",
                "coordinatorId": "11111111-1111-1111-1111-111111111111",
                "title": "Адаптация",
                "scenario": "onboarding",
                "anchor": "2026-10-05",
                "templateIds": [
                  "11111111-1111-1111-1111-111111111111"
                ],
                "roles": {
                  "hr": "11111111-1111-1111-1111-111111111111"
                },
                "processes": {
                  "11111111-1111-1111-1111-111111111111": {
                    "completions": {
                      "prepare": {
                        "at": "2026-10-04T12:00:00Z",
                        "rating": 0,
                        "comment": "Сделано до опорной даты"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-max-body-bytes": 134217728,
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks/{id}/comments": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Обсуждение задания",
        "description": "Текущий process.view или узкое участие исполнителя/контролёра по cookie. Ключи получают только свой уровень просмотра. Страница по25 комментариев, limit1–100, непрозрачный after текущего портала/задания до4096 байт. Авторы — публичные UUID; отсутствующий исторический автор null. Обсуждение доступно до открытия и после завершения, без доступа к приватным черновикам и полному мета-процессу.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessCommentList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "authorId": "11111111-1111-1111-1111-111111111111",
                        "body": "Вопрос до открытия",
                        "createdAt": "2026-10-06T12:00:00Z"
                      }
                    ],
                    "next": null,
                    "people": [
                      {
                        "id": "11111111-1111-1111-1111-111111111111",
                        "name": "Иван Иванов"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTaskComments",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appEmployeeProcessTaskCommentCreate",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Добавить комментарий задания",
        "description": "Текущая версия expectedRevision и непустой body до16000 Unicode символов, кодированный JSON до128 КиБ. Автор/время задаются сервером, подмена автора и посторонние поля400. Требуется просмотр/управление текущим мета-процессом либо узкое участие исполнителя/контролёра по cookie; API-ключу нужен уровень, участие не открывается. Комментарий допустим до открытия и после завершения и не выполняет задание. Запись атомарно меняет версию, устаревшая версия409 не создаёт второй комментарий. Ответ204 без снимка задания; обновите страницу обсуждения и текущую карточку/версию.",
        "responses": {
          "204": {
            "description": "Комментарий записан. Тело отсутствует."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessCommentRequest"
              },
              "example": {
                "expectedRevision": 3,
                "body": "Уточните порядок действий"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-max-body-bytes": 131072,
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/previews": {
      "post": {
        "operationId": "appEmployeeProcessManagementPreviewCreate",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Предпросмотр управления процессом",
        "description": "Текущее employee_process.edit на мета-процессе. Все варианты требуют положительную expectedRevision и непустую reason до16000 Unicode символов. change_anchor меняет гражданскую anchor; update_calendar выбирает календарь портала. update_roles/update_local_roles меняют явные роли (null возвращает наследование), update_process_controller меняет контролёра (null возвращает координатора). cancel_process/restore_process действуют только на instanceId. Поля других вариантов, включая null, отвергаются; участники — активные публичные UUID текущего портала.128 КиБ JSON; автор/источники задаются сервером. Отмена затрагивает только незавершённые задания, сохраняет факты; восстановление агрегата не восстанавливает его процессы/задания автоматически. Ответ — замороженные публичные последствия,25 первоначальных строк, count/next; нет приватных черновиков, результатов, инструкций и внутренних SQL ID. Версия409, календарь422, срок предпросмотра ограничен. add_item использует instanceId+публичный item; item.stageKey выбирает стадию копии, без него пункт дописывается в конец со стадией последнего задания; add_process — templateId+необязательный process с переопределениями запуска. Бюджет добавлений128 МиБ, других команд128 КиБ, включая пробелы/escape. Шаблон и календарь задаются сервером. Заголовок не содержит инструкций/импортированных фактов; новые задания читаются additions. stateAfter задан только для cancel_meta/restore_meta.",
        "responses": {
          "201": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "metaId": "11111111-1111-1111-1111-111111111111",
                    "expiresAt": "2026-10-06T12:15:00Z",
                    "revision": 3,
                    "stateBefore": "planned",
                    "stateAfter": "cancelled",
                    "count": 0,
                    "items": [],
                    "next": null,
                    "action": "cancel_meta",
                    "instanceId": null,
                    "additionCount": 0,
                    "source": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessManagementRequest"
              },
              "example": {
                "action": "cancel_meta",
                "expectedRevision": 3,
                "reason": "Больше не требуется"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/change-previews/{id}/tasks": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Страница последствий управления",
        "description": "Текущий process.edit и собственный действующий предпросмотр с той же версией мета-процесса. Публичные строки последствий, default25/limit1–100, after до4096 байт, текущий портал/предпросмотр/автор. Приватные черновики и результаты не выдаются. Устаревший/истёкший предпросмотр409.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessConsequenceList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementConsequences",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/change-previews/{id}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Замороженный предпросмотр управления",
        "description": "Автор, текущий портал и employee_process.edit; срок и версия проверяются на каждом чтении. Метаданные и25 первоначальных последствий существующих заданий. additionCount/source описывают новые задания; инструкции и импортированные факты доступны отдельной страницей additions. stateAfter задан только для cancel_meta/restore_meta, остальные итоги возвращаются актуальной карточкой после подтверждения.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "metaId": "11111111-1111-1111-1111-111111111111",
                    "expiresAt": "2026-10-06T12:15:00Z",
                    "revision": 3,
                    "stateBefore": "planned",
                    "stateAfter": "cancelled",
                    "count": 0,
                    "items": [],
                    "next": null,
                    "action": "cancel_meta",
                    "instanceId": null,
                    "additionCount": 0,
                    "source": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementPreviewGet",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/change-previews/{id}/additions": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Новые задания управляющего предпросмотра",
        "description": "Замороженные предлагаемые задания add_item/add_process: инструкции, требования, сроки, публичные исполнители/контролёры, импортированные факты.25 строк по умолчанию, максимум100. Курсор связан с порталом и предпросмотром. Автор и текущее employee_process.edit, срок и версия проверяются на каждой странице. Изменения каталога не меняют замороженное чтение.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessPreviewTaskList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Истёк предпросмотр, изменились источники или необходимо подтвердить повторный запуск в свежем предпросмотре.",
            "x-error-codes": [
              "conflict",
              "preview_expired",
              "duplicate_confirmation_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementAdditions",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/history": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "История мета-процесса",
        "description": "Неизменяемая история,25 записей по умолчанию, максимум100; непрозрачный курсор связан с текущим порталом и ресурсом. Текущие права проверяются на каждой странице. Полную историю видит текущий координатор по cookie или пользователь с подходящими employee_process.view/edit. Автор и люди — публичные UUID. Время внесения и факта различаются. before/after содержат только явные типизированные значения известных событий; черновики и внутренние ID отсутствуют. Неизвестный вид события возвращает метаданные и null-снимки. Доступ к подбору этим не открывается.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessHistoryList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "kind": "meta.launched",
                        "actorId": "11111111-1111-4111-8111-111111111111",
                        "occurredAt": "2026-10-06T12:00:00Z",
                        "factAt": null,
                        "taskId": null,
                        "processId": null,
                        "taskTitle": "",
                        "processTitle": "",
                        "before": null,
                        "after": {
                          "meta": {
                            "id": "22222222-2222-4222-8222-222222222222",
                            "title": "Адаптация",
                            "anchor": "2026-10-01",
                            "coordinatorId": "11111111-1111-4111-8111-111111111111",
                            "state": "in_progress"
                          }
                        },
                        "reason": ""
                      }
                    ],
                    "next": null,
                    "people": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "name": "Иван Иванов"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessMetaHistory",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks/{id}/history": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "История задания",
        "description": "Неизменяемая история,25 записей по умолчанию, максимум100; непрозрачный курсор связан с текущим порталом и ресурсом. Текущие права проверяются на каждой странице. Участие открывает только историю своего задания; API-ключи не получают права по участию. Автор и люди — публичные UUID. Время внесения и факта различаются. before/after содержат только явные типизированные значения известных событий; черновики и внутренние ID отсутствуют. Неизвестный вид события возвращает метаданные и null-снимки. Доступ к подбору этим не открывается.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessHistoryList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [],
                    "next": null,
                    "people": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTaskHistory",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/launch-context/{employeeId}/hire-choices": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Доступные эпизоды и источники найма для явного выбора",
        "description": "launch.edit, process.edit и analytics.view по текущим уровням и потолку ключа, без участия. Для заявок дополнительно application.view; существующие связанные эпизоды фильтруются также текущим доступом к заявке. Источник не связывается автоматически. По умолчанию рекомендуются только подтверждённые совпадающие Б24 аккаунты; явное includeUnmatched расширяет поиск неизвестных, но исключает два разных подтверждённых ID. Оформление возвращается только с onboarding.view. Только публичные метаданные, без оценок, комментариев подбора или КЭДО-пакетов. Текущая фактическая дата hired_on nullable, якорь её не заменяет. Курсор зашифрован и привязан к порталу, сотруднику, актору/ключу, виду/поиску/расширению; страницы25, максимум100.",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "episodes",
                "applications"
              ]
            }
          },
          {
            "name": "includeUnmatched",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessHireChoices"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-1111-1111-111111111111",
                        "applicationId": "11111111-1111-1111-1111-111111111111",
                        "onboardingId": null,
                        "candidateName": "Иван Иванов",
                        "vacancyTitle": "Инженер",
                        "actualStartDate": null,
                        "revision": 0,
                        "hasPrimary": false,
                        "identityMatched": true
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessLaunchHireChoices",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/launch-context/{employeeId}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Текущий контекст сотрудника для запуска",
        "description": "Требуется employee_process_launch.edit для cookie и API-ключа, без участия и без расширения portal_user/work_calendar/analytics. Текущий портал, только активный сотрудник. Текущие отделы Б24 без пропавших; руководитель предложен только если единственный активный и отличается от сотрудника. Календарь сотрудника — по его подразделениям с наследованием по дереву: подразделение без своей привязки получает календарь ближайшего привязанного предка, пропавшие из Битрикс24 не участвуют; разные календари у отделов — базовый. Отсутствие календаря явно отражено. Выбор календарей постраничный,25 по умолчанию,максимум100,устойчивый порядок создания, публичный UUID курсора проверяется в текущем портале. Только метаданные, без дней, инструкций или данных найма. Предпросмотр и подтверждение повторно проверяют источники.",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessLaunchContext"
                    }
                  }
                },
                "example": {
                  "data": {
                    "employee": {
                      "id": "11111111-1111-1111-1111-111111111111",
                      "name": "Иван Иванов"
                    },
                    "departments": [],
                    "manager": null,
                    "zone": "Europe/Kaliningrad",
                    "calendar": null,
                    "calendarSource": "none",
                    "recommendedTemplates": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessLaunchContext",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/pickers/calendars": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Календари для запуска процессов",
        "description": "Требуется employee_process_launch.edit для cookie и API-ключа, без участия и без расширения portal_user/work_calendar/analytics. Текущий портал, только активный сотрудник. Текущие отделы Б24 без пропавших; руководитель предложен только если единственный активный и отличается от сотрудника. Календарь сотрудника определяется существующей политикой; отсутствие календаря явно отражено. Выбор календарей постраничный,25 по умолчанию,максимум100,устойчивый порядок создания, публичный UUID курсора проверяется в текущем портале. Только метаданные, без дней, инструкций или данных найма. Предпросмотр и подтверждение повторно проверяют источники.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessCalendarOptions"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "22222222-2222-2222-2222-222222222222",
                        "name": "Базовый календарь",
                        "isDefault": true
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessLaunchCalendars",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/tasks/{id}/dependency-choices": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Варианты замены предшественника при отмене задания",
        "description": "Только текущий employee_process.edit в скоупе родительского мета-процесса и активный пользователь. Участие исполнителя/контролирующего и process.view не открывают граф. API-ключ ограничен явным правом редактирования. Возвращаются только публичные UUID, сохранённые локальные ключи, названия и состояния пунктов того же вложенного процесса. Текущее задание, все его потомки (в том числе через завершённые пункты) и отменённые пункты исключены. Завершённый или пропущенный пункт может стать заменой. Текущий шаблон не перечитывается; инструкции, результаты и черновики не выдаются. По умолчанию25, максимум100; непрозрачный after связан с порталом, пользователем, ключом, заданием и текущей ревизией мета-процесса. После изменения графа страницы следует загрузить заново. Окончательная проверка замены выполняется атомарной командой отмены.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessDependencyChoiceList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "key": "replacement",
                        "title": "Альтернативная встреча",
                        "state": "skipped"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessTaskDependencyChoices",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/calendar-choices": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Календари для изменения мета-процесса",
        "description": "Только текущий employee_process.edit в скоупе указанного мета-процесса и активный пользователь. Участие, process.view и права запуска/библиотеки не заменяют право редактирования строки. API-ключ ограничен своим явным уровнем. По умолчанию 25, максимум 100. Непрозрачный after связан с порталом, пользователем, ключом, мета-процессом и его текущей ревизией; после изменения или отзыва прав выборку следует начать заново. Возвращает только публичный UUID, название и признак календаря по умолчанию. Дни, покрытие и автор календаря не выдаются. Выбор календаря и проверка его покрытия выполняются серверным предпросмотром изменения.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementCalendarList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "name": "Рабочий календарь",
                        "isDefault": true
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementCalendars",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/source-templates": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Дополняющие шаблоны для существующего мета-процесса",
        "description": "Только текущий employee_process.edit в скоупе указанного мета-процесса и активный пользователь. Участие, process.view и права запуска/библиотеки не заменяют право редактирования строки. API-ключ ограничен своим явным уровнем. По умолчанию 25, максимум 100. Непрозрачный after связан с порталом, пользователем, ключом, мета-процессом и его текущей ревизией; после изменения или отзыва прав выборку следует начать заново. Возвращает только сводку активных шаблонов. Уже прикреплённые источники, включая отменённые вложенные процессы, исключены. Поиск по названию буквальный; символы % и _ не являются маской. Инструкции, пункты, участники и результаты не выдаются. Изменение источника перед подтверждением проверяет сервер. Курсор также связан с search и scenario.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "onboarding",
                "offboarding",
                "mentoring",
                "transfer",
                "development",
                "return",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementSourceList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "key": "additional",
                        "title": "Дополнительное обучение",
                        "scenario": "other",
                        "state": "active",
                        "revision": 1,
                        "applicability": {
                          "company": true,
                          "departments": []
                        },
                        "itemCount": 2,
                        "updatedAt": null
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementSources",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/source-templates/{templateId}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Выбранный источник для добавления независимого процесса",
        "description": "Только текущий scoped employee_process.edit, активный пользователь и соответствующий уровень API-ключа. Process.view, участие, права запуска или каталога не заменяют редактирование указанного мета-процесса. Полное актуальное определение одного активного ещё не прикреплённого шаблона (до500 пунктов) и публичные имена только прямо упомянутых людей/использованных ролей. Общий каталог и значения ролей по умолчанию не открываются. Прикреплённый, в том числе отменённый, архивный или чужой источник даёт404. Подтверждение серверного предпросмотра проверяет ревизию выбранного источника.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementSource"
                    }
                  }
                },
                "example": {
                  "data": {
                    "template": {
                      "id": "2d4b6c80-13ef-4a95-8b77-5e9c1a3d0f68",
                      "state": "active",
                      "revision": 1,
                      "key": "",
                      "title": "Подготовка",
                      "description": "Чек-лист",
                      "scenario": "onboarding",
                      "applicability": {
                        "company": true,
                        "departments": null
                      },
                      "items": [
                        {
                          "key": "prepare",
                          "title": "Подготовить рабочее место",
                          "instruction": "Проверьте доступы",
                          "group": "Доступы",
                          "assigneeRole": "it",
                          "controllerRole": "",
                          "assigneeId": null,
                          "controllerId": null,
                          "offsetDays": 0,
                          "durationDays": 1,
                          "delayDays": 0,
                          "predecessor": "",
                          "workingDays": false,
                          "requirements": {
                            "rating": false,
                            "ratingRequired": false,
                            "commentRequired": false,
                            "question": "",
                            "scale": null,
                            "metricKey": ""
                          },
                          "stageKey": ""
                        }
                      ]
                    },
                    "roles": [
                      {
                        "key": "it",
                        "name": "it",
                        "archived": false,
                        "builtin": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementSource",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/instances/{instanceId}/management-context": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Сохранённый контекст выбранного вложенного процесса",
        "description": "Только текущий scoped employee_process.edit, активный пользователь и соответствующий уровень API-ключа. Process.view, участие, права запуска или каталога не заменяют редактирование указанного мета-процесса. Выбранный процесс доступен независимо от первой страницы списка процессов. Возвращается его публичная сводка, текущие имена упомянутых участников, используемые сохранённые роли (включая неразрешённые/архивные) и ограниченный500 пунктами граф локальных ключей/названий/предшественников/состояний. Все терминальные и отменённые задания занимают вместимость. Из снимка копии выдаются только её стадии (ключ, название, тон) и текущая стадия процесса. Инструкции, результаты, черновики и снимки других процессов не выдаются; текущий шаблон не перечитывается. Ревизия мета-процесса позволяет форме проверить актуальность контекста. Подтверждение изменения остаётся отдельным серверным предпросмотром.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessManagementContext"
                    }
                  }
                },
                "example": {
                  "data": {
                    "metaRevision": 1,
                    "instance": {
                      "id": "11111111-1111-4111-8111-111111111111",
                      "templateId": "22222222-2222-4222-8222-222222222222",
                      "templateRevision": 1,
                      "title": "Сохранённый процесс",
                      "revision": 1,
                      "state": "planned",
                      "controllerId": null,
                      "roles": {},
                      "summary": {
                        "state": "planned",
                        "total": 1,
                        "completed": 0,
                        "skipped": 0,
                        "cancelled": 0,
                        "cancelledProcesses": 0,
                        "percent": 0
                      }
                    },
                    "usedRoles": [
                      {
                        "key": "employee",
                        "name": "employee",
                        "archived": false,
                        "builtin": true
                      }
                    ],
                    "tasks": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "key": "first",
                        "title": "Сохранённое задание",
                        "state": "planned",
                        "predecessor": "",
                        "assigneeRole": "employee",
                        "controllerRole": ""
                      }
                    ],
                    "stages": [
                      {
                        "key": "first-week",
                        "title": "Первая неделя",
                        "tone": "accent"
                      }
                    ],
                    "stageKey": "_new"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessManagementContext",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/processes/{id}/instances/{instanceId}": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Выбранный самостоятельный процесс",
        "description": "Публичная текущая проекция выбранного вложенного процесса независимо от страницы списка, с текущим employee_process.view и фильтром родительского мета-процесса. Координатор получает только человеческое участие. Не возвращает граф управления, инструкции, результаты или приватные черновики; метаданные участников ограничены сохранёнными назначениями. metaRevision позволяет обнаружить смешение с несвежей карточкой родителя.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessInstanceCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-1111-1111-1111-111111111111",
                    "templateId": "22222222-2222-2222-2222-222222222222",
                    "title": "Адаптация",
                    "revision": 1,
                    "templateRevision": 1,
                    "metaRevision": 1,
                    "state": "planned",
                    "controllerId": null,
                    "roles": {},
                    "summary": {
                      "state": "planned",
                      "total": 0,
                      "completed": 0,
                      "skipped": 0,
                      "cancelled": 0,
                      "cancelledProcesses": 0,
                      "percent": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessInstanceCard",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/hires/{id}/date-corrections": {
      "post": {
        "operationId": "appEmployeeProcessHireDateCorrection",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Исправить фактическую дату ручного эпизода",
        "description": "Для ручного эпизода actualStartDate — обязательное поле: null явно очищает неизвестный факт. Для связанного подбора дата принадлежит application.hired_on; команда её не меняет. Требует employee_process_analytics.view и employee_process.edit на контексте, текущей основной адаптации и затронутых мета-процессах. Участие не открывает аналитику, ключ ограничен потолком. commandKey — непрозрачный UUID постоянного идемпотентного квитка; точный повтор после дальнейших изменений возвращает204, но повторно проверяет ТЕКУЩИЕ права. Изменённое содержимое с тем же ключом409. expectedRevision и версии контекста/основной адаптации проверяются при первой записи; без выбранного контекста/основной адаптации их ревизии0. Причина обязательна, до16000 Unicode символов. JSON256КиБ, неизвестные поля и второе значение400. Ответ никогда не содержит приватный снимок или причину.",
        "x-max-body-bytes": 262144,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessHireDateCorrectionRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "contextMetaId": null,
                "expectedRevision": 1,
                "expectedContextRevision": 0,
                "expectedPrimaryRevision": 0,
                "reason": "Проверен кадровый документ",
                "actualStartDate": null
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Исправление применено или точный повтор подтверждён при текущих правах. Тело отсутствует; обновите карточку отдельным GET."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Изменились текущие ревизии/источники, источник занят или commandKey повторён с другим содержимым.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/hires/{id}/primary-corrections": {
      "post": {
        "operationId": "appEmployeeProcessHirePrimaryCorrection",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Исправить основную адаптацию эпизода",
        "description": "primaryMetaId — обязательное поле: null явно снимает основную адаптацию. Новый мета-процесс уже связан с тем же сотрудником/эпизодом и имеет scenario=onboarding; его текущая ревизия и права проверяются независимо. При null expectedNewPrimaryRevision=0. Требует employee_process_analytics.view и employee_process.edit на контексте, текущей основной адаптации и затронутых мета-процессах. Участие не открывает аналитику, ключ ограничен потолком. commandKey — непрозрачный UUID постоянного идемпотентного квитка; точный повтор после дальнейших изменений возвращает204, но повторно проверяет ТЕКУЩИЕ права. Изменённое содержимое с тем же ключом409. expectedRevision и версии контекста/основной адаптации проверяются при первой записи; без выбранного контекста/основной адаптации их ревизии0. Причина обязательна, до16000 Unicode символов. JSON256КиБ, неизвестные поля и второе значение400. Ответ никогда не содержит приватный снимок или причину.",
        "x-max-body-bytes": 262144,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessHirePrimaryCorrectionRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "contextMetaId": null,
                "expectedRevision": 1,
                "expectedContextRevision": 0,
                "expectedPrimaryRevision": 0,
                "reason": "Проверен кадровый документ",
                "primaryMetaId": null,
                "expectedNewPrimaryRevision": 0
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Исправление применено или точный повтор подтверждён при текущих правах. Тело отсутствует; обновите карточку отдельным GET."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Изменились текущие ревизии/источники, источник занят или commandKey повторён с другим содержимым.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/hires/{id}/source-corrections": {
      "post": {
        "operationId": "appEmployeeProcessHireSourceCorrection",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Исправить связь эпизода с подбором и оформлением",
        "description": "applicationId и onboardingId обязательны, оба null явно снимают источник; optional actualStartDate задаёт ручной факт, null/отсутствие оставляет его неизвестным. Новый источник требует его реальный application.updated_at; явный КЭДО также требует реальный onboarding.updated_at и onboarding.view. Текущий старый источник требует expectedOldSourceUpdatedAt. Для старого и нового откликов независимо нужен application.view. Подтверждённая чужая учётная запись запрещает привязку; неизвестная личность требует identityConfirmed=true и identityReason. Дата связанного источника принадлежит подбору; КЭДО, задания и исходные снимки не меняются. Требует employee_process_analytics.view и employee_process.edit на контексте, текущей основной адаптации и затронутых мета-процессах. Участие не открывает аналитику, ключ ограничен потолком. commandKey — непрозрачный UUID постоянного идемпотентного квитка; точный повтор после дальнейших изменений возвращает204, но повторно проверяет ТЕКУЩИЕ права. Изменённое содержимое с тем же ключом409. expectedRevision и версии контекста/основной адаптации проверяются при первой записи; без выбранного контекста/основной адаптации их ревизии0. Причина обязательна, до16000 Unicode символов. JSON256КиБ, неизвестные поля и второе значение400. Ответ никогда не содержит приватный снимок или причину.",
        "x-max-body-bytes": 262144,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeProcessHireSourceCorrectionRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "contextMetaId": null,
                "expectedRevision": 1,
                "expectedContextRevision": 0,
                "expectedPrimaryRevision": 0,
                "reason": "Проверен кадровый документ",
                "applicationId": null,
                "onboardingId": null
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Исправление применено или точный повтор подтверждён при текущих правах. Тело отсутствует; обновите карточку отдельным GET."
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Изменились текущие ревизии/источники, источник занят или commandKey повторён с другим содержимым.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/quality": {
      "get": {
        "operationId": "appEmployeeProcessQuality",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Качество найма: подбор и основная адаптация",
        "description": "Требует текущий employee_process_analytics.view без участия; process.edit/launch.edit не требуются. Ключ ограничен своим потолком. Все показатели summary рассчитаны по всей текущей разрешённой когорте, независимо от страницы items; один сотрудник может иметь несколько эпизодов. from/to — включительные гражданские даты фактического выхода, не опорного плана. Неизвестные/будущие/вне периода посчитаны отдельно; startState показывает такие строки без включения их в начавшуюся когорту. Отдел — внешний номер Б24; vacancyId и coordinatorId — публичные UUID. Фильтр вакансии и приватные сведения подбора требуют независимый текущий application.view, скрытые источники не раскрывают UUID. Основная адаптация проверяется независимо от дополнительных связей; дополнительные процессы не улучшают её показатели. timelyRatio=null при пустом denominator; успех требует завершения всех неотменённых процессов в исходные исключительные сроки без пропусков/неизвестных фактов. medianSeconds учитывает только завершённые интервалы с доказанными границами, n — число наблюдений; незавершённые/неизвестные интервалы показаны отдельно. Метрики совместимы только при совпадении frozen metricKey/question/scale; mean=null при отсутствии ответов, distribution сохраняет N. after и metricAfter — независимые24-часовые непрозрачные курсоры портала/пользователя/ключа/фильтров; metricNext помечает неполный каталог групп, наблюдения не ограничены страницей. До пяти metricGroups задают выбранные контрольные метрики controlMetrics по точному groupId, не ограничивая полный набор доступных групп. Неизвестные query-поля и повтор скалярного поля400.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "vacancyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "coordinatorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "started",
                "unknown",
                "future"
              ],
              "default": "started"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "metricAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "metricLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "metricGroups",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "maxItems": 5,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Глобальная сводка когорты, страница эпизодов сотрудников и независимая страница совместимых контрольных вопросов.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessQuality"
                    }
                  }
                },
                "example": {
                  "data": {
                    "summary": {
                      "people": 1,
                      "episodes": 2,
                      "withAdaptation": 0,
                      "planned": 0,
                      "inProgress": 0,
                      "completed": 0,
                      "cancelled": 0,
                      "noPrimary": 2,
                      "noActiveAdaptation": 2,
                      "primaryDenied": 0,
                      "recruitmentDenied": 0,
                      "unknownStarts": 0,
                      "futureStarts": 0,
                      "outsidePeriod": 0,
                      "timelyNumerator": 0,
                      "timelyDenominator": 0,
                      "currentOverdue": 0,
                      "movedDeadlines": 0,
                      "incomparableRatings": 0,
                      "migrationRows": 0,
                      "invalidRecruitmentTransitions": 0,
                      "timelyRatio": null,
                      "exclusions": {
                        "skippedTasks": 0,
                        "cancelledTasks": 0,
                        "cancelledProcesses": 0,
                        "unknownOriginalDeadlines": 0,
                        "missingCompletions": 0,
                        "lateCompletions": 0,
                        "incompleteDurations": 0
                      },
                      "adaptationDuration": {
                        "medianSeconds": null,
                        "n": 0,
                        "excluded": 0
                      },
                      "stages": [
                        {
                          "stage": "new",
                          "medianSeconds": null,
                          "n": 0,
                          "unfinished": 0,
                          "unknownIntervals": 0,
                          "unknownCurrent": 0
                        },
                        {
                          "stage": "interview",
                          "medianSeconds": null,
                          "n": 0,
                          "unfinished": 0,
                          "unknownIntervals": 0,
                          "unknownCurrent": 0
                        },
                        {
                          "stage": "offer",
                          "medianSeconds": null,
                          "n": 0,
                          "unfinished": 0,
                          "unknownIntervals": 0,
                          "unknownCurrent": 0
                        }
                      ],
                      "metrics": []
                    },
                    "items": [
                      {
                        "episodeId": "11111111-1111-4111-8111-111111111111",
                        "employeeId": "22222222-2222-4222-8222-222222222222",
                        "employeeName": "Сотрудник",
                        "revision": 1,
                        "primaryRevision": 0,
                        "actualStartDate": "2026-10-01",
                        "primaryState": "absent",
                        "primaryId": null,
                        "recruitmentState": "absent",
                        "applicationId": null,
                        "adaptation": null,
                        "recruitment": null,
                        "controlMetrics": []
                      }
                    ],
                    "next": "opaque-employee-cursor",
                    "metricNext": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/hires/{id}": {
      "get": {
        "operationId": "appEmployeeProcessHireCard",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Карточка найма: подбор, основная адаптация и история",
        "description": "Требует текущий employee_process_analytics.view без участия; права редактирования/запуска не нужны, ключ ограничен потолком. Один авторизованный согласованный снимок эпизода. actualStartDate — фактический выход, anchor — отдельный план основной адаптации. primary/recruitment/onboarding имеют состояния available/denied/absent: скрытые данные не заменяются пустым источником. Подбор дополнительно требует текущий application.view, КЭДО независимо onboarding.view. links содержит все текущие видимые основные/дополнительные мета-процессы без повторного включения в показатели когорты. Основная адаптация: процессы с настоящими границами и durationSeconds/elapsedSeconds либо null при неизвестной истории; текущие завершённые frozen результаты с исходным вопросом/шкалой/автором и отдельными factAt/enteredAt; типизированная обычная история с пакетным people, без черновиков и сырого JSON. recruitment: реальный updatedAt источника, текущая оценка/комментарий, полная страничная история переходов без искусственного ограничения20. journal: отдельная защищённая история связей/исправлений; фиксированные известные виды имеют отдельные details/dateCorrection/primaryCorrection/sourceCorrection, явные before/after и причины только после текущей независимой проверки исторических источников/основных адаптаций; denied/unsupported возвращают метаданные, неизвестные payload не публикуются. Все шесть After/Limit независимы, default25/max100;24-часовые курсоры связаны с порталом/пользователем/ключом/эпизодом/типом страницы, первичные страницы также с текущей связью, а journal продолжает неизменную хронологию(time/stream/id). Неверный/устаревший курсор400; скрытый/чужой эпизод404. Неизвестные query-поля/повтор скаляра400. Исправления отправляются отдельно и отвечают204; перечитайте карточку с текущими правами.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "recruitmentAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "recruitmentLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "linksAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "linksLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "processesAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "processesLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "resultsAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "resultsLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "historyAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "historyLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "journalAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "journalLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая разрешённая карточка эпизода, все подстраницы независимы.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessHireCard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "episodeId": "11111111-1111-4111-8111-111111111111",
                    "employeeId": "22222222-2222-4222-8222-222222222222",
                    "employeeName": "Сотрудник",
                    "actualStartDate": null,
                    "revision": 1,
                    "primaryState": "absent",
                    "primaryId": null,
                    "primaryRevision": 0,
                    "recruitmentState": "absent",
                    "onboardingState": "absent",
                    "primary": null,
                    "recruitment": null,
                    "onboarding": null,
                    "links": {
                      "items": [],
                      "next": null
                    },
                    "journal": {
                      "items": [],
                      "next": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/hires/{id}/source-choices": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Доступные источники для исправления текущего эпизода найма",
        "description": "Текущие process.edit и analytics.view на эпизод, контекст и основную адаптацию; дополнительно application.view на старый и предлагаемый источник. Участие и launch.edit не авторизуют исправление. Активный оператор может исправлять эпизод архивного сотрудника. expectedRevision — обязательная текущая ревизия эпизода; изменившийся эпизод409. Возвращаются только ещё не занятые заявки, без раскрытия чужих эпизодов или комментариев подбора. Текущий выбранный источник читается в карточке. По умолчанию рекомендуются подтверждённые совпадающие Б24 аккаунты; includeUnmatched расширяет поиск неизвестных, исключая подтверждённого другого владельца. Настоящий application.updated_at возвращается как sourceUpdatedAt; onboardingId и onboardingUpdatedAt независимо требуют onboarding.view. Выбор не связывает источник: команда source-corrections повторно проверяет текущие права, идентичность и все настоящие версии. Один согласованный текущий снимок, default25/max100; курсор сроком24ч привязан к порталу/эпизоду/актору/ключу/ревизии/поиску/расширению. Неизвестные query-поля, повтор скаляра и неверный курсор400; скрытый эпизод/основная адаптация/старый источник404. Поиск воспринимает % и _ буквально.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expectedRevision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "includeUnmatched",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessHireChoices"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-1111-1111-111111111111",
                        "applicationId": "11111111-1111-1111-1111-111111111111",
                        "onboardingId": null,
                        "candidateName": "Иван Иванов",
                        "vacancyTitle": "Инженер",
                        "actualStartDate": null,
                        "revision": 0,
                        "hasPrimary": false,
                        "identityMatched": true,
                        "sourceUpdatedAt": "2026-10-06T08:09:10Z"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Изменились текущие ревизии/источники, источник занят или commandKey повторён с другим содержимым.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessHireSourceChoices",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/quality/choices": {
      "get": {
        "operationId": "appEmployeeProcessQualityChoices",
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Доступные варианты фильтров качества найма",
        "description": "Требует только текущий employee_process_analytics.view; участие, process.edit/launch.edit и права общего справочника не расширяют доступ. Варианты вычисляются в одном текущем снимке разрешённой когорты по тем же включительным гражданским from/to, startState и фильтрам отдела/вакансии/координатора. Все фильтры применяются, включая выбранное измерение; для смены выбранного значения сначала очистите его. Отдел — настоящий внешний номер Б24, только существующее текущее членство и не пропавший отдел. Вакансия — публичный UUID только независимо доступной заявки; без application.view список пуст. Координатор — публичный UUID только видимой основной адаптации; разрешённый дополнительный процесс не раскрывает скрытую основную. Архивный связанный сотрудник/координатор допустим; оператор должен быть активен. Поиск буквальный, %/_ не шаблоны. Только фиксированные kind departments/vacancies/coordinators, default25/max100. Непрозрачный курсор24ч связан с видом, порталом/пользователем/ключом и всеми текущими фильтрами/поиском. Права повторно проверяются на каждой странице. В каждом варианте заполнен ровно один идентификатор: departmentId для отдела, id для вакансии/координатора. Неизвестные query-поля и повтор скалярного поля400; metricGroups/metricAfter/metricLimit здесь не принимаются.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "departments",
                "vacancies",
                "coordinators"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "vacancyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "coordinatorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "started",
                "unknown",
                "future"
              ],
              "default": "started"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница текущих доступных вариантов фильтра.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessQualityChoices"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": null,
                        "departmentId": 17,
                        "name": "Команда"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/full": {
      "post": {
        "operationId": "appApprovalRouteCreateFull",
        "tags": [
          "Справочники"
        ],
        "summary": "Завести маршрут целиком",
        "description": "Заводит маршрут с названием, типом объекта и шагами одной транзакцией. Версия нового маршрута — 1, он не в архиве; умолчанием становится только при makeDefault: true.\n\nШаги — плоский список в порядке показа: groupNo — любые числа, шаги одной группы стоят подряд и идут параллельно; сервер перенумерует группы с 1. Участники ссылаются теми же публичными идентификаторами, что отдаёт GET {id}: roleId — адрес роли, userId — адрес человека сервиса, b24UserId и b24DeptId — идентификаторы Битрикс24.\n\nТребует права approval_route · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRouteCreateFullRequest"
              },
              "example": {
                "title": "Найм инженеров",
                "objectType": "vacancy_request",
                "makeDefault": false,
                "steps": [
                  {
                    "groupNo": 1,
                    "rule": "any",
                    "members": [
                      {
                        "kind": "author_dept_head"
                      }
                    ]
                  },
                  {
                    "groupNo": 2,
                    "rule": "any",
                    "members": [
                      {
                        "kind": "role",
                        "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8"
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Маршрут заведён.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRoute"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-2c3d-7e4f-8a9b-0c1d2e3f4a5b",
                    "title": "Найм инженеров",
                    "mode": "sequential",
                    "isDefault": false,
                    "createdAt": "2026-09-23T10:00:00Z",
                    "steps": [
                      {
                        "kind": "author_dept_head",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": null,
                        "groupNo": 1,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "author_dept_head",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": null,
                            "roleCode": null,
                            "label": null
                          }
                        ],
                        "conditions": []
                      },
                      {
                        "kind": "role",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": "hr",
                        "groupNo": 2,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "role",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8",
                            "roleCode": "hr",
                            "label": null
                          }
                        ],
                        "conditions": []
                      }
                    ],
                    "updatedAt": "2026-10-14T08:30:00Z",
                    "updatedBy": {
                      "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": "Петрова Анна Сергеевна"
                    },
                    "archivedAt": null,
                    "stepCount": 2,
                    "version": 1,
                    "objectType": "vacancy_request",
                    "hasParallel": false,
                    "hasConditions": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — форма маршрута неверна; details.field — путь до места: title, objectType, steps (нет шагов, больше 32 или больше 200 значений во всех условиях), steps[2].groupNo (шаги группы не подряд), steps[1].rule, steps[1].title, steps[2].members (нет участников или больше 20), steps[2].members[0] (вид без своей ссылки, повтор, ссылка не из портала, роль «Сотрудник», any_dept_head при rule = all), steps[1].conditions[0] (поле не из каталога, оператор, больше двух строк на поле), steps[1].conditions[0].value (форма значения, ссылка не из портала). Чужая и несуществующая ссылка неотличимы. bad_request — тело не разбирается или больше 4 МиБ.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/object-types": {
      "get": {
        "operationId": "appApprovalRouteObjectTypes",
        "tags": [
          "Справочники"
        ],
        "summary": "Типы объектов и каталоги условий",
        "description": "Что может согласовывать маршрут и по каким полям шаг получает условия: ключ типа, а у поля — ключ, вид значения, операторы и источник значений. Редактор строит строки условий только по этому ответу; новое поле появляется здесь, а не новым значением перечисления.\n\nЗначения полей вида `ref` — названия: должностей внешний клиент берёт из GET /api/v1/job-positions, причин открытия — из GET /api/v1/vacancy-reasons?kind=open; отделы — идентификаторы Битрикс24.\n\nТребует права approval_route · view.",
        "responses": {
          "200": {
            "description": "Типы объектов с каталогами.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalObjectTypesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "objectTypes": [
                      {
                        "key": "vacancy_request",
                        "fields": [
                          {
                            "key": "salary_max",
                            "kind": "money",
                            "ops": [
                              "gte",
                              "lte"
                            ],
                            "options": "",
                            "values": []
                          },
                          {
                            "key": "department",
                            "kind": "department",
                            "ops": [
                              "in",
                              "not_in"
                            ],
                            "options": "departments",
                            "values": []
                          },
                          {
                            "key": "position",
                            "kind": "ref",
                            "ops": [
                              "in",
                              "not_in"
                            ],
                            "options": "positions",
                            "values": []
                          },
                          {
                            "key": "scenario",
                            "kind": "enum",
                            "ops": [
                              "in",
                              "not_in"
                            ],
                            "options": "",
                            "values": [
                              "regular",
                              "mass"
                            ]
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/historical-applications": {
      "post": {
        "operationId": "appCreateHistoricalApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Внести исторический отклик закрытой вакансии",
        "description": "Отклик, который был на самом деле, но не попал в сервис вовремя, — например, при переносе из другой системы, — вносится в закрытую вакансию этой операцией, а не appCreateApplication: обычное заведение на закрытую вакансию отвечает 409 vacancy_closed. Новый набор на закрытую вакансию — не история: для него вакансию переоткрывают или заводят новую заявку.\n\nОтклик заводится сразу в отказе: с категорией формальной причины из тела и настоящей датой occurredOn, которая возвращается полем historicalOn. Активным он не становится никогда — не входит в activeApplications и новые отклики, не попадает в разбор, «Мои задачи», историю разбора стадий и воронку. Этап такого отклика не переводится: allowedStages у него пуст, а appMoveApplication отвечает 409 historical_application. Найм, которого не было в сервисе, записывают переоткрытием вакансии и обычным заведением.\n\nДата — не раньше 2000-01-01 и не позже сегодняшнего дня в UTC+14, самом позднем гражданском поясе: свой сегодняшний день может внести вызывающий в любом поясе, а дата до 14 часов впереди UTC тоже принимается.\n\nКандидат находится по контакту или заводится той же операцией, как у appCreateApplication; кандидат, отклик, причина и запись в журнал появляются вместе или не появляются вовсе. У человека один отклик на вакансию: повтор отвечает already_applied. Ответственный — сам вызывающий.\n\nТребует права application · edit и видимости вакансии на уровне vacancy · view: вакансия вне уровня вызывающего отвечает 404, как несуществующая.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id закрытой вакансии (stage completed).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistoricalApplicationRequest"
              },
              "example": {
                "lastName": "Кузнецов",
                "firstName": "Алексей",
                "contact": {
                  "kind": "phone",
                  "value": "+7 916 555-12-34"
                },
                "source": "hh",
                "note": "Импорт 2026-10-10, файл vacancies.xlsx, лист Отклики, строка 12, источник hh.ru; статус в файле — «Отказ»",
                "occurredOn": "2026-08-15",
                "category": "conditions",
                "comment": "Не устроил график"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Внесённый исторический отклик: в отказе, с причиной и historicalOn",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "c7d2e910-4b5a-4f83-9e61-2a8f0b4d7c35",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "rejected",
                    "hiredOn": null,
                    "historicalOn": "2026-08-15",
                    "fit": "maybe",
                    "fitBot": null,
                    "fitHuman": null,
                    "score": null,
                    "scoreSource": null,
                    "reviewStatus": null,
                    "allowedStages": [],
                    "formStages": [],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": null,
                    "note": "Импорт 2026-10-10, файл vacancies.xlsx, лист Отклики, строка 12, источник hh.ru; статус в файле — «Отказ»",
                    "createdAt": "2026-10-10T09:12:03Z",
                    "source": "hh",
                    "channels": [],
                    "decision": null,
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "rejected",
                      "step": null,
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": {
                      "category": "conditions",
                      "author": {
                        "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "name": "Одинцова Мария Павловна"
                      },
                      "at": "2026-10-10T09:12:03Z",
                      "comment": "Не устроил график"
                    },
                    "step": "rejected",
                    "state": {
                      "code": "rejected",
                      "kind": "none",
                      "since": "2026-10-10T09:12:03Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "none",
                    "verdictSource": null,
                    "rejectedFrom": "new",
                    "stageEnteredAt": "2026-10-10T09:12:03Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Поле не прошло проверку — код invalid_value, details.field называет какое: lastName, firstName, middleName, contact, source, resumeUrl, note, comment, occurredOn (не дата ГГГГ-ММ-ДД, раньше 2000-01-01 или позже сегодняшнего дня в UTC+14) или category. contact_not_allowed: вводимое имя содержит ссылку или контакт; details.field и details.offset (исходный Unicode code point), без исходного текста. Импортированное имя площадки не переписывается.",
            "x-error-codes": [
              "bad_request",
              "invalid_value",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "поле не прошло проверку",
                    "retryable": false,
                    "details": {
                      "field": "occurredOn"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Вакансии с таким id в этом портале нет или она вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "вакансия не найдена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Вакансия открыта — код vacancy_open: исторический ввод только у закрытой вакансии (stage completed), а у открытой отклик заводит appCreateApplication. Проверка идёт под замком вакансии, который берут закрытие и переоткрытие, раньше кандидата и контакта, поэтому ничего не записано.\n\nЭтот человек уже откликался на эту вакансию — код already_applied: второй отклик не заводится. details.existingApplicationId — public_id существующего отклика, только если вызывающий видит именно его уровнем application · view; иначе деталей нет. Вакансия в архиве — код vacancy_archived: исторический ввод в неё не идёт, в том числе в архивную завершённую (она отвечает vacancy_archived, а не принимает ввод). Проверка идёт под тем же замком вакансии раньше кандидата и контакта, поэтому ничего не записано. Сначала вакансию возвращают из архива (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "vacancy_open",
              "already_applied",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "examples": {
                  "vacancy_archived": {
                    "value": {
                      "error": {
                        "code": "vacancy_archived",
                        "message": "вакансия в архиве",
                        "retryable": false
                      }
                    }
                  },
                  "vacancy_open": {
                    "value": {
                      "error": {
                        "code": "vacancy_open",
                        "message": "вакансия открыта: исторический ввод только у закрытой",
                        "retryable": false
                      }
                    }
                  },
                  "already_applied": {
                    "value": {
                      "error": {
                        "code": "already_applied",
                        "message": "этот человек уже откликался на эту вакансию",
                        "retryable": false,
                        "details": {
                          "existingApplicationId": "e4b8c1d7-2a95-4f3e-8d06-b7c3a9f1e582"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/reject": {
      "post": {
        "operationId": "appRejectApplication",
        "tags": [
          "Отклики"
        ],
        "summary": "Записать формальный отказ",
        "description": "Отказывает текущему активному отклику под application view и edit. Сервер сверяет fromStage, берёт автора и время из сессии/часов. Причина и переход атомарны. Внутренний комментарий не отправляется кандидату. Повтор со старым этапом получает 409 stage_forbidden и не меняет прежнюю причину.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationRejectRequest"
              },
              "example": {
                "fromStage": "new",
                "category": "requirements",
                "comment": "Требуется опыт"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после перевода",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-12-34"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "rejected",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": null,
                    "allowedStages": [
                      "new",
                      "interview"
                    ],
                    "formStages": [],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": "fit",
                      "pending": false
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "rejected",
                      "step": null,
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": {
                      "category": "requirements",
                      "author": {
                        "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                        "name": "Одинцова Мария Павловна"
                      },
                      "at": "2026-10-07T10:00:00Z",
                      "comment": "Требуется опыт"
                    },
                    "step": "rejected",
                    "state": {
                      "code": "rejected",
                      "kind": "none",
                      "since": "2026-10-07T10:00:00Z",
                      "marks": []
                    },
                    "decider": null,
                    "decisionState": null,
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": "new",
                    "stageEnteredAt": "2026-10-07T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разобралось — код bad_request. Исходный этап пуст или неизвестен, категория не из списка или комментарий длиннее 4000 символов — код invalid_value, details.field называет fromStage, category или comment. publicComment is also limited to 4000 Unicode characters and is forbidden for process/batch/mass initial rejection. invalid_value с полем offerDraftRevision — ревизия не целое больше нуля.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Устаревший fromStage или отклик неактивен. Код offer_draft_changed: подготовленный оффер отклика изменился после того, как его видел вызывающий (решение согласующего, правка, запрос) — перечитайте офферы отклика и решите заново.",
            "x-error-codes": [
              "stage_forbidden",
              "offer_draft_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-form-folders": {
      "get": {
        "operationId": "appSurveyFormFolders",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Папки форм",
        "description": "Папки портала с числом видимых анкет. Требует survey_form · view; других параметров нет, неизвестные — 400 bad_request.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormFolderList"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "folders": [
                      {
                        "id": "3f2c1b0a-9d4e-4a6b-8c7d-1e2f3a4b5c6d",
                        "title": "Онбординг",
                        "formCount": 3,
                        "canManage": true,
                        "updatedAt": "2026-10-07T09:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appSurveyFormFolderCreate",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Создать папку",
        "description": "Требует survey_form · edit и view. Названия папок портала уникальны без учёта регистра и ё/е; папок на портал не больше 200 (survey_folder_limit).",
        "responses": {
          "201": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormFolder"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "3f2c1b0a-9d4e-4a6b-8c7d-1e2f3a4b5c6d",
                    "title": "Онбординг",
                    "formCount": 3,
                    "canManage": true,
                    "updatedAt": "2026-10-07T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "409": {
            "description": "Коды: survey_folder_title_taken. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_folder_title_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_folder_title_taken",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid, survey_folder_limit. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid",
              "survey_folder_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyFormFolderTitle"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-form-folders/{id}": {
      "patch": {
        "operationId": "appSurveyFormFolderRename",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Переименовать папку",
        "description": "Автор папки или survey_form · edit = all. Удалённая папка — 409 survey_folder_gone.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormFolder"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "3f2c1b0a-9d4e-4a6b-8c7d-1e2f3a4b5c6d",
                    "title": "Онбординг",
                    "formCount": 3,
                    "canManage": true,
                    "updatedAt": "2026-10-07T09:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_folder_gone, survey_folder_title_taken. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_folder_gone",
              "survey_folder_title_taken"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_folder_gone",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyFormFolderTitle"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID папки."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "operationId": "appSurveyFormFolderDelete",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Удалить папку",
        "description": "Автор папки или survey_form · edit = all. Анкеты папки, включая чужие, переходят в корень одной транзакцией с удалением. Удалённая раньше папка — 409 survey_folder_gone.",
        "responses": {
          "204": {
            "description": "Папка удалена, её анкеты — в корне. Тела нет."
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_folder_gone. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_folder_gone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_folder_gone",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID папки."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-forms/{id}/folder": {
      "put": {
        "operationId": "appSurveyFormFolderMove",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Перенести форму в папку",
        "description": "Требует survey_form · edit и view над формой. folderId=null — в корень. Ревизию содержания не проверяет и не меняет: побеждает последняя запись. Перенос пишет в ленту формы событие form_moved; повтор в ту же папку события не добавляет. Удалённая папка — 409 survey_folder_gone; архивную анкету не переносят — 409 survey_form_archived.",
        "responses": {
          "204": {
            "description": "Форма в нужной папке. Тела нет."
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_folder_gone, survey_form_archived. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_folder_gone",
              "survey_form_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_folder_gone",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyFormFolderMove"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/controllers": {
      "get": {
        "operationId": "appSurveyControllers",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Контролирующие опроса для ручного сигнала",
        "description": "Поле «Ответственный» формы ручного сигнала. Текущий активный доверенный Subject; право — как у чтения сигналов: ответы этого опроса открыты вызывающему (survey_answer · view), иначе forbidden. Клетки survey и survey_signal у человека сервер не проверяет. API-ключ — только с явным потолком survey_signal.view=all, клеткой survey_answer · view и точной суженной survey.view по исходному создателю опроса; ключ без потолка — forbidden независимо от прав выпустившего. Право проверяется раньше существования: неизвестный опрос, опрос чужого портала и опрос, ответы которого вызывающему закрыты, — один отказ forbidden; id не в формате UUID (и нулевой UUID) — 400. Постраничный список только действующих контролирующих опроса с доступом к ответам по текущим правам (недоступные исключены) с поиском по имени; `me` — сам вызывающий, если он действующий контролирующий, независимо от страницы и поиска. Список — часть работы с сигналами, как варианты ответственного: его получает только тот, кто может работать с сигналами этого опроса, — контролирующий этого опроса с доступом к ответам; ключу нужна и запись (survey_signal.edit=all в потолке и survey.edit). Остальным, в том числе держателю all без назначения, — 200 с пустыми `people` и `nextCursor` и с `me`, как обычно; параметры страницы проверяются так же. Во встраивании не открыта: заведение сигнала есть только в кабинете.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока имени контролирующего из снимка опроса без учёта регистра; пробелы по краям обрезаются. Не более 255 символов, пустое значение и повтор параметра — 400.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyControllerPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "people": [
                      {
                        "employeeId": 103,
                        "name": "Контролирующий",
                        "departments": [],
                        "available": true
                      }
                    ],
                    "nextCursor": "",
                    "me": {
                      "employeeId": 103,
                      "name": "Контролирующий",
                      "departments": [],
                      "available": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveySignalForbidden"
          },
          "422": {
            "description": "Коды: survey_invalid. Приватный текст не включается в отказ.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с сигналом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/board/templates": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Шаблоны процессов для доски",
        "description": "Шаблоны, у которых есть хотя бы один процесс, видимый вызывающему, в любом состоянии; архивные включаются. Сортировка по названию. open — число видимых процессов, кроме отменённых. Право employee_process.view и тот же построчный фильтр, что у GET /api/v1/employee-processes: уровень own/dept/all по мета-процессу и обзор координатора, который открывает свой мета-процесс только человеку, но не ключу. Названия, стадии и тоны шаблона видны без права на шаблоны: это состав видимых процессов.",
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessBoardTemplateList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "11111111-1111-4111-8111-111111111111",
                        "title": "Онбординг в команду",
                        "state": "active",
                        "open": 12
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessBoardTemplates",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/board": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Стадии доски шаблона с числом процессов",
        "description": "Стадии текущей редакции шаблона: «Новый» (_new), свои стадии по порядку, «Завершено» (_done) — с числом процессов каждой с учётом фильтров. Процесс относится к стадии по своей копии; процесс из удалённой стадии шаблона считается в стадии, после которой удалённая стояла, неизвестный ключ — в «Новом». Отменённые процессы и процессы отменённых мета-процессов не считаются. Сценария нет: его задаёт шаблон, параметр scenario не применяется. Шаблон без видимых вызывающему процессов — 404. Право employee_process.view и тот же построчный фильтр, что у GET /api/v1/employee-processes: уровень own/dept/all по мета-процессу и обзор координатора, который открывает свой мета-процесс только человеку, но не ключу. Названия, стадии и тоны шаблона видны без права на шаблоны: это состав видимых процессов.",
        "parameters": [
          {
            "name": "template",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id шаблона из /board/templates."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Название мета-процесса или ФИО сотрудника."
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Текущий отдел сотрудника в Б24."
          },
          {
            "name": "coordinator",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID текущего координатора."
          },
          {
            "name": "problems",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Есть ли у процесса незавершённые проблемные задания."
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessBoard"
                    }
                  }
                },
                "example": {
                  "data": {
                    "columns": [
                      {
                        "key": "_new",
                        "title": "",
                        "tone": "grey",
                        "description": "",
                        "count": 2
                      },
                      {
                        "key": "first-week",
                        "title": "Первая неделя",
                        "tone": "sky",
                        "description": "Знакомство с командой",
                        "count": 5
                      },
                      {
                        "key": "_done",
                        "title": "",
                        "tone": "success",
                        "description": "",
                        "count": 9
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessBoard",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/employee-processes/board/instances": {
      "get": {
        "tags": [
          "Процессы сотрудников"
        ],
        "summary": "Процессы шаблона порциями",
        "description": "Со stage — процессы одной стадии доски, те же, что посчитаны в /board: по времени входа в стадию по возрастанию (дольше всех в стадии — первым), у _done — по убыванию; отменённые не выдаются. Без stage — все процессы шаблона по id, фильтр state действует как в GET /api/v1/employee-processes, но по состоянию процесса. stageProgress считается по пунктам собственной стадии процесса. Сценария нет: параметр scenario не применяется. Право employee_process.view и тот же построчный фильтр, что у GET /api/v1/employee-processes: уровень own/dept/all по мета-процессу и обзор координатора, который открывает свой мета-процесс только человеку, но не ключу. Названия, стадии и тоны шаблона видны без права на шаблоны: это состав видимых процессов.",
        "parameters": [
          {
            "name": "template",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id шаблона из /board/templates."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Название мета-процесса или ФИО сотрудника."
          },
          {
            "name": "department",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Текущий отдел сотрудника в Б24."
          },
          {
            "name": "coordinator",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID текущего координатора."
          },
          {
            "name": "problems",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Есть ли у процесса незавершённые проблемные задания."
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "Ключ стадии из /board. Без него — все процессы шаблона по id, с фильтром state."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "all",
                "planned",
                "in_progress",
                "completed",
                "cancelled"
              ]
            },
            "description": "Только без stage: состояние процесса с поправкой на время; open — planned и in_progress; отсутствие и all — все."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Курсор next прошлой порции того же запроса. Курсор другого шаблона, стадии, фильтров или человека — 400; тогда стадия перечитывается с начала."
          }
        ],
        "responses": {
          "200": {
            "description": "Текущая проекция.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EmployeeProcessBoardInstanceList"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "22222222-2222-4222-8222-222222222222",
                        "metaId": "33333333-3333-4333-8333-333333333333",
                        "employeeId": "44444444-4444-4444-8444-444444444444",
                        "employeeName": "Иванова Анна",
                        "metaTitle": "Адаптация Ивановой",
                        "scenario": "onboarding",
                        "anchor": "2026-11-03",
                        "coordinatorName": "Петров Олег",
                        "state": "in_progress",
                        "stageKey": "first-week",
                        "column": {
                          "key": "first-week",
                          "title": "Первая неделя",
                          "tone": "sky"
                        },
                        "stageEnteredAt": "2026-11-03T06:00:00Z",
                        "stageProgress": {
                          "done": 1,
                          "total": 4
                        },
                        "openTasks": 11,
                        "summary": {
                          "state": "in_progress",
                          "total": 14,
                          "completed": 3,
                          "skipped": 0,
                          "cancelled": 0,
                          "cancelledProcesses": 0,
                          "percent": 21
                        },
                        "problems": 1,
                        "overdue": 1,
                        "help": 0,
                        "canManage": true,
                        "zone": "Europe/Moscow"
                      }
                    ],
                    "next": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Неверное тело, UUID, поле или граница размера.",
            "x-error-codes": [
              "bad_request",
              "validation_failed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Объект не найден в текущем портале или недоступен.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "operationId": "appEmployeeProcessBoardInstances",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-forms/{id}/delete": {
      "post": {
        "operationId": "appSurveyFormDelete",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Удалить неиспользуемую анкету",
        "description": "Требует survey_form · view и edit над строкой. Физически удаляет неиспользуемую анкету, включая архивную, и её ленту. Любой связанный опрос в любом состоянии запрещает удаление: 409 survey_form_in_use; опросы не удаляются. revision защищает от устаревшей записи. commandKey идемпотентен в рамках портала, актёра и операции: повтор того же запроса возвращает подтверждение даже после удаления; другой payload даёт 409 survey_command_conflict. Повтор проверяет текущие права и исходного автора при уровне «свои».",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyFormDeleteResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "a095f832-77a1-420e-b7cb-0d5a46c16c35",
                    "deleted": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyWriteForbidden"
          },
          "404": {
            "description": "Коды: not_found. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Коды: survey_revision_conflict, survey_form_in_use, survey_command_conflict.",
            "x-error-codes": [
              "survey_revision_conflict",
              "survey_form_in_use",
              "survey_command_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_form_in_use",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "413": {
            "description": "Коды: survey_body_too_large. Поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_body_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_body_too_large",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Неверный commandKey; поля и коды в details.fields не содержат отправленных значений.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "survey_invalid",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "description": "Строгий JSON: неизвестные поля и второй JSON запрещены. Предел 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyDeleteForm"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный UUID формы."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/choice/catalog": {
      "get": {
        "operationId": "appVacancyTemplateCatalog",
        "tags": [
          "План найма"
        ],
        "summary": "Страница шаблонов для вакансии",
        "description": "Поиск и стабильная сортировка по числу использований шаблона в вакансиях портала (включая черновики), затем по названию и id. До 20 карточек; next=null в конце. Снимок живёт 15 минут, максимум 8 снимков на пользователя и ключ совместно для сценариев. Продолжение повторно проверяет текущую аудиторию, архив и должность. Непригодный курсор: начните поиск заново. Более 100000 результатов: уточните q. Пустой результат: no_matches при отсутствии совпадений в доступном каталоге, none_available при недоступности; none_configured только с правами vacancy_template view и edit. Зарплата, бриф и портрет в карточки не входят. Требует vacancy · edit. При all аудитория не ограничивает выбор; scenario обязателен.",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TemplateCatalogPage"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "title": "Сварщик цеха",
                        "positionTitle": "Сварщик",
                        "description": "Для цехов",
                        "group": "Производство",
                        "massHiring": false
                      }
                    ],
                    "next": null,
                    "emptyReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Некорректный q или scenario; details.field называет параметр. Повторные параметры не принимаются.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "Некорректный q или scenario; details.field называет параметр. Повторные параметры не принимаются.",
                    "retryable": false,
                    "details": {
                      "field": "q"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Начните поиск заново без cursor.",
            "x-error-codes": [
              "catalog_restart_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_restart_required",
                    "message": "Начните поиск заново без cursor.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Более 100000 доступных результатов; уточните поиск.",
            "x-error-codes": [
              "catalog_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_too_large",
                    "message": "Более 100000 доступных результатов; уточните поиск.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Валидный UTF-8, до 255 Unicode символов до нормализации. Поиск по названию, должности и описанию; регистр и повторные пробелы игнорируются; %, _ и обратная косая черта — литералы. Ошибка: 400 invalid_value, details.field=q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Непрозрачный курсор предыдущей страницы с теми же q и scenario. Неизвестный, сломанный, просроченный, вытесненный, чужой курсор либо изменение прав дают 409 catalog_restart_required. Начните новый поиск без cursor.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": true,
            "description": "Сценарий создания: regular — обычная вакансия, mass — массовый набор. Отсутствующий или иной scenario: 400 invalid_value, details.field=scenario.",
            "schema": {
              "type": "string",
              "enum": [
                "regular",
                "mass"
              ]
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/templates/catalog": {
      "get": {
        "operationId": "appRequestTemplateCatalog",
        "tags": [
          "План найма"
        ],
        "summary": "Страница шаблонов для заявки",
        "description": "Поиск и стабильная сортировка по числу использований шаблона в вакансиях портала (включая черновики), затем по названию и id. До 20 карточек; next=null в конце. Снимок живёт 15 минут, максимум 8 снимков на пользователя и ключ совместно для сценариев. Продолжение повторно проверяет текущую аудиторию, архив и должность. Непригодный курсор: начните поиск заново. Более 100000 результатов: уточните q. Пустой результат: no_matches при отсутствии совпадений в доступном каталоге, none_available при недоступности; none_configured только с правами vacancy_template view и edit. Зарплата, бриф и портрет в карточки не входят. Требует vacancy_request · edit. Аудитория действует при любом уровне; возвращает обычные и массовые шаблоны.\n\nПоля условий заявки этот список не отдаёт: их возвращает карточка шаблона.",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TemplateCatalogPage"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                        "title": "Сварщик цеха",
                        "positionTitle": "Сварщик",
                        "description": "Для цехов",
                        "group": "Производство",
                        "massHiring": false
                      }
                    ],
                    "next": null,
                    "emptyReason": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Некорректный q или scenario; details.field называет параметр. Повторные параметры не принимаются.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "Некорректный q или scenario; details.field называет параметр. Повторные параметры не принимаются.",
                    "retryable": false,
                    "details": {
                      "field": "q"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Начните поиск заново без cursor.",
            "x-error-codes": [
              "catalog_restart_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_restart_required",
                    "message": "Начните поиск заново без cursor.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Более 100000 доступных результатов; уточните поиск.",
            "x-error-codes": [
              "catalog_too_large"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_too_large",
                    "message": "Более 100000 доступных результатов; уточните поиск.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Валидный UTF-8, до 255 Unicode символов до нормализации. Поиск по названию, должности и описанию; регистр и повторные пробелы игнорируются; %, _ и обратная косая черта — литералы. Ошибка: 400 invalid_value, details.field=q.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Непрозрачный курсор предыдущей страницы с теми же q и scenario. Неизвестный, сломанный, просроченный, вытесненный, чужой курсор либо изменение прав дают 409 catalog_restart_required. Начните новый поиск без cursor.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancy-templates/{id}/choice": {
      "get": {
        "operationId": "appVacancyTemplateChoiceByID",
        "tags": [
          "План найма"
        ],
        "summary": "Выбрать доступный шаблон по id",
        "description": "Читает один актуальный шаблон для вакансии. Требует vacancy · edit. При all аудитория не ограничивает выбор, ниже — отделы членства вызывающего. Чужой, архивный, недоступный по аудитории или должности, отсутствующий и не подходящий scenario шаблон дают одинаковый 404 not_found. Hidden-зарплата ниже all маскируется; при all остаётся закреплённой. Существующий формат VacancyTemplateChoice сохранён.",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VacancyTemplateChoice"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
                    "title": "Сварщик цеха",
                    "description": "Для цехов металлоконструкций: смена, аргон, допуск НАКС.",
                    "group": "Производство",
                    "positionTitle": "Сварщик",
                    "headcount": 1,
                    "headcountMax": 5,
                    "deadlineDays": 30,
                    "salaryMin": null,
                    "salaryMax": null,
                    "salaryHidden": true,
                    "salaryMasked": true,
                    "currency": "RUB",
                    "workFormat": "on_site",
                    "modes": {
                      "headcount": "author",
                      "deadline": "author",
                      "salary": "hidden",
                      "work_format": "fixed",
                      "brief_tasks": "author",
                      "brief_conditions": "fixed",
                      "brief_schedule": "fixed",
                      "brief_hiring_steps": "fixed",
                      "profile_experience": "author",
                      "profile_skills": "author",
                      "profile_education": "author",
                      "profile_stoppers": "fixed"
                    },
                    "reasons": [
                      "расширение штата",
                      "замена уволившегося"
                    ],
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех металлоконструкций"
                      },
                      {
                        "id": 14,
                        "name": "Цех сборки"
                      }
                    ],
                    "massHiring": false,
                    "offerApprovalRequired": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Требуется scenario=regular|mass.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "Требуется scenario=regular|mass.",
                    "retryable": false,
                    "details": {
                      "field": "scenario"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Нет доступного шаблона.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Нет доступного шаблона.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Публичный id шаблона.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": true,
            "description": "Сценарий создания: regular — обычная вакансия, mass — массовый набор. Отсутствующий или иной scenario: 400 invalid_value, details.field=scenario.",
            "schema": {
              "type": "string",
              "enum": [
                "regular",
                "mass"
              ]
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies/{id}/pdn-operator": {
      "put": {
        "operationId": "appCompanyPdnOperatorPut",
        "tags": [
          "Справочники"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "summary": "Реквизиты оператора ПДн профиля",
        "description": "Правка целиком: полное наименование и адрес оператора, ссылка на политику обработки ПДн (только https://) и почта для отзыва согласия. null или пустая строка — стереть. Без всех четырёх публикация через Telegram-бота недоступна. company_card · edit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyPdnOperator"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Записано. Тела нет."
          },
          "400": {
            "description": "Код bad_request — тело не разобралось или ключ не из набора; invalid_value — поле не прошло проверку, details.field и details.reason.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Профиля с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/companies/{id}/consent-preview": {
      "get": {
        "operationId": "appCompanyConsentPreview",
        "tags": [
          "Справочники"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес карточки компании.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "summary": "Текст согласия с реквизитами профиля",
        "description": "Текст согласия текущей версии с реквизитами оператора этого профиля и подстановкой «название вакансии». Только просмотр. Реквизиты неполны — text null, missing называет недостающие. company_card · view.",
        "responses": {
          "200": {
            "description": "Предпросмотр.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyConsentPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "version": 1,
                    "text": "Согласие на обработку персональных данных (версия 1)\n\n…",
                    "missing": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Профиля с таким id в этом портале нет — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/channel-targets": {
      "get": {
        "operationId": "appOfferChannelTargets",
        "tags": [
          "Отклики"
        ],
        "summary": "Choose an offer delivery response",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. HH available=false/reason=preview_required remains SELECTABLE for the selected preview. available indicates send readiness. Avito contract_unverified is disabled. No per-choice provider proof is fetched. responseId is opaque odr1: stable keyed comparison plus random authenticated selectionBox. Comparison is only UX equality; never route by a label or expose numeric IDs. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque cursor; pass unchanged."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelTargets"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "responseId": "odr1.comparison.selectionBox",
                        "provider": "hh",
                        "label": "hh opaque reference",
                        "available": false,
                        "reason": "preview_required"
                      },
                      {
                        "responseId": "odr1.other.selectionBox",
                        "provider": "avito",
                        "label": "avito opaque reference",
                        "available": false,
                        "reason": "contract_unverified"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/OfferDeliveryForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/channel-preview": {
      "get": {
        "operationId": "appOfferChannelPreview",
        "tags": [
          "Отклики"
        ],
        "summary": "Preview delivery to the selected response",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. Only this selected Preview.available=true enables Send. Pass the exact complete responseId from targets; the server revalidates current membership and provenance. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          },
          {
            "name": "responseId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Exact opaque response reference from targets."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "available": false,
                    "reason": "contract_unverified",
                    "provider": "avito"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/OfferDeliveryForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/channel-deliveries": {
      "post": {
        "operationId": "appConfirmOfferChannelDelivery",
        "tags": [
          "Отклики"
        ],
        "summary": "Confirm offer channel delivery",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. Strict bounded JSON: intentId, previewToken and optional email. Omitted email uses saved. The exact intent/preview and normalized email decision bind replay. An email decision is enforced before any fresh link or queue effect; preparation and external delivery keep separate results. 201 creates a queue operation; 200 returns the original operation for the same intent and exact body. Neither status means provider acceptance. Never automatically retry HTTP transport or send. Expired originals remain readable by a current authorized editor. queued means queued locally; in_flight means an attempt is in progress; unknown means the external outcome is unresolved and must never be retried automatically; accepted means known platform acceptance; rejected_no_effect means proven no external effect. acceptedAt, deliveredAt and readAt are independent known facts; acceptance does not prove delivery or reading. Inconclusive reads and missing admitted message IDs do not clear unknown or enable retry. Email decision (email): modes skip and provide (anything but saved) are accepted only from a user who can prepare this candidate's chat (the inviter with a personal Bitrix24 webhook and rights on the candidate and application); anyone else may send only saved, otherwise 403 authorization_unproven before any effect. A candidate refusal of Bitrix24 recorded earlier is honoured; when the chat is known to be blocked, the server sends through the chosen channel itself.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelOperation"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "offerId": "5a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "responseId": "odr1.comparison.selectionBox",
                    "state": "unknown",
                    "canRetry": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "201": {
            "description": "New local queue operation; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelOperation"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "offerId": "5a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "responseId": "odr1.comparison.selectionBox",
                    "state": "queued",
                    "canRetry": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend. Outbound email or source refusal is candidate_b24_email_required, contact_taken or action_target_gone. candidate_employee: the candidate was converted to an employee; candidate links are not sent.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive",
              "candidate_b24_email_required",
              "contact_taken",
              "action_target_gone",
              "candidate_employee"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Outbound command refused. invalid_email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "invalid_email"
            ]
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferChannelConfirm"
              },
              "example": {
                "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                "previewToken": "exact-preview-token"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appOfferChannelDeliveries",
        "tags": [
          "Отклики"
        ],
        "summary": "List current offer delivery operations",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. Bounded current response-head operations, up to 100 per page. Pass opaque nextCursor unchanged. queued means queued locally; in_flight means an attempt is in progress; unknown means the external outcome is unresolved and must never be retried automatically; accepted means known platform acceptance; rejected_no_effect means proven no external effect. acceptedAt, deliveredAt and readAt are independent known facts; acceptance does not prove delivery or reading. Inconclusive reads and missing admitted message IDs do not clear unknown or enable retry. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque cursor; pass unchanged."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelOperations"
                    }
                  }
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "offerId": "5a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "responseId": "odr1.comparison.selectionBox",
                        "state": "unknown",
                        "canRetry": false,
                        "canReconcile": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/OfferDeliveryForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-channel-deliveries/{id}": {
      "get": {
        "operationId": "appOfferChannelDelivery",
        "tags": [
          "Отклики"
        ],
        "summary": "Read an original delivery operation",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. Current authorized editor can read the original even after offer expiry/withdrawal or application hire/rejection. queued means queued locally; in_flight means an attempt is in progress; unknown means the external outcome is unresolved and must never be retried automatically; accepted means known platform acceptance; rejected_no_effect means proven no external effect. acceptedAt, deliveredAt and readAt are independent known facts; acceptance does not prove delivery or reading. Inconclusive reads and missing admitted message IDs do not clear unknown or enable retry. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelOperation"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "offerId": "5a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "responseId": "odr1.comparison.selectionBox",
                    "state": "unknown",
                    "canRetry": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/OfferDeliveryForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offer-channel-deliveries/{id}/reconcile": {
      "post": {
        "operationId": "appReconcileOfferChannelDelivery",
        "tags": [
          "Отклики"
        ],
        "summary": "Read exact external delivery evidence",
        "description": "Requires current application/edit on the SAME application row in the authenticated portal, including returned data; no platform-role bypass. Missing, foreign and outside-level rows return the same not_found. Cookie and API key are supported; keys retain their exact frozen ceiling, including null versus empty. Embed, emulation and batch are forbidden. Authority fields are never accepted from the client. Empty request body. Read-only exact stored message/account/chat; never sends, searches contacts, creates chats or guesses key correlation. No admitted exact message ID or inconclusive evidence yields reconciliation_inconclusive. queued means queued locally; in_flight means an attempt is in progress; unknown means the external outcome is unresolved and must never be retried automatically; accepted means known platform acceptance; rejected_no_effect means proven no external effect. acceptedAt, deliveredAt and readAt are independent known facts; acceptance does not prove delivery or reading. Inconclusive reads and missing admitted message IDs do not clear unknown or enable retry. ",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelOperation"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "intentId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "offerId": "5a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "responseId": "odr1.comparison.selectionBox",
                    "state": "unknown",
                    "canRetry": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/OfferDeliveryWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievement-sets": {
      "get": {
        "operationId": "appGameAchievementSets",
        "tags": [
          "Геймификация"
        ],
        "summary": "Наборы достижений",
        "description": "Наборы достижений портала, новые сверху, страницами по курсору; поиск по названию (q) и алфавитный порядок (sort, dir). Набор виден, если в нём есть хоть одна ачивка, видимая по game_achievement · view; achievementCount считает только такие. Пустой набор видит только уровень «все»; набор из одних скрытых вызывающему ачивок не пуст, а скрыт. Стандартный набор «Работа с HRM-сервисом» (builtinCode hrm_service) поставляется порталу при первом чтении. Требует права game_achievement · view.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Поиск подстроки в названии набора. Пробелы по краям для поиска срезаются, после этого — до 60 символов; одни пробелы — без поиска. %, _ и ! ищутся буквально. Не больше одного раза."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "alpha"
              ]
            },
            "description": "alpha — по названию, затем по id в том же направлении; без параметра (или с пустым значением) — родной порядок списка. Смена q, sort или dir начинает курсор заново."
          },
          {
            "name": "dir",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Направление sort=alpha, по умолчанию desc; без sort=alpha не принимается."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Курсор следующей страницы из nextCursor прошлого ответа."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "description": "Записей на страницу: по умолчанию 50, больше 200 не отдаётся."
          }
        ],
        "responses": {
          "200": {
            "description": "Страница наборов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAchievementSetsResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "sets": [
                      {
                        "id": "8d2c1b0a-9f8e-4d6c-8b5a-2b9e8d7c6b5a",
                        "title": "Наставничество",
                        "description": "Помощь новичкам в первые месяцы",
                        "origin": "custom",
                        "builtinCode": null,
                        "achievementCount": 3
                      },
                      {
                        "id": "3c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
                        "title": "Работа с HRM-сервисом",
                        "description": "",
                        "origin": "builtin",
                        "builtinCode": "hrm_service",
                        "achievementCount": 8
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: курсор или limit не разобрались. Код invalid_value: q, sort или dir не приняты (повтор параметра, неизвестное значение, dir без sort=alpha, q длиннее предела) — details.field называет параметр.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "значение поля не принято",
                    "retryable": false,
                    "details": {
                      "field": "sort"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievement-sets/{id}": {
      "get": {
        "operationId": "appGameAchievementSet",
        "tags": [
          "Геймификация"
        ],
        "summary": "Набор достижений",
        "description": "Набор со счётом видимых вызывающему ачивок. Набор виден, если в нём есть хоть одна ачивка, видимая по game_achievement · view; achievementCount считает только такие. Пустой набор видит только уровень «все»; набор из одних скрытых вызывающему ачивок не пуст, а скрыт. Скрытый набор отвечает 404, а не 403. Требует права game_achievement · view.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный id набора."
          }
        ],
        "responses": {
          "200": {
            "description": "Набор",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAchievementSet"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "8d2c1b0a-9f8e-4d6c-8b5a-2b9e8d7c6b5a",
                    "title": "Наставничество",
                    "description": "Помощь новичкам в первые месяцы",
                    "origin": "custom",
                    "builtinCode": null,
                    "achievementCount": 3
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код invalid_value: id в пути — не id набора, details.field = id.",
            "x-error-codes": [
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_value",
                    "message": "значение поля не принято",
                    "retryable": false,
                    "details": {
                      "field": "id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "404": {
            "description": "Набора с таким id нет, он чужой или скрыт от вызывающего — код not_found. Чужой и несуществующий отвечают одинаково.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "не найдено",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/games/achievement-rules": {
      "get": {
        "operationId": "appGameAchievementRules",
        "tags": [
          "Геймификация"
        ],
        "summary": "Правила HRM для достижений",
        "description": "Исполняемые правила HRM, которые достижение с resultSource = hrm называет в ruleCode: событие, порог, получатель и часы закреплены кодом правила. Набор правил закрыт и одинаков для всех порталов; тексты — содержимое сервера на русском. sourceState правдиво говорит, подключён ли автоматический зачёт. Требует права game_achievement · view.",
        "responses": {
          "200": {
            "description": "Правила",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GameAchievementRulesResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "rules": [
                      {
                        "code": "first_hire",
                        "title": "Первый наём",
                        "conditionText": "Кандидат вышел на работу по активному отклику. Засчитывается рекрутеру вакансии на момент выхода. День выхода — не раньше дня, когда включены и игры, и это достижение. Порог: 1 выход на работу, повтор не засчитывается, накопительно без срока; зачёт — только активному сотруднику портала. Учитываются события, пока включены игры и само достижение; прогресс прошлых периодов включения сохраняется. Разовое достижение, 0 баллов.",
                        "eventKind": "H",
                        "threshold": 1,
                        "recipient": "vacancy_recruiter",
                        "clockRule": "enabled_intervals",
                        "repeatable": false,
                        "points": 0,
                        "sourceState": "not_connected"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/GameForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/FeatureFlagsUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}/duplicate": {
      "post": {
        "operationId": "appApprovalRouteDuplicate",
        "tags": [
          "Справочники"
        ],
        "summary": "Скопировать маршрут",
        "description": "Заводит новый маршрут с теми же режимом и шагами под названием из тела. Копия не умолчание, не в архиве и начинает с версии 1; исходный маршрут не меняется. Копировать можно и архивный маршрут.\n\nПоле updatedBy ответа несёт имя автора правки только вызывающему с сессией по куке; ключу API приходит name = null.\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalRouteDuplicateRequest"
              },
              "example": {
                "title": "Наём инженеров (копия)"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Копия заведена.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApprovalRoute"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0199a1f0-7a8b-7c9d-8e0f-2b3c4d5e6f70",
                    "title": "Наём инженеров (копия)",
                    "mode": "sequential",
                    "isDefault": false,
                    "createdAt": "2026-10-16T09:00:00Z",
                    "steps": [
                      {
                        "kind": "author_dept_head",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": null,
                        "groupNo": 1,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "author_dept_head",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": null,
                            "roleCode": null,
                            "label": null
                          }
                        ],
                        "conditions": []
                      },
                      {
                        "kind": "role",
                        "userId": null,
                        "b24UserId": null,
                        "b24DeptId": null,
                        "roleCode": "hr",
                        "groupNo": 2,
                        "rule": "any",
                        "title": null,
                        "members": [
                          {
                            "kind": "role",
                            "userId": null,
                            "b24UserId": null,
                            "b24DeptId": null,
                            "roleId": "0199a1f0-7d8e-7f90-a1b2-c3d4e5f6a7b8",
                            "roleCode": "hr",
                            "label": null
                          }
                        ],
                        "conditions": []
                      }
                    ],
                    "updatedAt": "2026-10-16T09:00:00Z",
                    "updatedBy": {
                      "id": "0199a1f0-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
                      "name": null
                    },
                    "archivedAt": null,
                    "stepCount": 2,
                    "version": 1,
                    "objectType": "vacancy_request",
                    "hasParallel": false,
                    "hasConditions": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_value — название пустое или длиннее допустимого (details.field = title). bad_request — тело не разбирается.",
            "x-error-codes": [
              "invalid_value",
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}/archive": {
      "post": {
        "operationId": "appApprovalRouteArchive",
        "tags": [
          "Справочники"
        ],
        "summary": "Отправить маршрут в архив",
        "description": "Архивный маршрут не предлагается и не принимается для новых привязок к должности и шаблону вакансии, но уже стоящие привязки и идущие круги продолжают работать. Повторный архив — холостое действие: момент архива не двигается. Маршрут по умолчанию в архив не уходит: сначала назначьте другое умолчание. Версию маршрута архив не меняет.\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Маршрут в архиве."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "route_is_default — маршрут служит умолчанием портала.",
            "x-error-codes": [
              "route_is_default"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/approval-routes/{id}/restore": {
      "post": {
        "operationId": "appApprovalRouteRestore",
        "tags": [
          "Справочники"
        ],
        "summary": "Вернуть маршрут из архива",
        "description": "Маршрут снова предлагается для новых привязок. Маршрут, которого нет в архиве, не меняется: ответ тот же.\n\nТребует права approval_route · edit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Адрес маршрута.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Маршрут действует."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found — маршрута с таким адресом в портале нет.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/hh/publication-context": {
      "get": {
        "operationId": "appHHPublicationContext",
        "summary": "Read HH publication context",
        "description": "Cookie session only; API/import keys and embed receive 403. Requires vacancy edit and row-level vacancy view. The server selects portal, company, account and employer; unknown query parameters are rejected. Cache-only read; no provider/network calls. Missing usable connection returns context=null, neutral selection and code=hh_context_unavailable.",
        "tags": [
          "План найма"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Server-owned HH publication context.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HHPublicationContextResponse"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "data": {
                    "code": null,
                    "context": {
                      "key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                      "companyId": "1",
                      "accountId": "2",
                      "employerId": "123"
                    },
                    "baseline": {
                      "membershipRevision": 1,
                      "updatedAt": "2026-10-19T12:00:00Z",
                      "baseProfession": null
                    },
                    "selection": {
                      "id": "12",
                      "title": "Employer assessment",
                      "required": false,
                      "status": "verified"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_request — malformed or unknown query parameter; invalid_value — invalid input.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Invalid input",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/PlacementsCookieOnly"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/HHConflict"
          },
          "429": {
            "$ref": "#/components/responses/HHMetadataRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        }
      }
    },
    "/api/v1/vacancies/{id}/channels/hh/publication-conditions": {
      "get": {
        "operationId": "appHHPublicationConditions",
        "summary": "Read HH publication conditions",
        "description": "Cookie session only; API/import keys and embed receive 403. Requires vacancy edit and row-level vacancy view. The server selects portal, company, account and employer; unknown query parameters are rejected. Source refusal, network or response limits return HTTP 200, status=unavailable and code=hh_conditions_unavailable; tests are then items=[], complete=false. Database failures return 500. Shared channelCalls rate limiter applies.",
        "tags": [
          "План найма"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public identifier."
          },
          {
            "name": "contextKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{64}$",
              "description": "SHA-256 context or content key in hexadecimal."
            },
            "description": "Current context key returned by publication-context."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Refresh this source once. Missing/stale cache is read once automatically; no automatic retries."
          }
        ],
        "responses": {
          "200": {
            "description": "Server-owned HH publication conditions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HHPublicationConditions"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "data": {
                    "contextKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "status": "ready",
                    "version": "1",
                    "fetchedAt": "2026-10-19T12:00:00Z",
                    "expiresAt": "2026-10-19T12:05:00Z",
                    "code": null,
                    "retryable": false,
                    "min": 1,
                    "max": 100
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_request — malformed or unknown query parameter; invalid_value — invalid input.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Invalid input",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/PlacementsCookieOnly"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/HHConflict"
          },
          "429": {
            "$ref": "#/components/responses/HHMetadataRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        }
      }
    },
    "/api/v1/vacancies/{id}/channels/hh/publication-tests": {
      "get": {
        "operationId": "appHHPublicationTests",
        "summary": "Read HH publication tests",
        "description": "Cookie session only; API/import keys and embed receive 403. Requires vacancy edit and row-level vacancy view. The server selects portal, company, account and employer; unknown query parameters are rejected. Source refusal, network or response limits return HTTP 200, status=unavailable and code=hh_tests_unavailable; tests are then items=[], complete=false. Database failures return 500. Shared channelCalls rate limiter applies.",
        "tags": [
          "План найма"
        ],
        "security": [
          {
            "cookieSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public identifier."
          },
          {
            "name": "contextKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{64}$",
              "description": "SHA-256 context or content key in hexadecimal."
            },
            "description": "Current context key returned by publication-context."
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Refresh this source once. Missing/stale cache is read once automatically; no automatic retries."
          }
        ],
        "responses": {
          "200": {
            "description": "Server-owned HH publication tests.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HHPublicationTests"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "data": {
                    "contextKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                    "status": "ready",
                    "version": "1",
                    "fetchedAt": "2026-10-19T12:00:00Z",
                    "expiresAt": "2026-10-19T12:05:00Z",
                    "code": null,
                    "retryable": false,
                    "complete": true,
                    "items": [
                      {
                        "id": "12",
                        "name": "Employer assessment"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "bad_request — malformed or unknown query parameter; invalid_value — invalid input.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Invalid input",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/PlacementsCookieOnly"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/HHConflict"
          },
          "429": {
            "$ref": "#/components/responses/HHMetadataRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        }
      }
    },
    "/api/v1/applications/{id}/rejection-comment": {
      "get": {
        "operationId": "appGetPublicRejectionComment",
        "tags": [
          "Отклики"
        ],
        "summary": "Read the current public rejection comment",
        "description": "Ordinary hiring only. Current rejected episode, application view and row visibility are required. No private rejection data is returned.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current public projection; empty or unreadable comment is null. Only unreadable storage includes commentUnreadable: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicRejectionComment"
                    }
                  }
                },
                "example": {
                  "data": {
                    "episodeId": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "revision": 1,
                    "comment": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed body/UUID: bad_request or invalid_value. episodeId, expectedRevision and comment are required; revision must be at least 1 and comment at most 4000 Unicode characters.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSetPublicRejectionComment",
        "tags": [
          "Отклики"
        ],
        "summary": "Replace the current public rejection comment",
        "description": "Ordinary hiring only. Current rejected episode, application view and row visibility are required. No private rejection data is returned. application edit and its row visibility are also required. Episode and revision compare-and-swap; no stage change or candidate notification.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicRejectionCommentRequest"
              },
              "example": {
                "episodeId": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                "expectedRevision": 1,
                "comment": ""
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current public projection; empty or unreadable comment is null. Only unreadable storage includes commentUnreadable: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicRejectionComment"
                    }
                  }
                },
                "example": {
                  "data": {
                    "episodeId": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "revision": 1,
                    "comment": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Malformed body/UUID: bad_request or invalid_value. episodeId, expectedRevision and comment are required; revision must be at least 1 and comment at most 4000 Unicode characters.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The current episode or revision changed: public_rejection_changed. Reload before retrying.",
            "x-error-codes": [
              "public_rejection_changed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "public_rejection_changed",
                    "message": "public_rejection_changed"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/avito/catalog/ensure": {
      "post": {
        "operationId": "appAvitoCatalogEnsure",
        "summary": "Prepare Avito vacancy catalogs",
        "description": "Use the authenticated portal’s bound Avito connection to prepare shared profession, business area, vehicle type and medical specialization catalogs. Requires the portal flag and vacancy edit permission for this row. A snapshot stays fresh for 24 hours. Initial HTTP waiting is bounded to 15 seconds; then poll status every 2 seconds for up to 3 minutes. A lost response must be retried with the same requestKey. The authenticated principal and its original key ceiling are retained; revocation, expiry, narrowed rights or changed binding stop subsequent calls and publication. No user, account or target may be supplied in the body.",
        "tags": [
          "План найма"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A committed snapshot is available, including when an update is active or has failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "ready",
                    "available": true,
                    "generation": 1,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 0
                  }
                }
              }
            }
          },
          "202": {
            "description": "No snapshot is available yet; poll status after Retry-After. Waiting may mean another catalog stream owns the shared authority.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "updating",
                    "available": false,
                    "generation": null,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 2
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds before the next status poll."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AvitoCatalogWriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
            "x-error-codes": [
              "catalog_failed",
              "catalog_empty",
              "catalog_cooldown",
              "catalog_connection_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_failed",
                    "message": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Catalog preparation is temporarily unavailable.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "catalog_protection_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Catalog preparation is temporarily unavailable.",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvitoCatalogRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/avito/catalog/status": {
      "get": {
        "operationId": "appAvitoCatalogStatus",
        "summary": "Read Avito catalog preparation status",
        "description": "Returns the shared Avito catalog preparation status for this vacancy. Requires the feature to be enabled for the authenticated portal and permission to edit this vacancy. This request does not start or resume preparation. The response does not identify the initiating portal, user or account and contains no credentials.",
        "tags": [
          "План найма"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A committed snapshot is available, including when an update is active or has failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "ready",
                    "available": true,
                    "generation": 1,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 0
                  }
                }
              }
            }
          },
          "202": {
            "description": "No snapshot is available yet; poll status after Retry-After. Waiting may mean another catalog stream owns the shared authority.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "updating",
                    "available": false,
                    "generation": null,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 2
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds before the next status poll."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AvitoCatalogForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
            "x-error-codes": [
              "catalog_failed",
              "catalog_empty",
              "catalog_cooldown",
              "catalog_connection_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_failed",
                    "message": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Catalog preparation is temporarily unavailable.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "catalog_protection_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Catalog preparation is temporarily unavailable.",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/channels/avito/catalog/retry": {
      "post": {
        "operationId": "appAvitoCatalogRetry",
        "summary": "Retry the first Avito catalog load",
        "description": "Explicitly retry a completed cold-load failure using failureRef and requestKey. A failure permits at most one cooldown bypass shared across processes and principals. The shared catalog authority is never bypassed. Requires the portal flag and vacancy edit permission for this row. Repeat a lost request with the same requestKey. Existing usable snapshots stay available and do not need this first-load retry.",
        "tags": [
          "План найма"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A committed snapshot is available, including when an update is active or has failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "ready",
                    "available": true,
                    "generation": 1,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 0
                  }
                }
              }
            }
          },
          "202": {
            "description": "No snapshot is available yet; poll status after Retry-After. Waiting may mean another catalog stream owns the shared authority.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AvitoCatalogStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "updating",
                    "available": false,
                    "generation": null,
                    "failureRef": null,
                    "nextAttemptAt": null,
                    "retryAfterSeconds": 2
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds before the next status poll."
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/AvitoCatalogWriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
            "x-error-codes": [
              "catalog_failed",
              "catalog_empty",
              "catalog_cooldown",
              "catalog_connection_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "catalog_failed",
                    "message": "No usable snapshot: preparation failed, has not started, is cooling down, or needs a usable own Avito connection. error.details contains the safe catalog status for failed, empty and cooldown outcomes.",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Catalog preparation is temporarily unavailable.",
            "x-error-codes": [
              "feature_flags_unavailable",
              "catalog_protection_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "Catalog preparation is temporarily unavailable.",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvitoCatalogRetryRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/orders/{id}": {
      "get": {
        "operationId": "appOrderGet",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Карточка приказа",
        "description": "Приказ с реквизитами, статусом и историей исправлений: кто, когда, было → стало.\n\nОтменённый приказ тоже открывается: из книги он не исчезает, а несёт статус cancelled, причину и того, кто отменил.\n\nВидно по уровню права personnel_order · view — тем же правилом, что книга.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id приказа.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Карточка приказа",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e60",
                    "kind": "free",
                    "number": "21-к",
                    "issuedOn": "2027-07-03",
                    "requisites": "№ 21-к от 03.07.2027",
                    "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "subjectName": "Иванов Иван",
                    "createdAt": "2027-07-03T08:15:00Z",
                    "status": "active",
                    "cancellation": null,
                    "corrections": [
                      {
                        "oldNumber": "12-к",
                        "oldIssuedOn": "2027-07-03",
                        "newNumber": "21-к",
                        "newIssuedOn": "2027-07-03",
                        "oldKind": null,
                        "newKind": null,
                        "subjectChanged": false,
                        "oldSubjectName": null,
                        "newSubjectName": null,
                        "by": "Петрова Анна",
                        "at": "2027-07-05T09:30:00Z"
                      }
                    ],
                    "linkedRows": 0,
                    "can": {
                      "correct": true,
                      "cancel": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Приказа с таким id в портале нет или он вне уровня смотрящего — код not_found. Отказ один на оба случая: он не подтверждает, что приказ есть.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "operationId": "appOrderCorrect",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Исправить ошибку ввода в приказе",
        "description": "Исправление ошибки ввода в зарегистрированном приказе: номер, дата, вид, «о ком». Приказ не заводят заново: на него уже сослались строки графика и бланки. Исправление — только для ошибки ввода в сервисе; приказ, который изменили или отменили в компании, отменяют (POST /api/v1/orders/{id}/cancel) и заводят новый.\n\nКаждое исправление ложится в историю — кто, когда, было → стало, — и карточка с книгой её показывают; вид и «о ком» стоят в истории парой только у исправления, которое их меняло. Поле не прислано — не трогается: ошибка бывает в одном поле. Исправление на те же значения ничего не меняет и в историю не пишется.\n\nНовый «о ком» (subject) проходит проверки заведения: работник попадает в уровни правки и просмотра пишущего — иначе not_found, тот же ответ, что на работника, которого в портале нет; состоит в юрлице книги и работает на дату приказа тем же правилом, что при заведении, — иначе not_in_entity (так же сверяется прежний работник, когда переносят дату приказа). Пустой subject — приказ на нескольких: как и заведение приказа без работника, требует personnel_order · edit уровня «все» — иначе 403 forbidden. Вид и «о ком» после исправления подчиняются правилу заведения: у t6 работник обязателен, у t6a недопустим — иначе 400 invalid_value, details.field = subject. После смены «о ком» на приказ о человеке ссылаются только строки графика этого человека: связь остальных строк снимается, и они остаются без приказа, как строка без приказа. Без unlinkRows такое исправление ничего не пишет и отвечает order_unlinks_rows с числом строк в details.rows — экран предупреждает до сохранения. Приказ на нескольких связей не теряет.\n\nВид меняется только на подходящий строкам, которые остаются со ссылкой, — тем же правилом, что ссылка строки на приказ: приказ, названный в строках приказом о предоставлении отпуска, — t6 или t6a (иначе order_kind_grant); основанием переноса — free (иначе order_kind_move). Проверка — только при смене вида.\n\nНомер и после исправления уникален в книге юрлица за год даты приказа: занятый — код duplicate_number, details несут номер и год (number, year). Дата, перенесённая в другой год, проверяется по книге того года. Номер отменённого приказа тоже занят: отменённый приказ остаётся в книге под своим номером. Отменённый приказ не исправляют — код order_cancelled.\n\nТребует права personnel_order · edit; приказ должен попадать и в уровень правки, и в уровень просмотра.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id приказа.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderFixRequest"
              },
              "example": {
                "number": "21-к"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Приказ исправлен; ответ — карточка с историей",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e60",
                    "kind": "free",
                    "number": "21-к",
                    "issuedOn": "2027-07-03",
                    "requisites": "№ 21-к от 03.07.2027",
                    "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "subjectName": "Иванов Иван",
                    "createdAt": "2027-07-03T08:15:00Z",
                    "status": "active",
                    "cancellation": null,
                    "corrections": [
                      {
                        "oldNumber": "12-к",
                        "oldIssuedOn": "2027-07-03",
                        "newNumber": "21-к",
                        "newIssuedOn": "2027-07-03",
                        "oldKind": null,
                        "newKind": null,
                        "subjectChanged": false,
                        "oldSubjectName": null,
                        "newSubjectName": null,
                        "by": "Петрова Анна",
                        "at": "2027-07-05T09:30:00Z"
                      }
                    ],
                    "linkedRows": 0,
                    "can": {
                      "correct": true,
                      "cancel": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; не прислано ни одного поля — nothing_to_correct; номер пуст — number_required; номер длиннее книги — bad_number; дата не разобрана — bad_date; вид не из каталога — bad_kind; адрес работника не разобран — bad_subject; у t6 не остаётся работника или у t6a он есть — invalid_value, details.field = subject.",
            "x-error-codes": [
              "bad_request",
              "nothing_to_correct",
              "number_required",
              "bad_number",
              "bad_date",
              "bad_kind",
              "bad_subject",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Приказа с таким id в портале нет или он вне уровня смотрящего; работника из subject нет в портале или он вне уровня пишущего — код not_found. Отказ один на «нет» и «вне уровня»: он не подтверждает, что приказ или работник есть.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Такой номер в книге юрлица за год даты приказа уже есть — код duplicate_number, details: number и year; приказ отменён — order_cancelled; работник не состоит в юрлице книги — not_in_entity; смена «о ком» снимет связь со строками графика, а unlinkRows не прислан — order_unlinks_rows, details: rows; вид не подходит строкам — order_kind_grant или order_kind_move.",
            "x-error-codes": [
              "duplicate_number",
              "order_cancelled",
              "not_in_entity",
              "order_unlinks_rows",
              "order_kind_grant",
              "order_kind_move"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/orders/{id}/cancel": {
      "post": {
        "operationId": "appOrderCancel",
        "tags": [
          "Мероприятия"
        ],
        "summary": "Отменить приказ",
        "description": "Приказ, изданный по ошибке, отменяют, а не удаляют: он остаётся в книге под своим номером со статусом cancelled, причиной и тем, кто и когда отменил. Удаления приказа нет — номер в книге занят, на приказ ссылаются бланки, и дыра в нумерации читается как потерянный документ.\n\nПричина обязательна. Отмена конечна: отменённый приказ не восстанавливают, не исправляют и не отменяют повторно — код order_cancelled; нужен снова — заводят новый.\n\nНа отменённый приказ нельзя сослаться заново: факт по строке графика отвечает order_cancelled. Ссылки, поставленные до отмены, остаются, и бланки Т-6 и Т-7 печатают реквизиты как есть — это документы того дня, и задним числом сервис их не переписывает. Что приказ отменён, видно в книге.\n\nТребует права personnel_order · edit; приказ должен попадать и в уровень правки, и в уровень просмотра.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id приказа.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCancelRequest"
              },
              "example": {
                "reason": "Издан по ошибке: отпуск перенесён по заявлению"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Приказ отменён; ответ — карточка",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "9c1f4d2e-8a3b-4e5f-9c7d-1b2a3c4d5e60",
                    "kind": "free",
                    "number": "21-к",
                    "issuedOn": "2027-07-03",
                    "requisites": "№ 21-к от 03.07.2027",
                    "subject": "2f9e8d7c-6b5a-4f3e-8d2c-1b0a9f8e7d6c",
                    "subjectName": "Иванов Иван",
                    "createdAt": "2027-07-03T08:15:00Z",
                    "status": "cancelled",
                    "cancellation": {
                      "reason": "Издан по ошибке: отпуск перенесён по заявлению",
                      "by": "Петрова Анна",
                      "at": "2027-07-06T08:00:00Z"
                    },
                    "corrections": [
                      {
                        "oldNumber": "12-к",
                        "oldIssuedOn": "2027-07-03",
                        "newNumber": "21-к",
                        "newIssuedOn": "2027-07-03",
                        "oldKind": null,
                        "newKind": null,
                        "subjectChanged": false,
                        "oldSubjectName": null,
                        "newSubjectName": null,
                        "by": "Петрова Анна",
                        "at": "2027-07-05T09:30:00Z"
                      }
                    ],
                    "linkedRows": 0,
                    "can": {
                      "correct": false,
                      "cancel": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело не разбирается — код bad_request; причина пуста — reason_required; причина длиннее 255 символов — bad_reason.",
            "x-error-codes": [
              "bad_request",
              "reason_required",
              "bad_reason"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Приказа с таким id в портале нет или он вне уровня смотрящего — код not_found. Отказ один на оба случая: он не подтверждает, что приказ есть.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Приказ уже отменён — код order_cancelled.",
            "x-error-codes": [
              "order_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/action-link/issue": {
      "post": {
        "operationId": "appOfferActionIssue",
        "tags": [
          "Отклики"
        ],
        "summary": "Delivery credential unavailable to staff",
        "description": "After existing authentication, credential ceilings and exact subject rights, returns 410 candidate_action_secret_unavailable. Does not issue, reveal or rotate a delivery credential. Use the ordinary subject URL for manual sharing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "410": {
            "description": "Manual disclosure of candidate delivery credentials is unavailable.",
            "x-error-codes": [
              "candidate_action_secret_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "candidate_action_secret_unavailable",
                    "message": "candidate_action_secret_unavailable"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/appOfferActionIssueFeatureUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/action-link/reveal": {
      "post": {
        "operationId": "appOfferActionReveal",
        "tags": [
          "Отклики"
        ],
        "summary": "Delivery credential unavailable to staff",
        "description": "After existing authentication, credential ceilings and exact subject rights, returns 410 candidate_action_secret_unavailable. Does not issue, reveal or rotate a delivery credential. Use the ordinary subject URL for manual sharing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OfferActionWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "410": {
            "description": "Manual disclosure of candidate delivery credentials is unavailable.",
            "x-error-codes": [
              "candidate_action_secret_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "candidate_action_secret_unavailable",
                    "message": "candidate_action_secret_unavailable"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "dependency_unavailable",
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/action-link/reissue": {
      "post": {
        "operationId": "appOfferActionReissue",
        "tags": [
          "Отклики"
        ],
        "summary": "Delivery credential unavailable to staff",
        "description": "After existing authentication, credential ceilings and exact subject rights, returns 410 candidate_action_secret_unavailable. Does not issue, reveal or rotate a delivery credential. Use the ordinary subject URL for manual sharing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "410": {
            "description": "Manual disclosure of candidate delivery credentials is unavailable.",
            "x-error-codes": [
              "candidate_action_secret_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "candidate_action_secret_unavailable",
                    "message": "candidate_action_secret_unavailable"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/appOfferActionIssueFeatureUnavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/action-link/revoke": {
      "post": {
        "operationId": "appOfferActionRevoke",
        "tags": [
          "Отклики"
        ],
        "summary": "Explicit offer action credential revoke",
        "description": "Explicit application edit operation. Retains current original cookie or API key credential and frozen/current key ceilings in the existing fenced sender authority transaction. Response is sensitive and never cached.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "204": {
            "description": "Credential revoked"
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/OfferActionWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "description": "Authority could not be proven available.",
            "x-error-codes": [
              "dependency_unavailable",
              "authority_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/channel-deliveries/prepare": {
      "post": {
        "operationId": "appOfferActionPrepare",
        "tags": [
          "Отклики"
        ],
        "summary": "Prepare nonsecret offer channel preview",
        "description": "Application edit preview under the actual catalog session or current/frozen API key authority. Returns a nonsecret cabinet reference and exact authenticated preview token. It does not issue/reveal a credential or create account, chat, preparation, contact or preference writes. Confirm owns the later explicit outbound intention and creates its action credential only after replay and email-policy admission. Revoke is a retirement command and creates no preparation job.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "200": {
            "description": "Original operation or current scoped result; not provider acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/OfferChannelPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "available": false,
                    "reason": "contract_unverified",
                    "provider": "avito"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/appOfferActionIssueFeatureUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferActionPrepareRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans": {
      "get": {
        "operationId": "appCallPlans",
        "tags": [
          "План найма"
        ],
        "summary": "Общие планы созвона",
        "description": "Общие планы созвона. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Общие планы созвона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "name": "План снятия брифа",
                        "archived": false,
                        "revision": 1,
                        "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "departments": [],
                        "roleLabels": [],
                        "recommended": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          },
          {
            "name": "archived",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "true — архивные записи, иначе активные."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appCreateCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Создать общий план созвона",
        "description": "Создать общий план созвона. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view/edit; при vacancyId — vacancy.view/edit на строке. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "201": {
            "description": "Создать общий план созвона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента. Код vacancy_archived: vacancyId называет вакансию в архиве — план не создаётся и ей не назначается, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "conflict",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallPlanSaveRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/{planId}": {
      "get": {
        "operationId": "appCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Общий план созвона",
        "description": "Общий план созвона. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Общий план созвона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSaveCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Сохранить новую версию общего плана",
        "description": "Сохранить новую версию общего плана. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view/edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Сохранить новую версию общего плана",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallPlanSaveRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/{planId}/copy": {
      "post": {
        "operationId": "appCopyCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Скопировать общий план созвона",
        "description": "Скопировать общий план созвона. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view/edit; при vacancyId — vacancy.view/edit на строке. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "201": {
            "description": "Скопировать общий план созвона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента. Код vacancy_archived: vacancyId называет вакансию в архиве — копия не создаётся и ей не назначается, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "conflict",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallPlanCopyRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/{planId}/archive": {
      "put": {
        "operationId": "appArchiveCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Архивировать или восстановить общий план",
        "description": "Архивировать или восстановить общий план. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view/edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Архивировать или восстановить общий план",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallPlanArchiveRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/{planId}/versions": {
      "get": {
        "operationId": "appCallPlanVersions",
        "tags": [
          "План найма"
        ],
        "summary": "История версий общего плана",
        "description": "История версий общего плана. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "История версий общего плана",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanVersionPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/{planId}/versions/{versionId}": {
      "get": {
        "operationId": "appCallPlanVersion",
        "tags": [
          "План найма"
        ],
        "summary": "Неизменяемая версия общего плана",
        "description": "Неизменяемая версия общего плана. Управление библиотекой: чтение требует call_plan_template.view, любая запись одновременно view и edit. Проверяется call_plan_template.view. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Неизменяемая версия общего плана",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanVersion"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "number": 1,
                    "content": {
                      "name": "План снятия брифа",
                      "departments": [],
                      "roleLabels": [],
                      "sections": [
                        {
                          "name": "Задачи",
                          "questions": [
                            {
                              "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                              "text": "Зачем открывается позиция?",
                              "required": true,
                              "criteria": [
                                {
                                  "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                  "text": "Названа потребность"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          },
          {
            "name": "versionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy": {
      "get": {
        "operationId": "appVacancyCreateCallPlans",
        "tags": [
          "План найма"
        ],
        "summary": "Планы для формы создания",
        "description": "Планы для формы создания. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Планы для формы создания",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "name": "План снятия брифа",
                        "archived": false,
                        "revision": 1,
                        "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "departments": [],
                        "roleLabels": [],
                        "recommended": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          },
          {
            "name": "department",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Необязательная рекомендация отдела; не ограничивает доступ."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy/default": {
      "get": {
        "operationId": "appVacancyDefaultCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Резервный план до создания объекта",
        "description": "Резервный план до создания объекта. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Резервный план до создания объекта",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanDescriptor"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy/{planId}": {
      "get": {
        "operationId": "appVacancyCreateCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Текущий активный план до создания объекта",
        "description": "Текущий активный план до создания объекта. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Текущий активный план до создания объекта",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy-template": {
      "get": {
        "operationId": "appVacancyTemplateCreateCallPlans",
        "tags": [
          "План найма"
        ],
        "summary": "Планы для формы создания",
        "description": "Планы для формы создания. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy_template.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Планы для формы создания",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "name": "План снятия брифа",
                        "archived": false,
                        "revision": 1,
                        "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "departments": [],
                        "roleLabels": [],
                        "recommended": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          },
          {
            "name": "department",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Необязательная рекомендация отдела; не ограничивает доступ."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy-template/default": {
      "get": {
        "operationId": "appVacancyTemplateDefaultCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Резервный план до создания объекта",
        "description": "Резервный план до создания объекта. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy_template.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Резервный план до создания объекта",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanDescriptor"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy-template/{planId}": {
      "get": {
        "operationId": "appVacancyTemplateCreateCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Текущий активный план до создания объекта",
        "description": "Текущий активный план до создания объекта. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy_template.edit. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Текущий активный план до создания объекта",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-plans": {
      "get": {
        "operationId": "appVacancyCallPlans",
        "tags": [
          "План найма"
        ],
        "summary": "Активные планы для выбора в вакансии",
        "description": "Активные планы для выбора в вакансии. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.edit с уровнем на строку. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Активные планы для выбора в вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "name": "План снятия брифа",
                        "archived": false,
                        "revision": 1,
                        "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "departments": [],
                        "roleLabels": [],
                        "recommended": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-plans/{planId}": {
      "get": {
        "operationId": "appVacancyContextCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Открыть активный план из вакансии",
        "description": "Открыть активный план из вакансии. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.edit с уровнем на строку. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Открыть активный план из вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlan"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "name": "План снятия брифа",
                    "archived": false,
                    "revision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "version": {
                      "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "number": 1,
                      "content": {
                        "name": "План снятия брифа",
                        "departments": [],
                        "roleLabels": [],
                        "sections": [
                          {
                            "name": "Задачи",
                            "questions": [
                              {
                                "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                "text": "Зачем открывается позиция?",
                                "required": true,
                                "criteria": [
                                  {
                                    "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                    "text": "Названа потребность"
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    },
                    "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                    "createdAt": "2026-10-29T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-plan": {
      "get": {
        "operationId": "appVacancyCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Выбранный план вакансии",
        "description": "Выбранный план вакансии. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.view с уровнем на строку. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Выбранный план вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanSelection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "selectionRevision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSelectVacancyCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Сменить общий план вакансии",
        "description": "Сменить общий план вакансии. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.view/edit с уровнем на строку. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Сменить общий план вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanSelection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                    "selectionRevision": 1,
                    "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента. Код vacancy_archived: вакансия в архиве — план звонка ей не назначается, пока её не вернут (POST /api/v1/vacancies/{id}/restore).",
            "x-error-codes": [
              "conflict",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallPlanSelectRequest"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-plan/history": {
      "get": {
        "operationId": "appVacancyCallPlanHistory",
        "tags": [
          "План найма"
        ],
        "summary": "История выбора плана вакансии",
        "description": "История выбора плана вакансии. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy.view с уровнем на строку. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "История выбора плана вакансии",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanHistoryPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "revision": 1,
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "versionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "name": "План снятия брифа",
                        "changedBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "changedAt": "2026-10-29T10:00:00Z",
                        "origin": "manual"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "nextCursor предыдущей страницы без изменений."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/request-template/{id}": {
      "get": {
        "operationId": "appRequestTemplateCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Наследуемый план доступного шаблона заявки",
        "description": "Наследуемый план доступного шаблона заявки. Контекстный потребитель активных текущих планов своего портала, без права управления библиотекой, архива и перебора истории. Проверяется vacancy_request.edit и существующая проверка аудитории выбранного шаблона; глобального селектора нет. API-ключу нужен явный применимый ceiling; legacy-ключ без ceiling получает 403. Все ссылки ограничены порталом. Список и история: до 50 записей, стабильное продолжение nextCursor. Сохранение без изменения нормализованного содержимого — no-op; устаревшая ожидаемая ревизия — конфликт, даже при совпавшей цели. GET не пишет. Тексты версии зашифрованы; архив не удаляет версии.",
        "responses": {
          "200": {
            "description": "Наследуемый план доступного шаблона заявки",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanDescriptor"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Публичный ID объекта текущего портала."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plans/departments": {
      "get": {
        "operationId": "appCallPlanDepartments",
        "tags": [
          "План найма"
        ],
        "summary": "Действующие отделы для рекомендаций плана",
        "description": "Ограниченный список действующих отделов текущего портала для рекомендаций общего плана. Требует одновременно call_plan_template.view и edit; API-ключу нужен явный ceiling обеих операций. Без требования vacancy.edit, vacancy_template.edit или чтения настроек доступа. Не выдаёт людей или архивные отделы. До 50 строк, продолжение nextCursor; q — буквальный поиск по названию, до 120 символов.",
        "responses": {
          "200": {
            "description": "Общие планы созвона",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanDepartmentPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": 1,
                        "name": "Разработка",
                        "path": "/1/"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "nextCursor предыдущей страницы."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Буквальная часть названия."
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons": {
      "get": {
        "operationId": "appComparisonListComparisonAttempts",
        "tags": [
          "План найма"
        ],
        "summary": "List comparison attempts",
        "description": "List comparison attempts. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque nextCursor from the preceding page."
          }
        ],
        "responses": {
          "200": {
            "description": "List comparison attempts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonHistory"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appComparisonQueueAComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Queue a comparison",
        "description": "Queue a comparison. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "202": {
            "description": "Queue a comparison",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonAttempt"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "model": "value",
                    "needsReview": false,
                    "parserVersion": "value",
                    "promptVersion": "value",
                    "scopeId": "value",
                    "scopeSequence": 1,
                    "state": "queued",
                    "commandKey": "00000000-0000-4000-8000-000000000001",
                    "selectionBasis": "current_selection"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no comparison is queued until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonStartInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/prepare": {
      "get": {
        "operationId": "appComparisonPrepareAComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Prepare a comparison",
        "description": "Prepare a comparison. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history. Source choices are returned in stable descending source-ID pages of at most 20; follow nextCursor explicitly to enumerate all sources. Each page contains current tickets; start revalidates selected tickets and the plan revision.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Continue the stable source-ID page using nextCursor from the preceding response."
          }
        ],
        "responses": {
          "200": {
            "description": "Prepare a comparison",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonPreparation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "selectionRevision": 1,
                    "sources": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}": {
      "get": {
        "operationId": "appComparisonReadComparisonAndEffectiveResult",
        "tags": [
          "План найма"
        ],
        "summary": "Read comparison and effective result",
        "description": "Read comparison and effective result. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read comparison and effective result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonDetail"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "attempt": {
                      "createdAt": "2026-10-29T12:00:00Z",
                      "id": "value",
                      "model": "value",
                      "needsReview": false,
                      "parserVersion": "value",
                      "promptVersion": "value",
                      "scopeId": "value",
                      "scopeSequence": 1,
                      "state": "queued",
                      "commandKey": "00000000-0000-4000-8000-000000000001",
                      "selectionBasis": "current_selection"
                    },
                    "input": {
                      "assessmentDefinitionId": "value",
                      "currentAttribution": {
                        "provenance": "source"
                      },
                      "planId": "value",
                      "planName": "value",
                      "planVersionId": "value",
                      "publicationIds": [],
                      "questions": [],
                      "selectionBasis": "value",
                      "selectionRevision": 1,
                      "sources": [
                        {
                          "contentVersionId": "value",
                          "hash": "value",
                          "id": "value",
                          "knownAt": "2026-10-29T12:00:00Z",
                          "metadata": {
                            "actorId": 1,
                            "attribution": {
                              "provenance": "source"
                            },
                            "id": "value",
                            "limitations": [],
                            "recordedAt": "2026-10-29T12:00:00Z",
                            "time": {
                              "precision": "unknown",
                              "provenance": "source"
                            }
                          },
                          "metadataRevisionId": "value",
                          "normalization": "value",
                          "sourceId": "value",
                          "tombstone": false,
                          "type": "value"
                        }
                      ],
                      "vacancyId": "value",
                      "rubricVersion": "criteria-v1"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}/retry": {
      "post": {
        "operationId": "appComparisonExplicitlyRetryTheFrozenComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Explicitly retry the frozen comparison",
        "description": "Explicitly retry the frozen comparison. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "202": {
            "description": "Explicitly retry the frozen comparison",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonAttempt"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "model": "value",
                    "needsReview": false,
                    "parserVersion": "value",
                    "promptVersion": "value",
                    "scopeId": "value",
                    "scopeSequence": 1,
                    "state": "queued",
                    "commandKey": "00000000-0000-4000-8000-000000000001",
                    "selectionBasis": "current_selection"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no retry is queued until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonRetryInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}/revisions": {
      "post": {
        "operationId": "appComparisonSaveAManualRevision",
        "tags": [
          "План найма"
        ],
        "summary": "Save a manual revision",
        "description": "Save a manual revision. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "201": {
            "description": "Save a manual revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonRevision"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "actorId": 1,
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "kind": "ai",
                    "result": {
                      "contradictions": [],
                      "coverage": {
                        "complete": false,
                        "questionIds": [],
                        "sourceVersionIds": []
                      },
                      "limitations": [],
                      "observations": [],
                      "questions": []
                    },
                    "withdrawnKeys": [],
                    "restoredKeys": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no manual revision is saved until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonRevisionInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appComparisonListImmutableRevisions",
        "tags": [
          "План найма"
        ],
        "summary": "List immutable revisions",
        "description": "List immutable revisions. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque nextCursor from the preceding page."
          }
        ],
        "responses": {
          "200": {
            "description": "List immutable revisions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonRevisionHistory"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}/revisions/{revisionId}": {
      "get": {
        "operationId": "appComparisonReadAnExactRevision",
        "tags": [
          "План найма"
        ],
        "summary": "Read an exact revision",
        "description": "Read an exact revision. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read an exact revision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonRevision"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "actorId": 1,
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "kind": "ai",
                    "result": {
                      "contradictions": [],
                      "coverage": {
                        "complete": false,
                        "questionIds": [],
                        "sourceVersionIds": []
                      },
                      "limitations": [],
                      "observations": [],
                      "questions": []
                    },
                    "withdrawnKeys": [],
                    "restoredKeys": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}/activate": {
      "post": {
        "operationId": "appComparisonExplicitlyActivateACandidate",
        "tags": [
          "План найма"
        ],
        "summary": "Explicitly activate a candidate",
        "description": "Explicitly activate a candidate. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "201": {
            "description": "Explicitly activate a candidate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonRevision"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "actorId": 1,
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "kind": "ai",
                    "result": {
                      "contradictions": [],
                      "coverage": {
                        "complete": false,
                        "questionIds": [],
                        "sourceVersionIds": []
                      },
                      "limitations": [],
                      "observations": [],
                      "questions": []
                    },
                    "withdrawnKeys": [],
                    "restoredKeys": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no candidate is activated until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonActivateInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparisons/{attemptId}/sources/{sourceVersionId}": {
      "get": {
        "operationId": "appComparisonReadTheExactEvidenceSource",
        "tags": [
          "План найма"
        ],
        "summary": "Read the exact evidence source",
        "description": "Read the exact evidence source. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "sourceVersionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read the exact evidence source",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonSource"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "contentVersionId": "value",
                    "hash": "value",
                    "id": "value",
                    "knownAt": "2026-10-29T12:00:00Z",
                    "metadata": {
                      "actorId": 1,
                      "attribution": {
                        "provenance": "source"
                      },
                      "id": "value",
                      "limitations": [],
                      "recordedAt": "2026-10-29T12:00:00Z",
                      "time": {
                        "precision": "unknown",
                        "provenance": "source"
                      }
                    },
                    "metadataRevisionId": "value",
                    "normalization": "value",
                    "sourceId": "value",
                    "tombstone": false,
                    "type": "value"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparison-sources/{sourceId}/metadata": {
      "put": {
        "operationId": "appComparisonCorrectSourceTimeOrAttribution",
        "tags": [
          "План найма"
        ],
        "summary": "Correct source time or attribution",
        "description": "Correct source time or attribution. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Correct source time or attribution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonMetadata"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "actorId": 1,
                    "attribution": {
                      "provenance": "source"
                    },
                    "id": "value",
                    "limitations": [],
                    "recordedAt": "2026-10-29T12:00:00Z",
                    "time": {
                      "precision": "unknown",
                      "provenance": "source"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so source metadata is not corrected until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonMetadataInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparison-sources/{sourceId}/history": {
      "get": {
        "operationId": "appComparisonListSourceVersionChoicesAndMetadataHistory",
        "tags": [
          "План найма"
        ],
        "summary": "List source version choices and metadata history",
        "description": "List source version choices and metadata history. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque nextCursor from the preceding page."
          }
        ],
        "responses": {
          "200": {
            "description": "List source version choices and metadata history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonSourceHistory"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-comparison-mappings": {
      "post": {
        "operationId": "appComparisonConfirmOrWithdrawQuestionCorrespondence",
        "tags": [
          "План найма"
        ],
        "summary": "Confirm or withdraw question correspondence",
        "description": "Confirm or withdraw question correspondence. Requires current vacancy.view/edit at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          }
        ],
        "responses": {
          "201": {
            "description": "Confirm or withdraw question correspondence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonMapping"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "active": false,
                    "actorId": 1,
                    "createdAt": "2026-10-29T12:00:00Z",
                    "id": "value",
                    "leftQuestionId": "value",
                    "reason": "value",
                    "rightQuestionId": "value"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no question correspondence is recorded until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallComparisonMappingInput"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appComparisonListQuestionCorrespondenceRevisions",
        "tags": [
          "План найма"
        ],
        "summary": "List question correspondence revisions",
        "description": "List question correspondence revisions. Requires current vacancy.view at row level, including source visibility; approval participation does not expose transcripts. API keys require an explicit ceiling, and current and frozen ceilings intersect during background execution. All IDs are portal/vacancy scoped. Commands use durable commandKey receipts; a changed body under the same key returns command_mismatch. Historical retries retain the exact plan and sources. Results never update brief, portrait, or shared plans. All text is plain text and encrypted at rest. History pages contain at most 30 items and a stable nextCursor. A source DELETE uses the existing transcript endpoint and immediately removes dependent sensitive history. When leftQuestionId and rightQuestionId are both supplied, returns only the current revision for that unordered question pair (zero or one item, without nextCursor). Both IDs must belong to this vacancy. The pair filters must be supplied together, must identify different questions, and cannot be combined with cursor.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public ID scoped to the current portal and vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque nextCursor from the preceding page."
          },
          {
            "name": "leftQuestionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Optional selected-pair filter. Requires rightQuestionId; cannot be combined with cursor."
          },
          {
            "name": "rightQuestionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Optional selected-pair filter. Requires leftQuestionId; cannot be combined with cursor."
          }
        ],
        "responses": {
          "200": {
            "description": "List question correspondence revisions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonMappingHistory"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/call-plan-choices/vacancy/template/{templateId}": {
      "get": {
        "operationId": "appVacancyTemplateEffectiveCallPlan",
        "tags": [
          "План найма"
        ],
        "summary": "План созвона при создании вакансии по шаблону",
        "description": "Эффективный план доступного шаблона либо резервный план портала. Те же vacancy.edit, аудитория и scenario, что при выборе шаблона вакансии. API-ключу нужен явный применимый ceiling. Библиотечные права не требуются; GET ничего не создаёт. basis сообщает inherited либо default.",
        "responses": {
          "200": {
            "description": "Резервный план до создания объекта",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallPlanDescriptor"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "plan": {
                      "id": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                      "name": "План снятия брифа",
                      "archived": false,
                      "revision": 1,
                      "currentVersionId": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                      "version": {
                        "id": "dc492df0-3b4d-4014-a9f5-5f9197061938",
                        "planId": "1c47b5ab-473c-4259-9e1f-7868f21b1a32",
                        "number": 1,
                        "content": {
                          "name": "План снятия брифа",
                          "departments": [],
                          "roleLabels": [],
                          "sections": [
                            {
                              "name": "Задачи",
                              "questions": [
                                {
                                  "id": "602e6fc1-5294-4153-ac21-58df64d0e59e",
                                  "text": "Зачем открывается позиция?",
                                  "required": true,
                                  "criteria": [
                                    {
                                      "id": "6415c4ba-9bdd-4fdf-94d4-a0cfd543a5d2",
                                      "text": "Названа потребность"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                        "createdAt": "2026-10-29T10:00:00Z"
                      },
                      "createdBy": "8917583c-11e0-4ee9-9a07-df755ef87d99",
                      "createdAt": "2026-10-29T10:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CallPlanInputInvalid"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Код conflict: ревизия устарела, выбранный план архивирован либо commandKey повторён с другим телом. Черновик сохраняется у клиента.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scenario",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "regular",
                "mass"
              ]
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/public/avito-images/{token}": {
      "get": {
        "operationId": "publicAvitoImage",
        "tags": [
          "План найма"
        ],
        "summary": "Получить изображение публикации Авито",
        "description": "Публичный capability-адрес сохранённого изображения публикации Авито. Не требует cookie, ключа API или идентификатора портала: допуск даёт только секретный токен из адреса. Возвращает байты JPEG/PNG размером до 2 МБ, без перенаправления и исходного имени файла. Токен действует, пока изображение удерживается сохранённым выбором публикации, попыткой отправки или принятым результатом. Ожидающее обновление черновиков доступа не даёт. HEAD проверяет тот же допуск и возвращает те же заголовки без тела. Ответы не кешируются. Одновременно выполняется не более восьми чтений объектов на процесс; при насыщении новый запрос получает 429 без чтения объекта.",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Секретный токен изображения: 32 шестнадцатеричных символа в нижнем регистре.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$",
              "minLength": 32,
              "maxLength": 32
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Байты изображения. Заголовки Content-Length, X-Content-Type-Options: nosniff и Cache-Control: no-store.",
            "headers": {
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 2097152
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "type": "string",
                  "const": "nosniff"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Изображение недоступно — код image_unavailable: неизвестный или отсоединённый токен, отсутствующий файл, неподходящий тип, размер, содержимое или ключ вне корня портала. Причина наружу не раскрывается.",
            "x-error-codes": [
              "image_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Заняты все восемь мест чтения объектов процесса — код rate_limited. Объект не читается; запрос можно повторить.",
            "x-error-codes": [
              "rate_limited"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Хранилище временно недоступно — код storage_unavailable. Внутренние адреса, ключи и ошибки хранилища не раскрываются.",
            "x-error-codes": [
              "storage_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mail-template-types": {
      "get": {
        "operationId": "appMailTemplateCatalog",
        "summary": "Типы почтовых сообщений по папкам",
        "description": "Требует mail_template · view. Права и потолок ключа проверяются до обращения к данным. В первой версии поддерживается только почта.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "email"
              ],
              "default": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateCatalog"
                    }
                  }
                },
                "example": {
                  "data": {
                    "channel": "email",
                    "groups": [
                      {
                        "id": "hiring",
                        "types": [
                          {
                            "type": "offer_link",
                            "folder": "hiring",
                            "channel": "email",
                            "selectedId": "default",
                            "selectedName": "",
                            "authorId": "",
                            "authorName": "",
                            "updatedAt": "0001-01-01T00:00:00Z",
                            "variantCount": 0
                          }
                        ]
                      },
                      {
                        "id": "onboarding",
                        "types": []
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; invalid_channel. Текст письма и внутренние подробности в отказ не включаются. contact_not_allowed: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "invalid_channel",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_selected; template_variant_limit. Текст письма и внутренние подробности в отказ не включаются. template_selection_conflict: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_selected",
              "template_variant_limit",
              "template_selection_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/mail-template-types/{type}/email": {
      "get": {
        "operationId": "appMailTemplateFamily",
        "summary": "Варианты и текущий выбор типа сообщения",
        "description": "Требует mail_template · view. Права и потолок ключа проверяются до обращения к данным. В первой версии поддерживается только почта.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateFamily"
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "offer_link",
                    "channel": "email",
                    "revision": 0,
                    "selectedId": "default",
                    "default": {
                      "id": "default",
                      "name": "Предустановленный",
                      "authorId": "",
                      "authorName": "",
                      "source": {
                        "lang": "ru",
                        "syntaxVersion": 1,
                        "subject": "{Стандартная тема}",
                        "body": "{Приветствие}{Вступление}{Вакансия в тексте}.\n\n{Ссылка на оффер}\n\n{Срок ответа}"
                      },
                      "fields": [
                        {
                          "id": "link",
                          "token": "{Ссылка на оффер}",
                          "description": "Ссылка на предложение о работе",
                          "inSubject": false,
                          "inBody": true,
                          "required": true,
                          "missingPolicy": "error",
                          "valueType": "url",
                          "insertable": true
                        }
                      ],
                      "createdAt": "0001-01-01T00:00:00Z",
                      "updatedAt": "0001-01-01T00:00:00Z"
                    },
                    "variants": [],
                    "fields": [
                      {
                        "id": "link",
                        "token": "{Ссылка на оффер}",
                        "description": "Ссылка на предложение о работе",
                        "inSubject": false,
                        "inBody": true,
                        "required": true,
                        "missingPolicy": "error",
                        "valueType": "url",
                        "insertable": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; invalid_channel. Текст письма и внутренние подробности в отказ не включаются. contact_not_allowed: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "invalid_channel",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_selected; template_variant_limit. Текст письма и внутренние подробности в отказ не включаются. template_selection_conflict: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_selected",
              "template_variant_limit",
              "template_selection_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appMailTemplateSave",
        "summary": "Сохранить варианты и выбор портала",
        "description": "Требует mail_template · view и edit. Права и потолок ключа проверяются до обращения к данным. В первой версии поддерживается только почта. Fresh changed edits cannot change the selected version; selected.clientId is refused. Selection conflicts use 409 template_selection_conflict. Historical exact successful receipts remain replayable before the new rules.  Fresh email source policy violations return top-level contact_not_allowed and details.issues with field, code=contact_not_allowed and the original Unicode code-point offset. Structural source errors retain actionable field issues, including template_required_token for missing mandatory placeholders. Exact historical receipts are resolved before new content-policy/selection checks. Permissions and original API-key ceilings apply; no sends are performed here.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateSaveResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "revision": 1,
                    "selectedId": "default",
                    "ids": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; invalid_channel. Текст письма и внутренние подробности в отказ не включаются. contact_not_allowed: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "invalid_channel",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_selected; template_variant_limit. Текст письма и внутренние подробности в отказ не включаются. template_selection_conflict: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_selected",
              "template_variant_limit",
              "template_selection_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailTemplateSaveCommand"
              },
              "example": {
                "commandId": "11111111-1111-1111-1111-111111111111",
                "expectedRevision": 0,
                "changed": [],
                "selected": {
                  "id": "default"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/mail-template-types/{type}/email/variants/{variantId}": {
      "delete": {
        "operationId": "appMailTemplateDelete",
        "summary": "Delete a custom version; reset default when deleting the selected one",
        "description": "Требует mail_template · view и edit. Права и потолок ключа проверяются до обращения к данным. В первой версии поддерживается только почта. Deleting the selected custom version atomically selects default before removing it; default itself remains read-only.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            }
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expectedRevision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "commandId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateSaveResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "revision": 1,
                    "selectedId": "default",
                    "ids": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; invalid_channel. Текст письма и внутренние подробности в отказ не включаются. contact_not_allowed: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "invalid_channel",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_selected; template_variant_limit. Текст письма и внутренние подробности в отказ не включаются. template_selection_conflict: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_selected",
              "template_variant_limit",
              "template_selection_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/mail-template-types/{type}/email/preview": {
      "post": {
        "operationId": "appMailTemplatePreview",
        "summary": "Демонстрационный предпросмотр исходника",
        "description": "Требует mail_template · view. Права и потолок ключа проверяются до обращения к данным. В первой версии поддерживается только почта. Не больше 60 запросов в минуту на принципала; тело не больше 64 KiB. Сохранения, отправки и выпуска credentials нет.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplatePreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "subject": "Предложение о работе",
                    "parts": [
                      {
                        "text": "https://example.test/preview",
                        "serviceLink": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; invalid_channel. Текст письма и внутренние подробности в отказ не включаются. contact_not_allowed: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "invalid_channel",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_selected; template_variant_limit. Текст письма и внутренние подробности в отказ не включаются. template_selection_conflict: новые запросы подчиняются отдельному выбору default и Source content policy; точный historical command receipt возвращается до новых проверок.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_selected",
              "template_variant_limit",
              "template_selection_conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MailTemplateSource"
              },
              "example": {
                "lang": "ru",
                "syntaxVersion": 1,
                "subject": "{Стандартная тема}",
                "body": "{Приветствие}{Вступление}{Вакансия в тексте}.\n\n{Ссылка на оффер}\n\n{Срок ответа}"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/offers/{id}/manual-preparation": {
      "post": {
        "operationId": "appPrepareOfferManualCopy",
        "tags": [
          "Отклики"
        ],
        "summary": "Prepare the current subject for explicit manual sharing",
        "description": "Explicit idempotent outbound intent under the original actor, credential ceilings and exact current owner rights. Prepares the existing B24 candidate destination and independent receipt, preserving the native target generation and expiry. With candidate-action-links enabled and a candidate attached, a fresh command returns a personalized manual-action/v2 exact-action credential. It may reuse a live delegated credential or renew an expired or revoked one while the native target remains live. Otherwise it returns a legacy contact-authenticated manual-copy/v1 URL. A public URL or v1 result never permits first-email registration. Replay preserves the original version, secret and deadline. Treat the returned URL as sensitive; request mode and target witness are server-owned. A cabinet staff session also marks the offer as handed over manually («Передано вручную», the offer becomes sent in its list) on the fresh intent only; an API key gets the same link and receipt without the mark. Email decision (email): modes skip and provide (anything but saved) are accepted only from a user who can prepare this candidate's chat (the inviter with a personal Bitrix24 webhook and rights on the candidate and application); anyone else may send only saved, otherwise 403 authorization_unproven before any effect. A candidate refusal of Bitrix24 recorded earlier is honoured; when the chat is known to be blocked, the server sends through the chosen channel itself.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public offer UUID or original operation UUID as named by the route."
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical current stable URL and independent B24 preparation receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MintedLink"
                    }
                  }
                },
                "example": {
                  "data": {
                    "url": "https://hrm.example/join/offer/19e56bde-5480-4eab-a83c-8ca9ae082e7a",
                    "expiresAt": "2026-11-14T09:00:00Z",
                    "b24": {
                      "state": "pending"
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "400": {
            "description": "Malformed UUID, bounded query or strict single JSON object; unknown fields, trailing data and oversized input refused.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/appConfirmOfferChannelDeliveryFeatureForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside current edit row.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "409": {
            "description": "Refresh preview or read the original operation; no automatic resend. candidate_b24_email_required, contact_taken, intent_conflict, action_target_gone, login_unavailable. candidate_employee: the candidate was converted to an employee; candidate links are not sent.",
            "x-error-codes": [
              "intent_conflict",
              "preview_stale",
              "offer_unavailable",
              "application_inactive",
              "target_unproven",
              "account_not_active",
              "account_config_changed",
              "offer_render",
              "reconciliation_inconclusive",
              "candidate_b24_email_required",
              "contact_taken",
              "action_target_gone",
              "login_unavailable",
              "candidate_employee"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "Request refused"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "410": {
            "description": "The original source is no longer live.",
            "x-error-codes": [
              "action_gone"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "422": {
            "description": "Outbound command refused. invalid_email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            },
            "x-error-codes": [
              "invalid_email"
            ],
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Internal",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Referrer-Policy": {
                "schema": {
                  "type": "string",
                  "const": "no-referrer"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/appOfferActionIssueFeatureUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkMintRequest"
              },
              "example": {
                "intentId": "dc9fc58d-5624-4ec6-a456-b0104937cd1a"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-results": {
      "get": {
        "description": "Раздел «Результаты»: охват, итог ИИ и сигналы по опросам анкеты formId с фактическим стартом, где смотрящий — действующий контролирующий из снимка опроса. Право survey_result.view открывает раздел, а не строки: какие опросы попадают в цифры, решает снимок контролирующих, как в карточке опроса. startsFrom и startsUntil ограничивают дату старта опроса, обе границы включительно. Итоговые блоки — суммы по runs; runs — по дате старта по убыванию, затем по id по убыванию, не больше 100, лишнее ставит truncated. good + attention + insufficient + pending = submitted; pending — отправленные ответы без текущего анализа, в каком бы состоянии ни был разбор. signals — все сигналы опроса, и ИИ, и ручные, в тех же числах, что у списка сигналов. Неизвестная или чужая анкета — пустая сводка (нули, runs: [], truncated: false), а не 404: существование анкеты ответ не раскрывает. Человеку без привязки к сотруднику Битрикс24 — пустая сводка, а не forbidden. Ключ API — только с явным потолком, где survey_result.view не none: ключ без потолка и ключ, выпустивший которого не привязан к сотруднику Битрикс24, получают forbidden до разбора параметров. Строки ключа — опросы, которыми выпустивший управляет (survey.view по суженным правам) и которые контролирует: без survey.view в потолке сводка пуста, и это пустой ответ, а не отказ. Правило ключа для сигналов действует и здесь: signals — объект только при потолке survey_signal.view=all, иначе null и в итоге, и в каждой строке runs. Сначала проверяются право и ключ, затем параметры: неизвестный параметр и неразборчивая дата — bad_request, formId нет, пуст или не UUID и startsFrom позже startsUntil — survey_invalid. В отличие от списка опросов, пустой formId — не «без отбора», а отказ.",
        "operationId": "appSurveyResults",
        "parameters": [
          {
            "name": "formId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "assessment": {
                      "attention": 9,
                      "good": 22,
                      "insufficient": 2,
                      "pending": 1
                    },
                    "coverage": {
                      "participants": 40,
                      "submitted": 34
                    },
                    "runs": [
                      {
                        "id": "1b7e2f4a-6c3d-4e5f-8a9b-0c1d2e3f4a5b",
                        "title": "Новички октября · поддержка",
                        "state": "running",
                        "startsAt": "2026-10-20T07:00:00Z",
                        "endsAt": "2026-11-03T07:00:00Z",
                        "coverage": {
                          "participants": 6,
                          "submitted": 5
                        },
                        "assessment": {
                          "good": 2,
                          "attention": 2,
                          "insufficient": 0,
                          "pending": 1
                        },
                        "signals": {
                          "new": 1,
                          "inProgress": 1,
                          "processed": 0
                        }
                      },
                      {
                        "id": "0a6d1e39-5b2c-4d4e-9f8a-7b6c5d4e3f2a",
                        "title": "Новички сентября · поддержка",
                        "state": "completed",
                        "startsAt": "2026-09-22T07:00:00Z",
                        "endsAt": "2026-10-06T07:00:00Z",
                        "coverage": {
                          "participants": 34,
                          "submitted": 29
                        },
                        "assessment": {
                          "good": 20,
                          "attention": 7,
                          "insufficient": 2,
                          "pending": 0
                        },
                        "signals": {
                          "new": 2,
                          "inProgress": 1,
                          "processed": 4
                        }
                      }
                    ],
                    "anonymousRuns": [
                      {
                        "id": "2c8f3a5b-7d4e-4f6a-9b0c-1d2e3f4a5b6c",
                        "title": "Пульс октября · анонимный",
                        "state": "running",
                        "startsAt": "2026-10-27T07:00:00Z",
                        "endsAt": "2026-11-10T07:00:00Z",
                        "coverage": {
                          "participants": 12,
                          "submitted": 7
                        }
                      }
                    ],
                    "signals": {
                      "inProgress": 2,
                      "new": 3,
                      "processed": 4
                    },
                    "truncated": false
                  }
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyResults"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Успешный результат"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Коды: bad_request — неизвестный или повторённый параметр, неразборчивая дата. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ]
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyResultsForbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Коды: survey_invalid — formId нет, он пуст или не UUID; startsFrom позже startsUntil. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid"
            ]
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "summary": "Сводка результатов опросов",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-results/filter-options": {
      "get": {
        "description": "Анкеты, у которых есть хотя бы один опрос с фактическим стартом под контролем смотрящего — того же действующего контролирующего из снимка, что у сводки. Порядок — по самому позднему старту такого опроса по убыванию, затем по id анкеты по убыванию; не больше 100, лишнее ставит truncated. Архивная анкета входит; название — текущее название анкеты, как в списке опросов. Право, правило ключа и пустота — те же, что у сводки: ключ без потолка survey_result.view и ключ, выпустивший которого не привязан к сотруднику Битрикс24, — forbidden; человеку без привязки — пустой список, а не forbidden; без survey.view в потолке ключа список пуст. Параметров нет: любой — bad_request.",
        "operationId": "appSurveyResultsFilterOptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "forms": [
                      {
                        "id": "8f0c3b2a-1d4e-4f5a-9b6c-7d8e9f0a1b2c",
                        "title": "Адаптация · первая неделя"
                      }
                    ],
                    "truncated": false
                  }
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyResultsFilterOptions"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Успешный результат"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Коды: bad_request — у ручки нет параметров, любой отклоняется. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ]
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyResultsForbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "summary": "Анкеты для отбора результатов опросов",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics": {
      "get": {
        "operationId": "appSurveyAnalytics",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Агрегированная аналитика опросов",
        "description": "Независимое чтение по survey_aggregate.view. Ненулевой уровень временно ограничен own: только действующий контроль читателя. Область участников ограничивается до подсчёта, проверки непустоты и предела 100 запусков. Анкета formId обязательна. startsFrom/startsUntil — включительные моменты RFC 3339; порядок startsAt DESC, id DESC. Итоги относятся к возвращённым запускам. Опросы без разрешённых участников исключаются. Прежняя ревизия критериев не превращает опубликованный текущий анализ в pending. Чтение не запускает ИИ. Неизвестная или чужая анкета даёт одинаковую пустую сводку. Ключу нужен явный потолок survey_aggregate.view, действующая привязка выпустившего и survey.view для выбранных опросов. Без потолка survey_signal.view=all signals=null и сигналы не запрашиваются. Эмуляция запрещена. Право, потолок и живость проверяются до параметров. Существующее survey_result не открывает эту операцию. departmentId сужает разрешённых участников по снимку участия до подсчёта и LIMIT, без дублирования людей в нескольких отделах. includeChildren добавляет ID нынешних потомков; удалённый отдел работает точно, без неизвестных потомков. Живое членство участника не используется.",
        "parameters": [
          {
            "name": "formId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "ID отдела Б24 из снимка участия. Неизвестный или чужой ID даёт пустую выдачу.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "includeChildren",
            "in": "query",
            "required": false,
            "description": "Включить нынешних потомков выбранного отдела по их ID в историческом участии. Требует departmentId.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyResults"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "coverage": {
                      "participants": 40,
                      "submitted": 34
                    },
                    "assessment": {
                      "good": 22,
                      "attention": 9,
                      "insufficient": 2,
                      "pending": 1
                    },
                    "signals": {
                      "new": 3,
                      "inProgress": 2,
                      "processed": 4
                    },
                    "runs": [
                      {
                        "id": "1b7e2f4a-6c3d-4e5f-8a9b-0c1d2e3f4a5b",
                        "title": "Новички октября · поддержка",
                        "state": "running",
                        "startsAt": "2026-10-20T07:00:00Z",
                        "endsAt": "2026-11-03T07:00:00Z",
                        "coverage": {
                          "participants": 6,
                          "submitted": 5
                        },
                        "assessment": {
                          "good": 2,
                          "attention": 2,
                          "insufficient": 0,
                          "pending": 1
                        },
                        "signals": {
                          "new": 1,
                          "inProgress": 1,
                          "processed": 0
                        }
                      },
                      {
                        "id": "0a6d1e39-5b2c-4d4e-9f8a-7b6c5d4e3f2a",
                        "title": "Новички сентября · поддержка",
                        "state": "completed",
                        "startsAt": "2026-09-22T07:00:00Z",
                        "endsAt": "2026-10-06T07:00:00Z",
                        "coverage": {
                          "participants": 34,
                          "submitted": 29
                        },
                        "assessment": {
                          "good": 20,
                          "attention": 7,
                          "insufficient": 2,
                          "pending": 0
                        },
                        "signals": {
                          "new": 2,
                          "inProgress": 1,
                          "processed": 4
                        }
                      }
                    ],
                    "anonymousRuns": [
                      {
                        "id": "2c8f3a5b-7d4e-4f6a-9b0c-1d2e3f4a5b6c",
                        "title": "Пульс октября · анонимный",
                        "state": "running",
                        "startsAt": "2026-10-27T07:00:00Z",
                        "endsAt": "2026-11-10T07:00:00Z",
                        "coverage": {
                          "participants": 12,
                          "submitted": 7
                        }
                      }
                    ],
                    "truncated": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request — неизвестный или повторённый параметр, неразборчивая дата. Отправленные значения не включаются в ошибку. Неразборчивый departmentId или includeChildren не true/false — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsForbidden"
          },
          "422": {
            "description": "Коды: survey_invalid — formId нет, он пуст или не UUID; startsFrom позже startsUntil. Отправленные значения не включаются в ошибку. Отрицательный departmentId или includeChildren=true без отдела — survey_invalid.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/filter-options": {
      "get": {
        "operationId": "appSurveyAnalyticsFilterOptions",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Анкеты для аналитики опросов",
        "description": "Анкеты с фактически запущенными непустыми опросами внутри той же области survey_aggregate.view, что и аналитика. Период startsFrom/startsUntil включителен. Участники ограничиваются до проверки наличия опроса и предела 100 анкет. Порядок по самому позднему подходящему старту DESC и публичному ID анкеты DESC. Право survey_result и персональные права не участвуют. Ключ и эмуляция проверяются до параметров, как у агрегатов. departmentId сужает разрешённых участников по снимку участия до подсчёта и LIMIT, без дублирования людей в нескольких отделах. includeChildren добавляет ID нынешних потомков; удалённый отдел работает точно, без неизвестных потомков. Живое членство участника не используется.",
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyResultsFilterOptions"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "forms": [
                      {
                        "id": "8f0c3b2a-1d4e-4f5a-9b6c-7d8e9f0a1b2c",
                        "title": "Адаптация · первая неделя"
                      }
                    ],
                    "truncated": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: неизвестный или повторённый параметр, некорректная дата. Неразборчивый departmentId или includeChildren не true/false — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsForbidden"
          },
          "422": {
            "description": "Код survey_invalid: обратный диапазон дат. Отрицательный departmentId или includeChildren=true без отдела — survey_invalid.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "parameters": [
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "ID отдела Б24 из снимка участия. Неизвестный или чужой ID даёт пустую выдачу.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "includeChildren",
            "in": "query",
            "required": false,
            "description": "Включить нынешних потомков выбранного отдела по их ID в историческом участии. Требует departmentId.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/departments": {
      "get": {
        "operationId": "appSurveyAnalyticsDepartments",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Исторические отделы для аналитики опросов",
        "description": "Отделы только из разрешённых снимков участников выбранной анкеты и периода под survey_aggregate.view, с тем же временным ограничением own и правилами ключей/эмуляции. formId обязателен. Имя берётся из последнего разрешённого снимка по startsAt DESC, публичному ID запуска DESC; текущий справочник не используется. Список id ASC, поиск q по последнему имени, limit=50 по умолчанию (1–100). Курсор связан с порталом, читателем, режимом, анкетой, периодом и поиском; каждый запрос заново проверяет права и живой контроль. Неизвестная или чужая анкета даёт одинаковый пустой список.",
        "parameters": [
          {
            "name": "formId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalyticsOptionsPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": 71,
                        "name": "Поддержка"
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: неизвестный/повторённый параметр, неразборчивая дата, limit вне 1–100 или неверного формата.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsForbidden"
          },
          "422": {
            "description": "Код survey_invalid: отсутствующий/неверный formId, обратный период, неверный курсор или курсор другой области, недопустимый поиск.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/employee": {
      "get": {
        "operationId": "appSurveyAnalyticsEmployee",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "История сотрудника в аналитике опросов",
        "description": "Персональное чтение по survey_answer.view; survey_aggregate и survey_result эту операцию не открывают и ей не требуются. Ненулевой уровень временно ограничен own: только опросы, где читатель — действующий контролирующий, в том числе при all; опрос прежнего обещания тоже открывает только живой контроль. Анонимные опросы не входят. formId и employeeId обязательны. Строки — только участия выбранного сотрудника: отбор сотрудника применяется к участникам до проверки непустоты запуска и предела 100 запусков. startsFrom/startsUntil — включительные моменты RFC 3339 по фактическому старту; порядок startsAt DESC, id DESC. Не ответившие участия входят в ряд. В строке — историческое имя из снимка этого запуска, факт и время отправки, ID отправленного ответа, текущая оценка ИИ с собственным outdated и один разрешённый сигнал. Текста ответа, причин ИИ, цитат и истории мер нет; ID черновика не раскрывается. Прежняя ревизия критериев не превращает опубликованный текущий анализ в pending. Чтение не запускает ИИ. Неизвестный, чужой или недоступный сотрудник и неизвестная или чужая анкета дают одинаковое {runs: [], truncated: false}. Ключу нужен явный потолок survey_answer.view, действующая привязка выпустившего и survey.view для выбранных опросов. Эмуляция запрещена. Право, потолок и живость проверяются до параметров и до любых запросов о сотруднике и анкете. Сигнал читается по действующим правилам сигналов; без потолка ключа survey_signal.view=all поле signal всегда null. departmentId сужает участия выбранного сотрудника по снимку его отделов в каждом запуске до проверки непустоты и LIMIT. includeChildren добавляет ID нынешних потомков; удалённый отдел работает точно, без неизвестных потомков. Живое членство не используется.",
        "parameters": [
          {
            "name": "formId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "description": "Номер сотрудника Битрикс24 — цель чтения, не подмена читателя. Неизвестный, чужой или недоступный сотрудник даёт ту же пустую выдачу, что и сотрудник без участий.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "ID отдела Б24 из снимка участия сотрудника. Неизвестный или чужой ID даёт пустую выдачу.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "includeChildren",
            "in": "query",
            "required": false,
            "description": "Включить нынешних потомков выбранного отдела по их ID в историческом участии. Требует departmentId.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalyticsPersonalHistory"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "runs": [
                      {
                        "id": "1b7e2f4a-6c3d-4e5f-8a9b-0c1d2e3f4a5b",
                        "title": "Новички октября · поддержка",
                        "state": "running",
                        "startsAt": "2026-10-20T07:00:00Z",
                        "endsAt": "2026-11-03T07:00:00Z",
                        "name": "Анна Смирнова",
                        "submitted": true,
                        "submittedAt": "2026-10-21T09:15:00Z",
                        "answerId": "3d9e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a",
                        "assessment": "attention",
                        "outdated": false,
                        "signal": {
                          "id": "4e0f5a6b-7c8d-4e9f-8a1b-2c3d4e5f6a7b",
                          "state": "in_progress"
                        }
                      },
                      {
                        "id": "0a6d1e39-5b2c-4d4e-9f8a-7b6c5d4e3f2a",
                        "title": "Новички сентября · поддержка",
                        "state": "completed",
                        "startsAt": "2026-09-22T07:00:00Z",
                        "endsAt": "2026-10-06T07:00:00Z",
                        "name": "Анна Смирнова",
                        "submitted": true,
                        "submittedAt": "2026-09-23T10:00:00Z",
                        "answerId": "5f1a6b7c-8d9e-4f0a-9b2c-3d4e5f6a7b8c",
                        "assessment": "good",
                        "outdated": true,
                        "signal": null
                      },
                      {
                        "id": "9c5b0d28-4a1b-4c3d-8e7f-6a5b4c3d2e1f",
                        "title": "Новички августа · поддержка",
                        "state": "completed",
                        "startsAt": "2026-08-25T07:00:00Z",
                        "endsAt": "2026-09-08T07:00:00Z",
                        "name": "Анна Смирнова",
                        "submitted": false,
                        "submittedAt": null,
                        "answerId": null,
                        "assessment": null,
                        "outdated": false,
                        "signal": null
                      }
                    ],
                    "truncated": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request — неизвестный или повторённый параметр, неразборчивая дата, employeeId не целое число. Отправленные значения не включаются в ошибку. Неразборчивый departmentId или includeChildren не true/false — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsPersonalForbidden"
          },
          "422": {
            "description": "Коды: survey_invalid — formId нет, он пуст или не UUID; employeeId нет, он не положительный; startsFrom позже startsUntil. Отправленные значения не включаются в ошибку. DepartmentId не положительный или includeChildren=true без отдела — survey_invalid.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/employee/filter-options": {
      "get": {
        "operationId": "appSurveyAnalyticsEmployeeFilterOptions",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Анкеты сотрудника для аналитики опросов",
        "description": "Анкеты, в фактически запущенных опросах которых у выбранного сотрудника есть разрешённое участие, в той же персональной области, что и история. Персональное чтение по survey_answer.view; survey_aggregate и survey_result эту операцию не открывают и ей не требуются. Ненулевой уровень временно ограничен own: только опросы, где читатель — действующий контролирующий, в том числе при all; опрос прежнего обещания тоже открывает только живой контроль. Анонимные опросы не входят. employeeId обязателен; отвечал ли сотрудник, не важно. Период startsFrom/startsUntil включителен. Отбор сотрудника применяется до проверки наличия опроса и предела 100 анкет. Порядок по самому позднему подходящему старту DESC и публичному ID анкеты DESC. Неизвестный, чужой или недоступный сотрудник даёт одинаковый пустой список. Ключу нужен явный потолок survey_answer.view, действующая привязка выпустившего и survey.view для выбранных опросов. Эмуляция запрещена. Право, потолок и живость проверяются до параметров и до любых запросов о сотруднике и анкете. departmentId сужает участия выбранного сотрудника по снимку его отделов в каждом запуске до проверки непустоты и LIMIT. includeChildren добавляет ID нынешних потомков; удалённый отдел работает точно, без неизвестных потомков. Живое членство не используется.",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "description": "Номер сотрудника Битрикс24 — цель чтения, не подмена читателя. Неизвестный, чужой или недоступный сотрудник даёт ту же пустую выдачу, что и сотрудник без участий.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "ID отдела Б24 из снимка участия сотрудника. Неизвестный или чужой ID даёт пустую выдачу.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "includeChildren",
            "in": "query",
            "required": false,
            "description": "Включить нынешних потомков выбранного отдела по их ID в историческом участии. Требует departmentId.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyResultsFilterOptions"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "forms": [
                      {
                        "id": "8f0c3b2a-1d4e-4f5a-9b6c-7d8e9f0a1b2c",
                        "title": "Адаптация · первая неделя"
                      }
                    ],
                    "truncated": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: неизвестный или повторённый параметр, неразборчивая дата, employeeId не целое число. Неразборчивый departmentId или includeChildren не true/false — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsPersonalForbidden"
          },
          "422": {
            "description": "Код survey_invalid: employeeId нет, он не положительный; обратный диапазон дат. DepartmentId не положительный или includeChildren=true без отдела — survey_invalid.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/employees": {
      "get": {
        "operationId": "appSurveyAnalyticsEmployees",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Сотрудники для аналитики опросов",
        "description": "Сотрудники с разрешённым участием в фактически запущенных опросах персональной области. Персональное чтение по survey_answer.view; survey_aggregate и survey_result эту операцию не открывают и ей не требуются. Ненулевой уровень временно ограничен own: только опросы, где читатель — действующий контролирующий, в том числе при all; опрос прежнего обещания тоже открывает только живой контроль. Анонимные опросы не входят. formId необязателен: сотрудника можно выбрать до анкеты; с formId — только участия в опросах этой анкеты. Период startsFrom/startsUntil включителен. Отвечал ли сотрудник и активен ли он сейчас, не важно. Имя берётся из последнего разрешённого снимка участия по startsAt DESC, публичному ID запуска DESC; текущий справочник не используется. Список id ASC, поиск q по последнему имени, limit=50 по умолчанию (1–100). Курсор связан с порталом, читателем, режимом, анкетой, периодом, отделом и поиском; каждый запрос заново проверяет права и живой контроль. Числа скрытых участников не показываются. Неизвестная или чужая анкета даёт одинаковый пустой список. Ключу нужен явный потолок survey_answer.view, действующая привязка выпустившего и survey.view для выбранных опросов. Эмуляция запрещена. Право, потолок и живость проверяются до параметров и до любых запросов о сотруднике и анкете. departmentId оставляет сотрудников, у которых в разрешённом участии есть этот отдел по снимку; includeChildren добавляет ID нынешних потомков; живое членство не используется.",
        "parameters": [
          {
            "name": "formId",
            "in": "query",
            "required": false,
            "description": "Публичный UUID анкеты. Без него — участия во всех анкетах области.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "ID отдела Б24 из снимка участия. Неизвестный или чужой ID даёт пустой список.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "includeChildren",
            "in": "query",
            "required": false,
            "description": "Включить нынешних потомков выбранного отдела по их ID в историческом участии. Требует departmentId.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalyticsPersonalEmployeePage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": 18,
                        "name": "Анна Смирнова"
                      },
                      {
                        "id": 42,
                        "name": "Олег Петров"
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: неизвестный или повторённый параметр, неразборчивая дата, limit вне 1–100 или неверного формата, курсор длиннее 4096. Неразборчивый departmentId или includeChildren не true/false — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsPersonalForbidden"
          },
          "422": {
            "description": "Код survey_invalid: formId пуст или не UUID, обратный период, неверный курсор или курсор другого отбора, недопустимый поиск. DepartmentId не положительный или includeChildren=true без отдела — survey_invalid.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/survey-analytics/employee/departments": {
      "get": {
        "operationId": "appSurveyAnalyticsEmployeeDepartments",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Отделы сотрудника для аналитики опросов",
        "description": "Исторические отделы только из разрешённых снимков участия выбранного сотрудника в опросах выбранной анкеты за период. Отделы других участников тех же опросов не попадают. Персональное чтение по survey_answer.view; survey_aggregate и survey_result эту операцию не открывают и ей не требуются. Ненулевой уровень временно ограничен own: только опросы, где читатель — действующий контролирующий, в том числе при all; опрос прежнего обещания тоже открывает только живой контроль. Анонимные опросы не входят. employeeId и formId обязательны; отвечал ли сотрудник, не важно. Имя берётся из последнего разрешённого снимка по startsAt DESC, публичному ID запуска DESC; текущий справочник не используется. Список id ASC, поиск q по последнему имени, limit=50 по умолчанию (1–100). Собственного departmentId список не принимает: выбор отдела сужает историю, а не варианты. Курсор связан с порталом, читателем, режимом, сотрудником, анкетой, периодом и поиском; каждый запрос заново проверяет права и живой контроль. Неизвестный, чужой или недоступный сотрудник и неизвестная анкета дают одинаковый пустой список. Ключу нужен явный потолок survey_answer.view, действующая привязка выпустившего и survey.view для выбранных опросов. Эмуляция запрещена. Право, потолок и живость проверяются до параметров и до любых запросов о сотруднике и анкете.",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "description": "Номер сотрудника Битрикс24 — цель чтения, не подмена читателя. Неизвестный, чужой или недоступный сотрудник даёт ту же пустую выдачу, что и сотрудник без участий.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "formId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startsFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "startsUntil",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успешный результат",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyAnalyticsOptionsPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [
                      {
                        "id": 71,
                        "name": "Поддержка"
                      }
                    ],
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: неизвестный или повторённый параметр, неразборчивая дата, employeeId не целое число, limit вне 1–100 или неверного формата, курсор длиннее 4096. departmentId и includeChildren этой операцией не принимаются — bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "неверные параметры списка",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyAnalyticsPersonalForbidden"
          },
          "422": {
            "description": "Код survey_invalid: employeeId нет, он не положительный; formId нет, он пуст или не UUID; обратный период, неверный курсор или курсор другого отбора, недопустимый поиск.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/response-views": {
      "get": {
        "operationId": "appResponseViews",
        "tags": [
          "Отклики"
        ],
        "summary": "Read response view facts",
        "description": "Requires current application/view for reads and application/view+edit for commands on this exact row in the authenticated portal. Both cookie and API keys are supported; frozen and current key ceilings intersect at every admission. Missing, foreign and outside-level rows return the same not_found. Embed, emulation and batch are forbidden. Server supplies actor/account/authority; these fields are never accepted in input. Viewing never changes stage, fit, human review or chat-message read state. Accepts 1-50 repeated ref query values from the initial opened-card DTO. Local reads only, no provider calls or marking. Poll only while this card is mounted and attempts are queued/in_flight, every 2 seconds. Unavailable targets include a machine reason.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "ref",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "type": "string",
                "maxLength": 512
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Local durable state and independent provider facts; queued/202 is not provider confirmation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResponseViewBatch"
                    }
                  }
                },
                "example": {
                  "data": {
                    "mode": "manual",
                    "modeRevision": 1,
                    "items": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ResponseViewReadForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside-level application; no existence disclosure.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the exact target/mode or inspect the existing attempt; never automatically repeat an admitted unknown write.",
            "x-error-codes": [
              "intent_conflict",
              "view_mode_changed",
              "view_attempt_active",
              "view_attempt_changed",
              "response_target_changed",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "intent_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Strict bounded command/ref/query/UUID validation failed; fix the request.",
            "x-error-codes": [
              "invalid_response_view_command"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_response_view_command",
                    "message": "invalid_response_view_command",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority or provider could not be proven available; unknown is not permission to repeat a mark.",
            "x-error-codes": [
              "authority_unavailable",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "authority_unavailable",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "operationId": "appQueueResponseViews",
        "tags": [
          "Отклики"
        ],
        "summary": "Queue explicit response view marks",
        "description": "Requires current application/view for reads and application/view+edit for commands on this exact row in the authenticated portal. Both cookie and API keys are supported; frozen and current key ceilings intersect at every admission. Missing, foreign and outside-level rows return the same not_found. Embed, emulation and batch are forbidden. Server supplies actor/account/authority; these fields are never accepted in input. Viewing never changes stage, fit, human review or chat-message read state. Strict JSON up to 64 KiB. Commits only local intents and returns 202 without waiting for provider APIs, including 50 targets. card_open is legal only for on_open at the exact revision; manual only in manual mode. List/hover/prefetch/bot activity must not call it. Exact normalized command replay is idempotent; unavailable/stale items are reported separately and do not discard other accepted items. A committed command survives HTTP disconnect; a cancelled pre-commit request rolls back. Worker checks current rights, mode, account generation and exact response again; successful documented provider evidence alone confirms a mark. Unknown never automatically repeats.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          }
        ],
        "responses": {
          "202": {
            "description": "Local durable state and independent provider facts; queued/202 is not provider confirmation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResponseViewBatch"
                    }
                  }
                },
                "example": {
                  "data": {
                    "mode": "manual",
                    "modeRevision": 1,
                    "items": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ResponseViewWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside-level application; no existence disclosure.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the exact target/mode or inspect the existing attempt; never automatically repeat an admitted unknown write.",
            "x-error-codes": [
              "intent_conflict",
              "view_mode_changed",
              "view_attempt_active",
              "view_attempt_changed",
              "response_target_changed",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "intent_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Strict bounded command/ref/query/UUID validation failed; fix the request.",
            "x-error-codes": [
              "invalid_response_view_command"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_response_view_command",
                    "message": "invalid_response_view_command",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority or provider could not be proven available; unknown is not permission to repeat a mark.",
            "x-error-codes": [
              "authority_unavailable",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "authority_unavailable",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponseViewCommand"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/response-views/{attemptId}/reconcile": {
      "post": {
        "operationId": "appReconcileResponseView",
        "tags": [
          "Отклики"
        ],
        "summary": "Read exact view attempt evidence",
        "description": "Requires current application/view for reads and application/view+edit for commands on this exact row in the authenticated portal. Both cookie and API keys are supported; frozen and current key ceilings intersect at every admission. Missing, foreign and outside-level rows return the same not_found. Embed, emulation and batch are forbidden. Server supplies actor/account/authority; these fields are never accepted in input. Viewing never changes stage, fit, human review or chat-message read state. Empty body. Read-only provider read-back under both current caller and original actor authority, exact immutable target/account and settings. Never marks or sends. Timeout/unavailable/unreported evidence retains unknown. true records observed state without invented actor/time; false remains an unknown operation and permits only a new explicit manual command for the documented idempotent true-setter. An old callback cannot overwrite a newer fence.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Local durable state and independent provider facts; queued/202 is not provider confirmation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResponseViewItem"
                    }
                  }
                },
                "example": {
                  "data": {
                    "mode": "manual",
                    "modeRevision": 1,
                    "items": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ResponseViewWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside-level application; no existence disclosure.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the exact target/mode or inspect the existing attempt; never automatically repeat an admitted unknown write.",
            "x-error-codes": [
              "intent_conflict",
              "view_mode_changed",
              "view_attempt_active",
              "view_attempt_changed",
              "response_target_changed",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "intent_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Strict bounded command/ref/query/UUID validation failed; fix the request.",
            "x-error-codes": [
              "invalid_response_view_command"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_response_view_command",
                    "message": "invalid_response_view_command",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority or provider could not be proven available; unknown is not permission to repeat a mark.",
            "x-error-codes": [
              "authority_unavailable",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "authority_unavailable",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/response-views/targets/verify": {
      "post": {
        "operationId": "appVerifyResponseViewTarget",
        "tags": [
          "Отклики"
        ],
        "summary": "Verify a legacy response target",
        "description": "Requires current application/view for reads and application/view+edit for commands on this exact row in the authenticated portal. Both cookie and API keys are supported; frozen and current key ceilings intersect at every admission. Missing, foreign and outside-level rows return the same not_found. Embed, emulation and batch are forbidden. Server supplies actor/account/authority; these fields are never accepted in input. Viewing never changes stage, fit, human review or chat-message read state. Strict JSON up to 4 KiB. Read-only provider verification, never a view write or message. Existing raw response fields are only a discovery hint: current publication/sync/account plus a fresh exact provider response and the application candidate identity must match before the separate encrypted communication proof is stored. HH legacy offer proof is not created or broadened. Return the current target revision for a subsequent explicit view command. No automatic background import is enabled.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          }
        ],
        "responses": {
          "200": {
            "description": "Local durable state and independent provider facts; queued/202 is not provider confirmation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResponseViewItem"
                    }
                  }
                },
                "example": {
                  "data": {
                    "ref": "sealed-response-reference",
                    "provider": "hh",
                    "available": false,
                    "observed": "unknown",
                    "reason": "target_unproven"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/ResponseViewWriteForbidden"
          },
          "404": {
            "description": "Missing, foreign or outside-level application; no existence disclosure.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the exact target/mode or inspect the existing attempt; never automatically repeat an admitted unknown write.",
            "x-error-codes": [
              "intent_conflict",
              "view_mode_changed",
              "view_attempt_active",
              "view_attempt_changed",
              "response_target_changed",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "intent_conflict",
                    "message": "intent_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Strict bounded command/ref/query/UUID validation failed; fix the request.",
            "x-error-codes": [
              "invalid_response_view_command"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid_response_view_command",
                    "message": "invalid_response_view_command",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Authority or provider could not be proven available; unknown is not permission to repeat a mark.",
            "x-error-codes": [
              "authority_unavailable",
              "response_view_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "authority_unavailable",
                    "message": "authority_unavailable",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponseViewVerification"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/message-template-families": {
      "get": {
        "operationId": "appMessageTemplateCatalog",
        "summary": "Message template families by event and channel",
        "description": "Requires mail_template.view. Catalogues return metadata; family reads keep previously saved sources readable and include field issues for content-policy violations. Permissions and original API-key ceilings apply; no sends are performed here.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageTemplateCatalog"
                    }
                  }
                },
                "example": {
                  "data": {
                    "groups": [
                      {
                        "id": "hiring",
                        "types": [
                          {
                            "type": "offer_link",
                            "folder": "hiring",
                            "channel": "email",
                            "selectedId": "default",
                            "selectedName": "",
                            "authorId": "",
                            "authorName": "",
                            "updatedAt": "0001-01-01T00:00:00Z",
                            "variantCount": 0
                          }
                        ]
                      },
                      {
                        "id": "onboarding",
                        "types": []
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/message-template-families/{type}/{channel}": {
      "get": {
        "operationId": "appMessageTemplateFamily",
        "summary": "Read a message template family",
        "description": "Requires mail_template.view. Catalogues return metadata; family reads keep previously saved sources readable and include field issues for content-policy violations. Permissions and original API-key ceilings apply; no sends are performed here.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            },
            "example": "offer_link"
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MessageTemplateChannel"
            },
            "example": "avito"
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MessageTemplateFamily"
                    }
                  }
                },
                "example": {
                  "data": {
                    "type": "offer_link",
                    "channel": "avito",
                    "revision": 0,
                    "selectedId": "default",
                    "default": {
                      "id": "default",
                      "name": "Предустановленный",
                      "authorId": "",
                      "authorName": "",
                      "source": {
                        "lang": "ru",
                        "syntaxVersion": 1,
                        "subject": "",
                        "body": "Предложение отправили на почту",
                        "requiresEmailSuccess": true
                      },
                      "fields": [],
                      "createdAt": "0001-01-01T00:00:00Z",
                      "updatedAt": "0001-01-01T00:00:00Z"
                    },
                    "variants": [],
                    "fields": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appMessageTemplateSaveVariants",
        "summary": "Save message variants without changing the default",
        "description": "Requires mail_template.view and mail_template.edit. Fresh email source policy violations return top-level contact_not_allowed and details.issues with field, code=contact_not_allowed and the original Unicode code-point offset. Structural source errors retain actionable field issues, including template_required_token for missing mandatory placeholders. Exact historical receipts are resolved before new content-policy/selection checks. Permissions and original API-key ceilings apply; no sends are performed here.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            },
            "example": "offer_link"
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MessageTemplateChannel"
            },
            "example": "avito"
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateSaveResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "revision": 1,
                    "selectedId": "default",
                    "ids": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageTemplateSaveVariantsCommand"
              },
              "example": {
                "commandId": "11111111-1111-4111-8111-111111111111",
                "expectedRevision": 0,
                "changed": []
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/message-template-families/{type}/{channel}/variants/{variantId}": {
      "delete": {
        "operationId": "appMessageTemplateDeleteVariant",
        "summary": "Delete a variant and reset the default if necessary",
        "description": "Requires mail_template.view and mail_template.edit. Deleting a custom variant does not validate its text; deleting the selected variant resets the sending default to the preset atomically. Exact historical receipts are resolved before new content-policy/selection checks. Permissions and original API-key ceilings apply; no sends are performed here.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            },
            "example": "offer_link"
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MessageTemplateChannel"
            },
            "example": "avito"
          },
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "expectedRevision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "commandId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateSaveResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "revision": 1,
                    "selectedId": "default",
                    "ids": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/message-template-families/{type}/{channel}/preview": {
      "post": {
        "operationId": "appMessageTemplatePreview",
        "summary": "Preview a message source with synthetic values",
        "description": "Requires mail_template.view. Fresh email source policy violations return top-level contact_not_allowed and details.issues with field, code=contact_not_allowed and the original Unicode code-point offset. Structural source errors retain actionable field issues, including template_required_token for missing mandatory placeholders. Permissions and original API-key ceilings apply; no sends are performed here. Shares the legacy preview bucket: 60 requests/minute/principal, at most 64 KiB body; no credential or candidate action. Platform subject must be empty.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            },
            "example": "offer_link"
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MessageTemplateChannel"
            },
            "example": "avito"
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplatePreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "subject": "",
                    "parts": [
                      {
                        "text": "Предложение отправили на почту",
                        "serviceLink": false
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageTemplateSource"
              },
              "example": {
                "lang": "ru",
                "syntaxVersion": 1,
                "subject": "",
                "body": "Сообщение подготовлено"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/message-template-families/{type}/{channel}/selection": {
      "post": {
        "operationId": "appMessageTemplateSelectDefault",
        "summary": "Choose the default message version explicitly",
        "description": "Requires mail_template.view and mail_template.edit. Selects only an existing valid version in this event/channel family; editing and selecting are independent commands. No candidate action. CAS and original API-key ceilings apply.",
        "tags": [
          "Шаблоны сообщений"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MailTemplateType"
            },
            "example": "offer_link"
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MessageTemplateChannel"
            },
            "example": "avito"
          }
        ],
        "responses": {
          "200": {
            "description": "Результат операции.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MailTemplateSaveResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "revision": 1,
                    "selectedId": "default",
                    "ids": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "template_invalid; template_required_token; template_default_read_only; template_too_large; contact_not_allowed. Поддерживаемые сочетания event/channel закрыты: неизвестное сочетание — 404. Контактный текст не включается в ошибку; details.issues содержит field/code/offset исходного Unicode code point, при сохранении — также variantId или clientId.",
            "x-error-codes": [
              "template_invalid",
              "template_required_token",
              "template_default_read_only",
              "template_too_large",
              "contact_not_allowed"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "not_found. Текст письма и внутренние подробности в отказ не включаются.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "template_revision_conflict; template_command_conflict; template_variant_limit.",
            "x-error-codes": [
              "template_revision_conflict",
              "template_command_conflict",
              "template_variant_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_revision_conflict",
                    "message": "template_revision_conflict",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageTemplateSelectCommand"
              },
              "example": {
                "commandId": "11111111-1111-4111-8111-111111111111",
                "expectedRevision": 0,
                "variantId": "default"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/communications/{event}": {
      "get": {
        "operationId": "appResponseCommunicationContext",
        "tags": [
          "Отклики"
        ],
        "summary": "Read communication preparation context",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. Read-only current event/draft, suitable template families and real channel readiness/results. Does not issue source credentials, register a handoff, publish, send or mark viewed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "event",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CommunicationEvent"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Required native offer/interview event UUID; rejection may omit to resolve its current episode."
          },
          {
            "name": "generation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Current opaque native generation; never synthesize it or reuse an earlier event/source."
          }
        ],
        "responses": {
          "200": {
            "description": "Read-only current event/draft, suitable template families and real channel readiness/results. Does not issue source credentials, register a handoff, publish, send or mark viewed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationContext"
                    }
                  }
                },
                "example": {
                  "data": {
                    "event": {
                      "event": "rejection",
                      "eventId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "generation": 1
                    },
                    "revision": 1,
                    "draft": {
                      "selections": {
                        "cabinet": true,
                        "email": false,
                        "hh": {
                          "ref": "",
                          "revision": "",
                          "message": false,
                          "state": false
                        },
                        "avito": {
                          "ref": "",
                          "revision": "",
                          "message": false,
                          "state": false
                        }
                      },
                      "emailSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "hhSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "avitoSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "cabinet": {
                        "expectedRevision": 1,
                        "mode": "literal",
                        "literal": "Prepared candidate-facing text.",
                        "frozenBody": "",
                        "frozenDigest": "",
                        "hasFrozen": false
                      }
                    },
                    "cabinetAvailable": true,
                    "cabinetComment": "Existing published comment.",
                    "cabinetRevision": 1,
                    "email": {
                      "available": false,
                      "reason": "email_unavailable"
                    },
                    "targets": [],
                    "families": [],
                    "actions": [],
                    "ownerRefs": [],
                    "sourcePrepared": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationReadForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "operationId": "appSaveResponseCommunicationDraft",
        "tags": [
          "Отклики"
        ],
        "summary": "Save communication draft",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. CAS saves preparation only. Explicit prepareSourceIfMissing may atomically stage the first selected fresh native link source and return its actual event/generation/revision; ordinary saves/GET/preview/Later never silently issue or reissue it. Existing published rejection text remains the same owner entity. The response is compact; the full catalogue is read through context.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "event",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CommunicationEvent"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CAS saves preparation only. Explicit prepareSourceIfMissing may atomically stage the first selected fresh native link source and return its actual event/generation/revision; ordinary saves/GET/preview/Later never silently issue or reissue it. Existing published rejection text remains the same owner entity. The response is compact; the full catalogue is read through context.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationDraftResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "event": {
                      "event": "rejection",
                      "eventId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "generation": 1
                    },
                    "revision": 2,
                    "draft": {
                      "selections": {
                        "cabinet": true,
                        "email": false,
                        "hh": {
                          "ref": "",
                          "revision": "",
                          "message": false,
                          "state": false
                        },
                        "avito": {
                          "ref": "",
                          "revision": "",
                          "message": false,
                          "state": false
                        }
                      },
                      "emailSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "hhSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "avitoSource": {
                        "source": {
                          "lang": "en",
                          "syntaxVersion": 1,
                          "subject": "",
                          "body": ""
                        }
                      },
                      "cabinet": {
                        "expectedRevision": 1,
                        "mode": "literal",
                        "literal": "Prepared candidate-facing text.",
                        "frozenBody": "",
                        "frozenDigest": "",
                        "hasFrozen": false
                      }
                    },
                    "sourcePrepared": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationWriteForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationDraftCommand"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/communications/{event}/preview": {
      "post": {
        "operationId": "appPreviewResponseCommunication",
        "tags": [
          "Отклики"
        ],
        "summary": "Preview selected communication actions",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. Read-only exact source/rendered content and dependencies, bound to current scope/principal/session/event/source/revision by an opaque expiring token. Token is not authority; stale context must be previewed again. No source issuance or delivery jobs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "event",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CommunicationEvent"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read-only exact source/rendered content and dependencies, bound to current scope/principal/session/event/source/revision by an opaque expiring token. Token is not authority; stale context must be previewed again. No source issuance or delivery jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationPreview"
                    }
                  }
                },
                "example": {
                  "data": {
                    "event": {
                      "event": "rejection",
                      "eventId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "generation": 1
                    },
                    "revision": 2,
                    "previewToken": "rcp1.opaque-preview-token",
                    "actions": [
                      {
                        "key": "cabinet",
                        "channel": "",
                        "rendered": {
                          "subject": "",
                          "body": "Prepared candidate-facing text.",
                          "digest": "opaque-rendered-digest"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationWriteForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationPreviewCommand"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/communications/{event}/confirm": {
      "post": {
        "operationId": "appConfirmResponseCommunication",
        "tags": [
          "Отклики"
        ],
        "summary": "Confirm selected communication actions",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. Only this explicit action executes selected publication and queues selected external effects. Durable receipt replay preserves successful/unknown heads and never resends them. Each channel has its own result; a dependent platform notification starts only after the corresponding successful email. Failed confirm rolls back local command/source/handoff/delivery effects.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public application UUID in the authenticated portal."
          },
          {
            "name": "event",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CommunicationEvent"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Only this explicit action executes selected publication and queues selected external effects. Durable receipt replay preserves successful/unknown heads and never resends them. Each channel has its own result; a dependent platform notification starts only after the corresponding successful email. Failed confirm rolls back local command/source/handoff/delivery effects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationConfirmReceipt"
                    }
                  }
                },
                "example": {
                  "data": {
                    "version": 1,
                    "communicationId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "intentId": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "revision": 2,
                    "actions": [
                      {
                        "requested": "cabinet",
                        "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                        "key": "cabinet",
                        "state": "accepted",
                        "created": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationWriteForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed. candidate_employee: the candidate of a configured interview send was converted to an employee; the invitation is not sent and no command is recorded.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit",
              "candidate_employee"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommunicationConfirmCommand"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/communication-actions/{id}": {
      "get": {
        "operationId": "appCommunicationAction",
        "tags": [
          "Отклики"
        ],
        "summary": "Read exact communication action",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. Read the immutable exact prepared/sent content, channel, accepted time and current independent result. Missing historical legacy text stays explicitly missing rather than being rendered from current templates. No unsupported delivered/read facts are invented.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public communication action UUID in this portal; its application row predicate is repeated."
          }
        ],
        "responses": {
          "200": {
            "description": "Read the immutable exact prepared/sent content, channel, accepted time and current independent result. Missing historical legacy text stays explicitly missing rather than being rendered from current templates. No unsupported delivered/read facts are invented.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationActionResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "event": {
                      "event": "rejection",
                      "eventId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "generation": 1
                    },
                    "key": "cabinet",
                    "channel": "",
                    "state": "accepted",
                    "rendered": {
                      "subject": "",
                      "body": "Prepared candidate-facing text.",
                      "digest": "opaque-rendered-digest"
                    },
                    "textMissing": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationReadForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/communication-actions/{id}/reconcile": {
      "post": {
        "operationId": "appReconcileCommunicationAction",
        "tags": [
          "Отклики"
        ],
        "summary": "Reconcile exact communication evidence",
        "description": "Both cookie and API key callers use current application.view+edit and the same row predicate in the authenticated portal; frozen/current ceilings apply. Server owns actor/account/recipient/source binding. Different email and HH/Avito sources remain independent. No messages or external stages are triggered by merely changing the internal application stage. An accepted SMTP response is not proof of candidate reading. Empty body. Read-only official evidence under current/original authority and captured current account/target/source. Only the retained exact message ID or supported independent Avito state fact can resolve unknown; no text search, new send, transition or viewed marker. A HH combined stage read does not prove its message; unsupported/inconclusive evidence remains unknown.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Public communication action UUID in this portal; its application row predicate is repeated."
          }
        ],
        "responses": {
          "200": {
            "description": "Empty body. Read-only official evidence under current/original authority and captured current account/target/source. Only the retained exact message ID or supported independent Avito state fact can resolve unknown; no text search, new send, transition or viewed marker. A HH combined stage read does not prove its message; unsupported/inconclusive evidence remains unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CommunicationActionResult"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                    "event": {
                      "event": "rejection",
                      "eventId": "6a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37",
                      "generation": 1
                    },
                    "key": "cabinet",
                    "channel": "",
                    "state": "accepted",
                    "rendered": {
                      "subject": "",
                      "body": "Prepared candidate-facing text.",
                      "digest": "opaque-rendered-digest"
                    },
                    "textMissing": false,
                    "canReconcile": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Strict bounded input/event/UUID selection is invalid. Actor, scope, credentials, MIME and server-frozen cabinet fields are not input. Public cabinet text is limited to 4000 Unicode code points after rendering: unsupported_selection with details.reason=cabinet_too_large and action=cabinet. The editable draft remains saved without clipping.",
            "x-error-codes": [
              "invalid",
              "unsupported_selection"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/CommunicationWriteForbidden"
          },
          "404": {
            "description": "Missing/foreign/outside-level application, communication or action; no cross-tenant existence disclosure.",
            "x-error-codes": [
              "application_not_found",
              "communication_not_found",
              "communication_action_not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "application_not_found",
                    "message": "application_not_found",
                    "retryable": false
                  }
                }
              }
            }
          },
          "409": {
            "description": "Refresh the changed revision/context. Preserve local input and successful per-channel outcomes; do not automatically resend admitted unknown effects. communication_email_unresolved: an earlier email is queued, in flight or has an unknown outcome; no new email is enqueued. Native preparation may return link_channel_unavailable with a safe reason, or resend_limit; a fresh Confirm whose native owner has changed still returns target_changed.",
            "x-error-codes": [
              "communication_changed",
              "intent_conflict",
              "public_comment_changed",
              "target_changed",
              "link_channel_unavailable",
              "communication_email_unresolved",
              "resend_limit"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "communication_changed",
                    "message": "communication_changed",
                    "retryable": false
                  }
                }
              }
            }
          },
          "422": {
            "description": "Source/rendered validation or an explicit successful-email dependency failed. Template field issues are returned in error.details.issues when available.",
            "x-error-codes": [
              "template_invalid",
              "dependency_required"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "template_invalid",
                    "message": "template_invalid",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommunicationRateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Current authority/account/transport evidence is unavailable; do not change the target or fall back to a marking import. Feature evaluation unavailable returns feature_flags_unavailable; retry without broadening permissions.",
            "x-error-codes": [
              "channel_unavailable",
              "feature_flags_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                },
                "example": {
                  "error": {
                    "code": "channel_unavailable",
                    "message": "channel_unavailable",
                    "retryable": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/picture": {
      "get": {
        "operationId": "appSurveyPictureGet",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Получить картину анонимного опроса",
        "description": "Картина завершённого анонимного опроса: числа по всем ответам без людей, только по вопросам, на которые ответили не меньше smallGroupMin человек (порог малой группы — поле smallGroupMin карточки опроса). Снимок считается один раз после завершения, пересчёта нет: state pending — «картина готовится», ready — числа снимка, below_threshold — ответили меньше smallGroupMin человек, error — посчитать не удалось. Только анонимному опросу и только тому, кому открыта его картина правом «Ответы опросов с именами» (survey_answer · view): уровень не ниже own и действующее назначение контролирующим; уровень all без назначения картину не открывает; под эмуляцией — forbidden. Ключу нужны клетка survey_answer · view в явном потолке и суженная survey.view. У именного опроса — forbidden. GET ничего не записывает.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Картина опроса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyPicture"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "state": "ready",
                    "participants": 12,
                    "answered": 9,
                    "numbers": {
                      "participants": 12,
                      "answered": 9,
                      "norm": {
                        "enabled": true,
                        "scales": [
                          {
                            "min": 1,
                            "max": 5,
                            "normFrom": 3.5,
                            "criticalBelow": 3,
                            "redFlagTo": 2
                          }
                        ]
                      },
                      "questions": [
                        {
                          "key": "00000000-0000-4000-8000-000000000010",
                          "answered": 9,
                          "mean": 3.8,
                          "status": "norm",
                          "distribution": [
                            {
                              "value": 1,
                              "count": 0
                            },
                            {
                              "value": 2,
                              "count": 1
                            },
                            {
                              "value": 3,
                              "count": 1
                            },
                            {
                              "value": 4,
                              "count": 1
                            },
                            {
                              "value": 5,
                              "count": 2
                            }
                          ]
                        }
                      ],
                      "blocks": [
                        {
                          "index": 0,
                          "title": "Нагрузка",
                          "scales": [
                            {
                              "min": 1,
                              "max": 5,
                              "mean": 3.8,
                              "status": "norm"
                            }
                          ],
                          "status": "norm"
                        }
                      ],
                      "survey": {
                        "scales": [
                          {
                            "min": 1,
                            "max": 5,
                            "mean": 3.8,
                            "status": "norm"
                          }
                        ],
                        "status": "norm"
                      },
                      "statuses": {
                        "norm": 3,
                        "below": 1,
                        "critical": 1,
                        "none": 0
                      },
                      "redFlagged": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/surveys/{id}/picture/texts": {
      "get": {
        "operationId": "appSurveyPictureTextsGet",
        "tags": [
          "Обратная связь сотрудников"
        ],
        "summary": "Получить тексты картины анонимного опроса",
        "description": "Свободные ответы одного вопроса из картины анонимного опроса, постранично в случайном порядке, записанном один раз для каждого вопроса; total — сколько текстов у вопроса в снимке. Тексты есть только у вопроса, на который непустой текст написали не меньше smallGroupMin человек (порог малой группы — поле smallGroupMin карточки опроса). Пока картина не ready, у скрытого порогом вопроса и у вопроса без текстов — пустая страница с total 0. Ключ вопроса не из содержимого опроса — survey_invalid. Только анонимному опросу и только тому, кому открыта его картина правом «Ответы опросов с именами» (survey_answer · view): уровень не ниже own и действующее назначение контролирующим; уровень all без назначения картину не открывает; под эмуляцией — forbidden. Ключу нужны клетка survey_answer · view в явном потолке и суженная survey.view. У именного опроса — forbidden. GET ничего не записывает.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionKey",
            "in": "query",
            "required": true,
            "description": "Ключ вопроса из содержимого опроса.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Значение cursor прошлой страницы.",
            "schema": {
              "type": "string",
              "maxLength": 4096
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Страница текстов вопроса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SurveyPictureTexts"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "texts": [
                      "Хочется больше обратной связи от руководителя.",
                      "Нагрузка выросла к концу квартала."
                    ],
                    "total": 19,
                    "cursor": "9f3a1c2b4d5e6f708192a3b4c5d6e7f8"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Коды: bad_request. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/SurveyRunForbidden"
          },
          "404": {
            "description": "Коды: not_found. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "not_found",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Коды: survey_invalid. Отправленные значения не включаются в ошибку.",
            "x-error-codes": [
              "survey_invalid"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/SurveyError"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "examples": {
                  "survey_invalid": {
                    "value": {
                      "error": {
                        "code": "survey_invalid",
                        "message": "операция с опросом отклонена",
                        "retryable": false
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/pickers/positions": {
      "get": {
        "operationId": "appRequestPositionPicker",
        "tags": [
          "План найма"
        ],
        "summary": "Должности для самостоятельной заявки",
        "description": "Только существующие доступные и неархивные должности текущего портала. Серверный поиск по подстроке q, пробелы по краям снимаются; действующий PickerLimit, без курсора. Требует vacancy_request · edit, без права вакансий или шаблонов. Ключ API сохраняет потолок владельца.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока поиска; пустая строка возвращает первую ограниченную порцию.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Допустимые названия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TitleListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "titles": [
                      "Сварщик"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/pickers/reasons": {
      "get": {
        "operationId": "appRequestReasonPicker",
        "tags": [
          "План найма"
        ],
        "summary": "Причины открытия самостоятельной заявки",
        "description": "Только причины открытия текущего портала и действующие заготовки базового языка установки. Серверный поиск q и действующий PickerLimit; причины закрытия не возвращаются. Требует vacancy_request · edit, без права вакансий или шаблонов. Ключ API сохраняет потолок владельца.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Подстрока поиска; пустая строка возвращает первую ограниченную порцию.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Допустимые названия",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TitleListResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "titles": [
                      "Расширение штата"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/requests/create-context": {
      "get": {
        "operationId": "appRequestCreateContext",
        "tags": [
          "План найма"
        ],
        "summary": "Контекст самостоятельной заявки",
        "description": "Валюта портала и живые отделы членства вызывающего из Grants.DeptPaths. Все отделы и люди портала не выдаются; отсутствие отделов возвращает []. Требует vacancy_request · edit; ключ API сохраняет потолок владельца.",
        "responses": {
          "200": {
            "description": "Контекст создания",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RequestCreateContextResponse"
                    }
                  }
                },
                "example": {
                  "data": {
                    "currency": "RUB",
                    "departments": [
                      {
                        "id": 12,
                        "name": "Цех"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/step-records": {
      "post": {
        "operationId": "appCreateStepRecord",
        "tags": [
          "Отклики"
        ],
        "summary": "Внести шаг, бывший вне системы",
        "description": "Записывает со слов рекрутера, что шаг отклика прошёл без системы: interview_held — собеседование было (кто проводил, формат, комментарий); customer_approved — заказчик одобрил кандидата (заказчик — заказчик вакансии, нет его — автор вакансии; ждущие запросы решения отклика снимаются, заказчику уходит одно сообщение бота, если запись внёс не он); offer_given — оффер отдан (комментарий, скан по желанию; у вакансии с согласованием оффера запись помечается «без согласования в HR AI»), acceptedNow — кандидат сразу принял, и открывается оформление.\n\nЗапись двигает этап так же, как перевод рекрутером: interview_held — «Отклик» в «Собеседование», offer_given — «Отклик» или «Собеседование» в «Оффер»; вход на этап — момент записи, день события живёт только в записи. Встречи, решения, офферы, счётчики и аналитика записей не видят. Запись interview_held можно сохранить при другом действующем приглашении или назначенной встрече. Приглашение сохраняется, и активная встреча остаётся в процессе. Одна живая запись вида на отклик; откат этапа назад снимает записи шагов от этапа, куда откатили, и вместо снятой можно внести новую.\n\nОтвет — отклик с полем process.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepRecordCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Отклик после записи",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-98-76"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "offer",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new",
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику. Новый номер с 15.09.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": null,
                      "pending": true
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "decision",
                      "step": "decision",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "decision",
                    "state": {
                      "code": "await_customer",
                      "kind": "wait",
                      "since": "2026-09-16T09:00:00Z",
                      "marks": []
                    },
                    "decider": {
                      "id": "2d9b6e41-0c5a-4f87-b3e2-91a7c4d8f056",
                      "name": "Белова Ирина Сергеевна"
                    },
                    "decisionState": "pending",
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T09:00:00Z",
                    "process": {
                      "steps": [
                        {
                          "step": "application",
                          "status": "done",
                          "record": null
                        },
                        {
                          "step": "interview",
                          "status": "outside",
                          "record": null
                        },
                        {
                          "step": "decision",
                          "status": "skipped",
                          "record": null
                        },
                        {
                          "step": "offer",
                          "status": "current",
                          "record": {
                            "id": "c41e7b20-58a3-4d9f-b2e6-0a9d3f7c1e58",
                            "kind": "offer_given",
                            "occurredOn": "2026-10-05",
                            "author": {
                              "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                              "name": "Одинцова Мария Павловна"
                            },
                            "canEdit": true,
                            "comment": "Оффер передан на встрече в офисе",
                            "interviewers": [],
                            "format": null,
                            "customer": null,
                            "withoutApproval": false,
                            "acceptedOn": null,
                            "scan": {
                              "id": "7a2d4f18-93c6-4e0b-a5d1-2f8e6b9c0d34",
                              "name": "оффер.pdf"
                            },
                            "withdrawn": false
                          }
                        },
                        {
                          "step": "onboarding",
                          "status": "ahead",
                          "record": null
                        },
                        {
                          "step": "hired",
                          "status": "ahead",
                          "record": null
                        }
                      ],
                      "current": "offer",
                      "live": true,
                      "next": {
                        "code": "confirm_offer_answer",
                        "kind": "turn",
                        "since": "2026-10-06T07:30:00Z"
                      },
                      "hire": "menu"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело или id не разобрались — код bad_request. invalid_value — поле не прошло проверку, details.field называет какое: kind (вид неизвестен, acceptedNow не у offer_given), occurredOn (не день, раньше допустимого или позже сегодняшнего), comment (длиннее 4000 символов), interviewers и format (не у interview_held, номер не положительный, больше 20 человек, формат вне перечня), scanFileId (файла нет, он чужой, не подтверждён или уже занят).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код live_invite у customer_approved и offer_given — у отклика живое приглашение или назначенная встреча: сначала отмените его, details.inviteId — его адрес. Код offer_approval_pending — у подготовленного оффера ждёт решения запрос согласования: сначала отзовите запрос, черновик останется; details.draftId — адрес черновика. Код offer_in_system — у отклика действующий оффер в системе, details.offerId — его адрес. Код step_record_exists — живая запись этого вида уже есть: исправить её можно откатом этапа. Код step_record_mass — у отклика массового подбора записей нет. Код application_inactive — отклик не в работе: в отказе или кандидат вышел. Код candidate_purged — данные кандидата удалены: отклик только для чтения.",
            "x-error-codes": [
              "live_invite",
              "offer_approval_pending",
              "offer_in_system",
              "step_record_exists",
              "step_record_mass",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/step-records/{recordId}": {
      "patch": {
        "operationId": "appPatchStepRecord",
        "tags": [
          "Отклики"
        ],
        "summary": "Править запись шага",
        "description": "Меняет описание живой записи целиком — комментарий, кто проводил и формат — и скан. Вид, день события и ответ кандидата не меняются, удалить запись нельзя: ошибку исправляет откат этапа. Править может внёсший запись и рекрутер вакансии. Правка, ничего не изменившая, ничего и не пишет.\n\nОтвет — отклик с полем process.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "description": "Адрес записи шага (process.steps[].record.id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepRecordEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после правки записи",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-98-76"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "offer",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new",
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику. Новый номер с 15.09.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": null,
                      "pending": true
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "decision",
                      "step": "decision",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "decision",
                    "state": {
                      "code": "await_customer",
                      "kind": "wait",
                      "since": "2026-09-16T09:00:00Z",
                      "marks": []
                    },
                    "decider": {
                      "id": "2d9b6e41-0c5a-4f87-b3e2-91a7c4d8f056",
                      "name": "Белова Ирина Сергеевна"
                    },
                    "decisionState": "pending",
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T09:00:00Z",
                    "process": {
                      "steps": [
                        {
                          "step": "application",
                          "status": "done",
                          "record": null
                        },
                        {
                          "step": "interview",
                          "status": "outside",
                          "record": null
                        },
                        {
                          "step": "decision",
                          "status": "skipped",
                          "record": null
                        },
                        {
                          "step": "offer",
                          "status": "current",
                          "record": {
                            "id": "c41e7b20-58a3-4d9f-b2e6-0a9d3f7c1e58",
                            "kind": "offer_given",
                            "occurredOn": "2026-10-05",
                            "author": {
                              "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                              "name": "Одинцова Мария Павловна"
                            },
                            "canEdit": true,
                            "comment": "Оффер передан на встрече в офисе",
                            "interviewers": [],
                            "format": null,
                            "customer": null,
                            "withoutApproval": false,
                            "acceptedOn": null,
                            "scan": {
                              "id": "7a2d4f18-93c6-4e0b-a5d1-2f8e6b9c0d34",
                              "name": "оффер.pdf"
                            },
                            "withdrawn": false
                          }
                        },
                        {
                          "step": "onboarding",
                          "status": "ahead",
                          "record": null
                        },
                        {
                          "step": "hired",
                          "status": "ahead",
                          "record": null
                        }
                      ],
                      "current": "offer",
                      "live": true,
                      "next": {
                        "code": "confirm_offer_answer",
                        "kind": "turn",
                        "since": "2026-10-06T07:30:00Z"
                      },
                      "hire": "menu"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело, id или recordId не разобрались — код bad_request. invalid_value — поле не прошло проверку, details.field называет какое: comment, interviewers, format, scanFileId.",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/StepRecordWriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего, либо у отклика нет записи с таким recordId — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код step_record_not_live — запись снята откатом этапа и не правится. Код application_inactive — отклик не в работе: в отказе или кандидат вышел. Код candidate_purged — данные кандидата удалены: отклик только для чтения.",
            "x-error-codes": [
              "step_record_not_live",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/applications/{id}/step-records/{recordId}/accept": {
      "post": {
        "operationId": "appAcceptStepRecord",
        "tags": [
          "Отклики"
        ],
        "summary": "Отметить «Кандидат принял»",
        "description": "Отмечает у живой записи offer_given, что кандидат принял оффер, и открывает оформление так же, как принятие оффера в системе: откат этапа с «Оффера» его закрывает, и принятие этим снимается. Повтор у уже принятой записи ничего не меняет.\n\nОтвет — отклик с полем process.\n\nТребует права application · edit; отклик вне уровня вызывающего отвечает 404, как несуществующий.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id отклика.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "description": "Адрес записи шага (process.steps[].record.id).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepRecordAcceptRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Отклик после ответа кандидата",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Application"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5e2c7a90-3f41-4b8d-9c6e-1a7d0b3f8e24",
                    "candidate": {
                      "id": "a83f1c52-6d0e-47b9-8e21-c4f9d7a03b16",
                      "name": "Кузнецов Алексей Игоревич",
                      "contacts": [
                        {
                          "kind": "phone",
                          "value": "+7 916 555-98-76"
                        },
                        {
                          "kind": "telegram",
                          "value": "@kuznetsov_cnc"
                        }
                      ]
                    },
                    "vacancy": {
                      "id": "3b6f8d2a-145c-49e7-a0b2-c8d1e5f70934",
                      "position": "Оператор станка ЧПУ"
                    },
                    "stage": "offer",
                    "hiredOn": null,
                    "historicalOn": null,
                    "fit": "high",
                    "fitBot": "high",
                    "fitHuman": null,
                    "score": 92,
                    "scoreSource": "ai",
                    "reviewStatus": "fit",
                    "allowedStages": [
                      "new",
                      "interview"
                    ],
                    "formStages": [
                      "offer",
                      "hired",
                      "rejected"
                    ],
                    "responsible": {
                      "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                      "name": "Одинцова Мария Павловна"
                    },
                    "resumeUrl": "https://disk.example.ru/resume/kuznetsov.pdf",
                    "note": "Работал на стойке Heidenhain, готов к сменному графику. Новый номер с 15.09.",
                    "createdAt": "2026-09-14T08:05:41Z",
                    "source": "hh",
                    "channels": [
                      "hh"
                    ],
                    "decision": {
                      "verdict": null,
                      "pending": true
                    },
                    "nextInterviewAt": null,
                    "journey": {
                      "phase": "decision",
                      "step": "decision",
                      "steps": [
                        "application",
                        "interview",
                        "decision",
                        "offer",
                        "hired"
                      ]
                    },
                    "type": "unspecified",
                    "submittedBy": null,
                    "submittedSnapshot": null,
                    "rejection": null,
                    "step": "decision",
                    "state": {
                      "code": "await_customer",
                      "kind": "wait",
                      "since": "2026-09-16T09:00:00Z",
                      "marks": []
                    },
                    "decider": {
                      "id": "2d9b6e41-0c5a-4f87-b3e2-91a7c4d8f056",
                      "name": "Белова Ирина Сергеевна"
                    },
                    "decisionState": "pending",
                    "liveInvite": null,
                    "verdict": "fit",
                    "verdictSource": "ai",
                    "rejectedFrom": null,
                    "stageEnteredAt": "2026-09-15T09:00:00Z",
                    "process": {
                      "steps": [
                        {
                          "step": "application",
                          "status": "done",
                          "record": null
                        },
                        {
                          "step": "interview",
                          "status": "outside",
                          "record": null
                        },
                        {
                          "step": "decision",
                          "status": "skipped",
                          "record": null
                        },
                        {
                          "step": "offer",
                          "status": "current",
                          "record": {
                            "id": "c41e7b20-58a3-4d9f-b2e6-0a9d3f7c1e58",
                            "kind": "offer_given",
                            "occurredOn": "2026-10-05",
                            "author": {
                              "id": "0f3a91c4-7d2b-4e58-9a10-6c5d8e2f41b7",
                              "name": "Одинцова Мария Павловна"
                            },
                            "canEdit": true,
                            "comment": "Оффер передан на встрече в офисе",
                            "interviewers": [],
                            "format": null,
                            "customer": null,
                            "withoutApproval": false,
                            "acceptedOn": null,
                            "scan": {
                              "id": "7a2d4f18-93c6-4e0b-a5d1-2f8e6b9c0d34",
                              "name": "оффер.pdf"
                            },
                            "withdrawn": false
                          }
                        },
                        {
                          "step": "onboarding",
                          "status": "ahead",
                          "record": null
                        },
                        {
                          "step": "hired",
                          "status": "ahead",
                          "record": null
                        }
                      ],
                      "current": "offer",
                      "live": true,
                      "next": {
                        "code": "confirm_offer_answer",
                        "kind": "turn",
                        "since": "2026-10-06T07:30:00Z"
                      },
                      "hire": "menu"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Тело, id или recordId не разобрались — код bad_request. invalid_value — details.field называет поле: acceptedOn (не день, раньше дня события или позже сегодняшнего), kind (запись не offer_given).",
            "x-error-codes": [
              "bad_request",
              "invalid_value"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Отклика с таким id в этом портале нет или он вне уровня вызывающего, либо у отклика нет записи с таким recordId — код not_found.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Код step_record_not_live — запись снята откатом этапа. Код application_inactive — отклик не в работе: в отказе или кандидат вышел. Код candidate_purged — данные кандидата удалены: отклик только для чтения.",
            "x-error-codes": [
              "step_record_not_live",
              "application_inactive",
              "candidate_purged"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records": {
      "get": {
        "operationId": "appCustomerCallRecords",
        "tags": [
          "План найма"
        ],
        "summary": "List customer-call records",
        "description": "Requires current vacancy.view at row level without approval participation. Writes also require vacancy.edit on the same row. API keys require an explicit ceiling and the existing current identity and admission checks. All record and plan IDs are portal/vacancy scoped. No transcript body or report is read to build the list. A planId references the current shared plan; a meeting never pins a library version. The default view=summary returns the nearest current/future meeting plus the two latest completed records, or three completed records without a future meeting. It is not the first page when several meetings are upcoming. view=page returns a keyset page; pass its opaque nextCursor only with view=page. The cursor freezes the time boundary. count is the total live metadata count. Summary has an empty nextCursor; open the drawer with view=page and no cursor. Confirmed calendar cancellations belong to history before pagination and cannot displace the nearest active future meeting. Unknown evidence is not cancellation. The signed cursor binds portal, vacancy and ordering/membership metadata; a changed revision returns 409 conflict and requires restarting at the first page. Each page uses one database snapshot; later changes are observed on a subsequent request. Metadata revision work is proportional to one vacancy, while result sizes and application memory remain bounded.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "page"
              ],
              "default": "summary"
            },
            "description": "Choose the collapsed summary or full keyset page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Opaque cursor; only accepted with view=page."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "description": "Page size; only accepted with view=page."
          }
        ],
        "responses": {
          "200": {
            "description": "List customer-call records.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecordList"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": [],
                    "count": 0,
                    "nextCursor": ""
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict. Restart pagination from the first page when ordering, membership or the current successful analysis changes.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}": {
      "get": {
        "operationId": "appCustomerCallRecord",
        "tags": [
          "План найма"
        ],
        "summary": "Read a customer-call record",
        "description": "Requires current vacancy.view at row level without approval participation. Writes also require vacancy.edit on the same row. API keys require an explicit ceiling and the existing current identity and admission checks. All record and plan IDs are portal/vacancy scoped. No transcript body or report is read to build the list. A planId references the current shared plan; a meeting never pins a library version. Returns the scoped record and its selected shared plan with current contents, even without broad call_plan_template.view. The client cannot request an arbitrary plan through this operation. Participants are the saved booking organizer/customer, not today's vacancy team. Missing legacy title and day-only manual dates are preserved without invention. GET never materializes metadata.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read a customer-call record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecord"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                    "kind": "manual",
                    "title": "Role requirements",
                    "titleUnavailable": false,
                    "planId": "",
                    "planName": "",
                    "selectionRevision": 0,
                    "startsAt": null,
                    "endsAt": null,
                    "callDate": "2026-11-25",
                    "timezone": "",
                    "pollState": "",
                    "manualCount": 1,
                    "followupCount": 0,
                    "participants": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/schedule": {
      "post": {
        "operationId": "appScheduleCustomerCallRecord",
        "tags": [
          "План найма"
        ],
        "summary": "Schedule a customer-call record",
        "description": "Requires current vacancy.view at row level without approval participation. Writes also require vacancy.edit on the same row. API keys require an explicit ceiling and the existing current identity and admission checks. All record and plan IDs are portal/vacancy scoped. No transcript body or report is read to build the list. A planId references the current shared plan; a meeting never pins a library version. Creates a real calendar event and meeting chat under the current actor's existing calendar/im credentials. Persists title, optional planId and a durable commandKey receipt atomically with reservation. An identical replay never repeats the external booking, including after archival or credential loss. command_pending and command_unknown require reconciliation rather than issuing a new key. A changed body under one key returns command_mismatch. Existing duration, date, readiness and identity limits apply.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          }
        ],
        "responses": {
          "201": {
            "description": "Schedule a customer-call record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecord"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                    "kind": "calendar",
                    "title": "Role requirements",
                    "titleUnavailable": false,
                    "planId": "",
                    "planName": "",
                    "selectionRevision": 0,
                    "startsAt": "2026-11-26T10:00:00Z",
                    "endsAt": "2026-11-26T10:45:00Z",
                    "callDate": null,
                    "timezone": "UTC",
                    "pollState": "active",
                    "manualCount": 0,
                    "followupCount": 0,
                    "participants": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: command_mismatch, plan_unavailable, vacancy_archived, command_pending, command_unknown, vacancy_not_ready, customer_not_in_b24, self_call, duplicate, b24_not_ready. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "command_mismatch",
              "plan_unavailable",
              "vacancy_archived",
              "command_pending",
              "command_unknown",
              "vacancy_not_ready",
              "customer_not_in_b24",
              "self_call",
              "duplicate",
              "b24_not_ready",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "command_mismatch",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "502": {
            "description": "Machine-readable refusal: b24_unavailable.",
            "x-error-codes": [
              "b24_unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "b24_unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallRecordScheduleRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "startsAt": "2026-11-26T10:00:00Z",
                "durationMin": 45,
                "tz": "UTC",
                "title": "Role requirements"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/transcripts": {
      "post": {
        "operationId": "appAddCustomerCallRecordTranscript",
        "tags": [
          "План найма"
        ],
        "summary": "Add manual text to a customer-call record",
        "description": "Requires current vacancy.view at row level without approval participation. Writes also require vacancy.edit on the same row. API keys require an explicit ceiling and the existing current identity and admission checks. All record and plan IDs are portal/vacancy scoped. No transcript body or report is read to build the list. A planId references the current shared plan; a meeting never pins a library version. Creates a real encrypted manual transcript; does not run AI. Without recordId, callDate is required (day precision), and the transcript public ID is the standalone record ID. With recordId, expectedSelectionRevision is required because the confirmed common-plan selection is saved using CAS; callDate is optional and cannot replace the trusted date of the existing completed meeting. The linked source retains its own manual ID/history. Optional planId references the chosen available common plan; title may be empty for untitled metadata. A durable commandKey receipt precedes mutable archive/date/count guards; identical replay returns the original source, and changed-body replay returns command_mismatch.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          }
        ],
        "responses": {
          "201": {
            "description": "Add manual text to a customer-call record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecordTranscriptResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "recordId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                    "transcript": {
                      "transcriptId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                      "source": "manual",
                      "callDate": "2026-11-25",
                      "startedAt": null,
                      "durationSeconds": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: command_mismatch, plan_unavailable, vacancy_archived, conflict, not_completed, source_linked. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "command_mismatch",
              "plan_unavailable",
              "vacancy_archived",
              "conflict",
              "not_completed",
              "source_linked",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "command_mismatch",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallRecordTranscriptRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "callDate": "2026-11-25",
                "text": "Agreed requirements from the customer call.",
                "title": "Role requirements"
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/plan": {
      "put": {
        "operationId": "appSelectCustomerCallRecordPlan",
        "tags": [
          "План найма"
        ],
        "summary": "Select a shared plan for a customer-call record",
        "description": "Requires current vacancy.view at row level without approval participation. Writes also require vacancy.edit on the same row. API keys require an explicit ceiling and the existing current identity and admission checks. All record and plan IDs are portal/vacancy scoped. No transcript body or report is read to build the list. A planId references the current shared plan; a meeting never pins a library version. Saves only this record's common plan ID under expectedSelectionRevision CAS. Does not change the vacancy default, another meeting or any historical result. Checks plan availability and vacancy writable state atomically. Identical commandKey replays its persisted selection receipt before mutable archive guards; a changed body returns command_mismatch. The response is a selection receipt, not pinned plan contents.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Select a shared plan for a customer-call record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecordSelection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "planId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                    "selectionRevision": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: command_mismatch, plan_unavailable, vacancy_archived, conflict. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "command_mismatch",
              "plan_unavailable",
              "vacancy_archived",
              "conflict",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "command_mismatch",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallRecordPlanRequest"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "planId": "3f6c2a91-7d4e-4b8a-9c15-2e0d8a4b6f73",
                "expectedSelectionRevision": 0
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/analysis/prepare": {
      "get": {
        "operationId": "appPrepareCustomerCallAnalysis",
        "tags": [
          "План найма"
        ],
        "summary": "Prepare sources of one customer-call record",
        "description": "Requires current vacancy.view at row level without approval participation. Commands also require vacancy.edit on the same row. API keys require an explicit ceiling and current identity/admission checks; frozen and current ceilings intersect again at execution and publication. All IDs are portal/vacancy/record scoped. Sources of another record are refused even in the same vacancy. The server owns source text, content hashes and meeting links; clients send only selected source IDs and signed version tickets. Analysis and plan comparison are independent operations. Reads never start a model or apply changes to brief/portrait documents. Source privacy removal erases all dependent historical inputs and reports and prevents late publication.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "nextCursor from the preceding source page. At most 20 source tickets are prepared per page, for this record only."
          }
        ],
        "responses": {
          "200": {
            "description": "Prepare sources of one customer-call record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallAnalysisPreparation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "sources": [
                      {
                        "sourceId": "22222222-2222-4222-8222-222222222222",
                        "type": "manual",
                        "ticket": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/analysis": {
      "post": {
        "operationId": "appStartCustomerCallAnalysis",
        "tags": [
          "План найма"
        ],
        "summary": "Queue a saved customer-call analysis",
        "description": "Requires current vacancy.view at row level without approval participation. Commands also require vacancy.edit on the same row. API keys require an explicit ceiling and current identity/admission checks; frozen and current ceilings intersect again at execution and publication. All IDs are portal/vacancy/record scoped. Sources of another record are refused even in the same vacancy. The server owns source text, content hashes and meeting links; clients send only selected source IDs and signed version tickets. Analysis and plan comparison are independent operations. Reads never start a model or apply changes to brief/portrait documents. Source privacy removal erases all dependent historical inputs and reports and prevents late publication. Durable commandKey receipts replay the same accepted attempt without another model charge; a different body returns command_mismatch. A failed refresh preserves lastSuccess. The immutable selected input is encrypted. Queue and execution deadlines and bounded provider concurrency apply. Archived vacancies cannot accept or publish new analysis.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          }
        ],
        "responses": {
          "202": {
            "description": "Queue a saved customer-call analysis.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallAnalysisAttempt"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "recordId": "22222222-2222-4222-8222-222222222222",
                    "state": "queued",
                    "createdAt": "2026-11-25T12:00:00Z",
                    "schemaVersion": "call-analysis-v1",
                    "promptVersion": "call-analysis-v1",
                    "parserVersion": "exact-evidence-v1",
                    "manifest": [
                      {
                        "sourceId": "22222222-2222-4222-8222-222222222222",
                        "type": "manual",
                        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: command_mismatch, conflict, vacancy_archived. Source changes before acceptance conflict without a model call. One active analysis per record; another command conflicts while queued/running. Archive forbids new work until POST /api/v1/vacancies/{id}/restore. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "command_mismatch",
              "conflict",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "command_mismatch",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallAnalysisStartInput"
              },
              "example": {
                "commandKey": "11111111-1111-4111-8111-111111111111",
                "language": "ru",
                "sources": [
                  {
                    "sourceId": "22222222-2222-4222-8222-222222222222",
                    "ticket": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appGetCustomerCallAnalysis",
        "tags": [
          "План найма"
        ],
        "summary": "Read current analysis and last successful report",
        "description": "Requires current vacancy.view at row level without approval participation. Commands also require vacancy.edit on the same row. API keys require an explicit ceiling and current identity/admission checks; frozen and current ceilings intersect again at execution and publication. All IDs are portal/vacancy/record scoped. Sources of another record are refused even in the same vacancy. The server owns source text, content hashes and meeting links; clients send only selected source IDs and signed version tickets. Analysis and plan comparison are independent operations. Reads never start a model or apply changes to brief/portrait documents. Source privacy removal erases all dependent historical inputs and reports and prevents late publication. When no raw modern last_success_id is stored, legacy contains actual saved old Follow-up items in bounded source pages, independently of a failed first modern refresh. A nonempty modern success pointer suppresses this fallback even for empty, unreadable or withdrawn results. Legacy does not fabricate modern attempts or unformed report sections. Calendar cancellation alone preserves readonly report history; current privacy/source removal and access revocation remain authoritative. An existing unreadable old success returns unavailable with no partial legacy page.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          },
          {
            "name": "legacyCursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Opaque signed continuation for old Follow-up factual reports returned as legacy.nextCursor. Omit for the first page; a source change or a newly saved modern success requires restarting."
          }
        ],
        "responses": {
          "200": {
            "description": "Read current analysis and last successful report.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallAnalysisStatus"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "hasNewSources": false,
                    "legacy": {
                      "reports": [
                        {
                          "kind": "legacy_followup_items",
                          "sourceId": "11111111-1111-4111-8111-111111111111",
                          "items": [
                            {
                              "field": "tasks",
                              "text": "Saved factual task",
                              "quote": "one two three",
                              "at": "00:00:01"
                            }
                          ],
                          "truncated": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict. Restart pagination from the first page when ordering, membership or the current successful analysis changes.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/analysis/{attemptId}": {
      "get": {
        "operationId": "appGetCustomerCallAnalysisAttempt",
        "tags": [
          "План найма"
        ],
        "summary": "Read one exact saved analysis attempt",
        "description": "Requires current vacancy.view at row level without approval participation. Commands also require vacancy.edit on the same row. API keys require an explicit ceiling and current identity/admission checks; frozen and current ceilings intersect again at execution and publication. All IDs are portal/vacancy/record scoped. Sources of another record are refused even in the same vacancy. The server owns source text, content hashes and meeting links; clients send only selected source IDs and signed version tickets. Analysis and plan comparison are independent operations. Reads never start a model or apply changes to brief/portrait documents. Source privacy removal erases all dependent historical inputs and reports and prevents late publication.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Exact attempt public ID of this record."
          }
        ],
        "responses": {
          "200": {
            "description": "Read one exact saved analysis attempt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallAnalysisAttempt"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "recordId": "22222222-2222-4222-8222-222222222222",
                    "state": "succeeded",
                    "createdAt": "2026-11-25T12:00:00Z",
                    "schemaVersion": "call-analysis-v1",
                    "promptVersion": "call-analysis-v1",
                    "parserVersion": "exact-evidence-v1",
                    "manifest": [
                      {
                        "sourceId": "22222222-2222-4222-8222-222222222222",
                        "type": "manual",
                        "hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      }
                    ],
                    "startedAt": "2026-11-25T12:00:01Z",
                    "finishedAt": "2026-11-25T12:00:30Z",
                    "report": {
                      "schemaVersion": "call-analysis-v1",
                      "summary": "",
                      "topics": [],
                      "insights": [],
                      "gaps": [],
                      "limitations": [
                        "insufficient_data"
                      ],
                      "items": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/comparison/prepare": {
      "get": {
        "operationId": "appPrepareCustomerCallComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Prepare this record’s current plan and source tickets",
        "description": "Requires vacancy.view at row level without approval participation. Writes require vacancy.edit on the same row. Current actor, API key identity and explicit ceiling are checked at acceptance, execution and publication. All coordinates are scoped to portal, vacancy and record. Analysis and comparison run independently. Reads never call AI. A record stores the current common plan ID and its selection revision; library edits are global. Accepted comparisons retain their own immutable plan/source snapshot. Results and recommendations never modify the plan or documents. Privacy deletion sanitizes every dependent historical revision, removing assessment and recommendations; withdrawn evidence is neutral and never an off_plan grade. The bounded record source inventory is returned with current signed tickets. A source that cannot be read has no ticket and cannot be selected.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "nextCursor from this record’s preceding source page. At most 20 sources per page."
          }
        ],
        "responses": {
          "200": {
            "description": "Prepare this record’s current plan and source tickets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonPreparation"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "record": {
                      "recordId": "22222222-2222-4222-8222-222222222222",
                      "selectionRevision": 1
                    },
                    "planId": "33333333-3333-4333-8333-333333333333",
                    "planVersionId": "11111111-1111-4111-8111-111111111111",
                    "selectionRevision": 1,
                    "sources": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/comparison": {
      "post": {
        "operationId": "appStartCustomerCallComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Queue a comparison against this record’s current plan",
        "description": "Requires vacancy.view at row level without approval participation. Writes require vacancy.edit on the same row. Current actor, API key identity and explicit ceiling are checked at acceptance, execution and publication. All coordinates are scoped to portal, vacancy and record. Analysis and comparison run independently. Reads never call AI. A record stores the current common plan ID and its selection revision; library edits are global. Accepted comparisons retain their own immutable plan/source snapshot. Results and recommendations never modify the plan or documents. Privacy deletion sanitizes every dependent historical revision, removing assessment and recommendations; withdrawn evidence is neutral and never an off_plan grade. At most one comparison is active per record across plan versions. A new commandKey creates a new attempt even after success; identical replays return their durable outcome, changed bodies return command_mismatch. Refresh requires a fresh prepare with the current plan/version/selection revision. Historical vacancy retry remains unchanged; record attempts use this fresh command. A failed refresh preserves lastSuccess. Legacy managed epochs refuse new record comparisons until the existing rollout admits the required protocol. Body limit: 16384 bytes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          }
        ],
        "responses": {
          "202": {
            "description": "Queue a comparison against this record’s current plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CallComparisonAttempt"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "33333333-3333-4333-8333-333333333333",
                    "scopeId": "11111111-1111-4111-8111-111111111111",
                    "scopeSequence": 1,
                    "state": "queued",
                    "commandKey": "22222222-2222-4222-8222-222222222222",
                    "selectionBasis": "current_selection",
                    "createdAt": "2026-11-25T12:00:00Z",
                    "model": "gpt-4.1",
                    "promptVersion": "comparison-record-v1",
                    "parserVersion": "record-contract-v1",
                    "needsReview": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch, vacancy_archived. vacancy_archived: the vacancy is archived, so no comparison is queued until it is restored (POST /api/v1/vacancies/{id}/restore); reads and transcript deletion keep working. meeting_cancelled refuses new work on a confirmed cancelled meeting; historical readable sources and reports remain available.",
            "x-error-codes": [
              "conflict",
              "command_mismatch",
              "vacancy_archived",
              "meeting_cancelled"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCallComparisonStartInput"
              },
              "example": {
                "commandKey": "22222222-2222-4222-8222-222222222222",
                "planId": "33333333-3333-4333-8333-333333333333",
                "planVersionId": "11111111-1111-4111-8111-111111111111",
                "selectionRevision": 1,
                "sources": [
                  {
                    "sourceId": "22222222-2222-4222-8222-222222222222",
                    "ticket": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "appGetCustomerCallComparison",
        "tags": [
          "План найма"
        ],
        "summary": "Read this record’s current comparison and last successful report",
        "description": "Requires vacancy.view at row level without approval participation. Writes require vacancy.edit on the same row. Current actor, API key identity and explicit ceiling are checked at acceptance, execution and publication. All coordinates are scoped to portal, vacancy and record. Analysis and comparison run independently. Reads never call AI. A record stores the current common plan ID and its selection revision; library edits are global. Accepted comparisons retain their own immutable plan/source snapshot. Results and recommendations never modify the plan or documents. Privacy deletion sanitizes every dependent historical revision, removing assessment and recommendations; withdrawn evidence is neutral and never an off_plan grade. lastSuccess includes the effective human revision. Optional versioned assessment fields are absent on older reports. assessmentState distinguishes unavailable, evidence_withdrawn and human_edited from old reports where assessment was never generated.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical calendar or standalone manual transcript public ID in this vacancy."
          }
        ],
        "responses": {
          "200": {
            "description": "Read this record’s current comparison and last successful report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallRecordComparison"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict, command_mismatch.",
            "x-error-codes": [
              "conflict",
              "command_mismatch"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/call-suggestions": {
      "get": {
        "operationId": "appCustomerCallSuggestions",
        "tags": [
          "План найма"
        ],
        "summary": "Read customer-call field suggestions",
        "description": "Requires the same current vacancy.view row-level access without approval participation as source and report reads, including current API key identity and ceiling checks. Each response processes one canonical record and at most 20 source slots; follow nextCursor even when items is empty. Traversal covers the whole vacancy independently of collapsed summaries. The current successful record analysis is fully verified against every selected current source before any items are emitted. A selected source shadows its legacy items even when its new items are empty; unselected Follow-up sources retain their last successful legacy items after a failed refresh. Existing unreadable successful analyses return unavailable, with no fallback or partial selected proof. Cursors bind portal, vacancy, ordering, source slots and the current successful analysis pointer; changed bindings return conflict. Reading never starts AI, writes metadata or applies suggestions to documents. Result and memory are bounded; ordering revision work scans metadata of one vacancy.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Opaque signed continuation. Restart without a cursor after conflict."
          }
        ],
        "responses": {
          "200": {
            "description": "Read customer-call field suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallSuggestionsPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict. Restart pagination from the first page when ordering, membership or the current successful analysis changes.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-call-records/{recordId}/calendar-history": {
      "get": {
        "operationId": "appCustomerCallCalendarHistory",
        "tags": [
          "План найма"
        ],
        "summary": "Read customer-call calendar history",
        "description": "Requires current vacancy.view at row level without approval participation and the same API key ceiling and identity checks as record reads. Returns only bounded facts of the current exact portal/call/organizer/event tuple, newest first with state as a tie breaker. Standalone manual records have empty calendar history. A replaced calendar identity or changed ordering returns conflict on continuation. No calendar descriptions, credentials or source/report content are read or returned. Reading does not change saved metadata or launch AI.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vacancy public ID in the current portal."
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical record public ID in the current vacancy."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096
            },
            "description": "Opaque signed continuation. Restart without a cursor after conflict."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            },
            "description": "Maximum history facts per page."
          }
        ],
        "responses": {
          "200": {
            "description": "Read customer-call calendar history.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallCalendarHistoryPage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Machine-readable refusal: bad_request, validation_error.",
            "x-error-codes": [
              "bad_request",
              "validation_error"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "bad_request",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Machine-readable refusal: conflict. Restart pagination from the first page when ordering, membership or the current successful analysis changes.",
            "x-error-codes": [
              "conflict"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "description": "Machine-readable refusal: unavailable.",
            "x-error-codes": [
              "unavailable"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  },
                  "required": [
                    "error"
                  ]
                },
                "example": {
                  "error": {
                    "code": "unavailable",
                    "message": "Request refused",
                    "retryable": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/vacancies/{id}/customer-calls/{callId}/participants/retry": {
      "post": {
        "operationId": "appRetryCustomerCallParticipants",
        "tags": [
          "План найма"
        ],
        "summary": "Повторить доставку участников созвона",
        "description": "Пробуждает только существующие намерения доставки участников указанного созвона этой вакансии. Не создаёт встречу или чат. Требует vacancy · edit и уровень на строке. Архивная вакансия не допускает повтор.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "public_id вакансии.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "callId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerCallParticipantStatus"
                    }
                  }
                },
                "example": {
                  "data": {
                    "state": "pending",
                    "calendarState": "pending",
                    "chatState": "pending",
                    "unfinished": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Код bad_request: id не идентификатор.",
            "x-error-codes": [
              "bad_request"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/WriteForbidden"
          },
          "404": {
            "description": "Код not_found: вакансии нет либо она вне уровня смотрящего.",
            "x-error-codes": [
              "not_found"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "participants_not_retryable — созвон ещё не назначен; vacancy_archived — вакансия в архиве.",
            "x-error-codes": [
              "participants_not_retryable",
              "vacancy_archived"
            ],
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "$ref": "#/components/schemas/Error"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "SurveyOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "label"
        ]
      },
      "SurveyQuestion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "short_text",
              "long_text",
              "single_choice",
              "multiple_choice",
              "yes_no",
              "number",
              "rating"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "help": {
            "type": "string",
            "maxLength": 10000
          },
          "block": {
            "type": "string",
            "maxLength": 10000
          },
          "required": {
            "type": "boolean"
          },
          "maxLength": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyOption"
            },
            "maxItems": 100
          },
          "min": {
            "type": "number",
            "nullable": true
          },
          "max": {
            "type": "number",
            "nullable": true
          },
          "minLabel": {
            "type": "string",
            "maxLength": 255
          },
          "maxLabel": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "kind",
          "title",
          "help",
          "block",
          "required",
          "maxLength",
          "options",
          "min",
          "max",
          "minLabel",
          "maxLabel"
        ],
        "description": "Единая форма семи видов вопроса. Неприменимые options — [], min/max — null, maxLength — 0. Готовая форма дополнительно требует заголовков, вариантов choice и целых границ rating. Изменение kind под прежним key запрещено: создайте новый UUID.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "short_text"
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOption"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "long_text"
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOption"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "single_choice"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "multiple_choice"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "yes_no"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOption"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "number"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOption"
                },
                "maxItems": 0
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "rating"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOption"
                },
                "maxItems": 0
              },
              "min": {
                "type": "integer",
                "nullable": true
              },
              "max": {
                "type": "integer",
                "nullable": true
              }
            },
            "required": [
              "kind"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        }
      },
      "SurveyCategory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "needsAction": {
            "type": "boolean"
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          }
        },
        "required": [
          "key",
          "name",
          "needsAction",
          "importance"
        ]
      },
      "SurveyCriterion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "libraryKey": {
            "type": "string",
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "instruction": {
            "type": "string",
            "maxLength": 10000
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCategory"
            },
            "maxItems": 20
          }
        },
        "required": [
          "key",
          "libraryKey",
          "name",
          "instruction",
          "categories"
        ]
      },
      "SurveyContent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyQuestion"
            },
            "maxItems": 100
          },
          "goal": {
            "type": "string",
            "maxLength": 10000
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCriterion"
            },
            "maxItems": 20
          }
        },
        "required": [
          "title",
          "description",
          "questions",
          "goal",
          "criteria"
        ],
        "description": "Содержимое карточки: все поля присутствуют, массивы нормализованы в []. Незавершённый черновик допускает пустые названия, цель, инструкции и массивы. Проверка ready выполняется атомарно на сервере."
      },
      "SurveyCreateForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionInput"
            },
            "maxItems": 100
          },
          "goal": {
            "type": "string",
            "maxLength": 10000
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCriterionInput"
            },
            "maxItems": 20
          },
          "norm": {
            "$ref": "#/components/schemas/SurveyNorm",
            "description": "Необязательно: без поля действует норма по умолчанию. null — 400 survey_norm_null."
          }
        },
        "required": [],
        "description": "Содержание анкеты и необязательная норма. Незавершённый черновик может содержать пустые названия, инструкции и массивы. Пропущенные массивы нормализуются в []. Проверка ready атомарно требует название, цель, вопросы и заполненные выбранные критерии. Критерии не выбираются автоматически. До создания типизированных коллекций проверяются пределы: 100 вопросов, 100 вариантов вопроса, 20 критериев и 20 категорий критерия. Превышение — 422 survey_invalid, details.fields с code=too_many."
      },
      "SurveySaveForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "content": {
            "$ref": "#/components/schemas/SurveyContentInput"
          },
          "ready": {
            "type": "boolean"
          },
          "norm": {
            "$ref": "#/components/schemas/SurveyNorm",
            "description": "Необязательно: без поля норма не меняется и только приводится к вопросам. null — 400 survey_norm_null: снять норму можно только выключателем enabled."
          },
          "anonymousDefault": {
            "type": "boolean",
            "description": "Необязательное поле: отсутствие значит «не менять». Признак, с которым создаются опросы анкеты (anonymousDefault в карточке)."
          }
        },
        "required": [
          "revision",
          "content",
          "ready"
        ]
      },
      "SurveyFormCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "ready",
              "archived"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/SurveyContent"
          },
          "surveyCount": {
            "type": "integer",
            "minimum": 0
          },
          "creatorId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID пользователя. Пустая строка, если исторический пользователь уже отсутствует."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда анкета создана. Перенос в папку и правки её не меняют."
          },
          "folderId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID папки. Пустая строка у анкеты в корне."
          },
          "folderTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Название папки; пустая строка у анкеты в корне."
          },
          "systemAuthor": {
            "type": "boolean",
            "description": "Форма создана системой (предустановка HRM, creator_id = 0). Пустой creatorId без этого признака — автор удалён."
          },
          "norm": {
            "$ref": "#/components/schemas/SurveyNorm",
            "description": "Норма, приведённая к вопросам. Всегда объект: анкета без своей нормы получает умолчания."
          },
          "normDefaults": {
            "$ref": "#/components/schemas/SurveyNormDefaults"
          },
          "anonymousDefault": {
            "type": "boolean",
            "description": "Опросы анкеты создаются анонимными, если тело создания не называет свой признак; уже созданные опросы от него не зависят. Новая анкета — false, копия анкеты переносит признак. Готовая анкета «Пульс команды (eNPS)» засевается с true."
          }
        },
        "required": [
          "id",
          "revision",
          "state",
          "content",
          "surveyCount",
          "creatorId",
          "updatedAt",
          "createdAt",
          "folderId",
          "folderTitle",
          "systemAuthor",
          "norm",
          "normDefaults",
          "anonymousDefault"
        ]
      },
      "SurveyNorm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "scales": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyScaleNorm"
            },
            "maxItems": 100
          },
          "enpsQuestionKey": {
            "type": "string",
            "format": "uuid",
            "description": "Вопрос rating 0–10, который считается индексом eNPS. Вопрос с этим ключом не получает строки шкалы."
          },
          "enps": {
            "$ref": "#/components/schemas/SurveyENPSNorm"
          }
        },
        "required": [
          "enabled",
          "scales"
        ],
        "description": "Норма: пороги по шкалам и индексу. Объект заменяет норму целиком, поэтому enpsQuestionKey и enps — единственные необязательные поля. Сервер приводит норму к вопросам: строки шкал, которых нет, не сохраняются, новые шкалы получают умолчания. Присланный ключ без подходящего вопроса — 422 survey_invalid, details.fields с code=norm_enps_question; отметка eNPS, потерявшая вопрос при правке без поля norm, снимается вместе с порогами индекса. Присланная норма, равная действующей, правкой не считается."
      },
      "SurveyScaleNorm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "min": {
            "type": "integer"
          },
          "max": {
            "type": "integer"
          },
          "normFrom": {
            "type": "number",
            "description": "Средний от этого значения — «норма». Не больше одного знака после точки."
          },
          "criticalBelow": {
            "type": "number",
            "description": "Средний ниже этого значения — «критично», между порогами — «ниже нормы». Не больше одного знака после точки."
          },
          "redFlagTo": {
            "type": "integer",
            "nullable": true,
            "description": "Оценка до этого значения включительно — красный флаг; null — флагов нет. Поле обязательно: пропуск не снимает флаги молча."
          }
        },
        "required": [
          "min",
          "max",
          "normFrom",
          "criticalBelow",
          "redFlagTo"
        ],
        "description": "Строка нормы одной шкалы (min, max). Должно быть min ≤ criticalBelow ≤ normFrom ≤ max и min ≤ redFlagTo < max."
      },
      "SurveyENPSNorm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "normFrom": {
            "type": "integer",
            "minimum": -100,
            "maximum": 100
          },
          "criticalBelow": {
            "type": "integer",
            "minimum": -100,
            "maximum": 100
          }
        },
        "required": [
          "normFrom",
          "criticalBelow"
        ],
        "description": "Пороги индекса eNPS: criticalBelow ≤ normFrom."
      },
      "SurveyNormDefaults": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "scales": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyScaleNorm"
            }
          },
          "shares": {
            "$ref": "#/components/schemas/SurveyNormShares"
          },
          "enps": {
            "$ref": "#/components/schemas/SurveyENPSNorm"
          }
        },
        "required": [
          "scales",
          "shares",
          "enps"
        ],
        "description": "Таблица умолчаний: явные строки шкал, доли для прочих шкал и пороги индекса. По ней редактор показывает строку нормы у шкалы, добавленной до сохранения."
      },
      "SurveyNormShares": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "normFrom": {
            "type": "integer"
          },
          "criticalBelow": {
            "type": "integer"
          },
          "redFlagTo": {
            "type": "integer"
          }
        },
        "required": [
          "normFrom",
          "criticalBelow",
          "redFlagTo"
        ],
        "description": "Доли длины шкалы в тысячных. Порог прочей шкалы — min + доля × (max − min): средние округляются до десятых, половина от нуля; флаг — вниз до целого."
      },
      "SurveyFormRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "ready",
              "archived"
            ]
          },
          "surveyCount": {
            "type": "integer",
            "minimum": 0
          },
          "creatorId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID пользователя. Пустая строка, если исторический пользователь уже отсутствует."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "questionCount": {
            "type": "integer",
            "minimum": 0
          },
          "folderId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID папки. Пустая строка у анкеты в корне."
          },
          "folderTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Название папки; пустая строка у анкеты в корне."
          },
          "systemAuthor": {
            "type": "boolean",
            "description": "Форма создана системой (предустановка HRM, creator_id = 0). Пустой creatorId без этого признака — автор удалён."
          }
        },
        "required": [
          "id",
          "revision",
          "state",
          "surveyCount",
          "creatorId",
          "updatedAt",
          "title",
          "questionCount",
          "folderId",
          "folderTitle",
          "systemAuthor"
        ]
      },
      "SurveyFormPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "forms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFormRow"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 4096
          }
        },
        "required": [
          "forms",
          "nextCursor"
        ]
      },
      "SurveyFeedRefs": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "formId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceFormId": {
            "type": "string",
            "format": "uuid"
          },
          "folder": {
            "type": "string",
            "description": "Название папки, в которую перенесли анкету (form_moved); при переносе в корень поля нет.",
            "maxLength": 255
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "description": "Что изменила правка. form_updated: content.title, content.description, content.questions, content.goal, content.criteria, norm, anonymousDefault (признак анонимности опросов анкеты), state. survey_updated: settings.general (название, описание), settings.schedule (сроки и пояс), settings.audience (участники и признак анонимности), settings.controllers (контролирующие), settings.organizerResults (организатор среди контролирующих), settings.notifications, settings.analysisMode, content.goal, content.criteria, norm (норма опроса). Ранее settings.audience объединяло участников, контролирующих и доступ организатора; записи до группировки несут одно settings. События сигнала — действие сигнала или comment."
          },
          "answerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "surveyId": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "signalId": {
            "type": "string",
            "format": "uuid"
          },
          "assignee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Ответственный после события. У signal_assigned поля нет, если ответственного сняли."
          },
          "dueAt": {
            "type": "string",
            "format": "date-time"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "resolved",
              "not_needed",
              "unresolved"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "below_threshold"
            ],
            "description": "Какой снимок картины анонимного опроса записан (picture_ready): ready — картина готова; below_threshold — ответили меньше порога малой группы, и картина недоступна. У других событий поля нет."
          }
        },
        "required": [
          "fields"
        ]
      },
      "SurveyFeedEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "form_created",
              "form_updated",
              "form_copied",
              "form_archived",
              "form_moved",
              "survey_created",
              "survey_updated",
              "survey_copy",
              "scheduled",
              "unscheduled",
              "started",
              "completed",
              "start_failed",
              "answer_submitted",
              "commented",
              "analysis_published",
              "picture_ready",
              "signal_created",
              "signal_analysis_updated",
              "signal_reasons_updated",
              "signal_claimed",
              "signal_assigned",
              "signal_commented",
              "signal_due_changed",
              "signal_resolved",
              "signal_reopened"
            ],
            "description": "Вид события. Список видов растёт: клиент пропускает незнакомые."
          },
          "actorId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID пользователя. Пустая строка, если исторический пользователь уже отсутствует или автор без пользователя HRM (ответ новичка из кабинета кандидата)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "refs": {
            "$ref": "#/components/schemas/SurveyFeedRefs"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "actorId",
          "createdAt",
          "refs"
        ]
      },
      "SurveyFeedPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFeedEntry"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 4096
          }
        },
        "required": [
          "entries",
          "nextCursor"
        ]
      },
      "SurveyCopyForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "commandKey"
        ]
      },
      "SurveyArchiveForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "commandKey"
        ]
      },
      "SurveyFieldError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "code"
        ]
      },
      "SurveyError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "details": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "fields": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyFieldError"
                }
              },
              "assignee": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SurveyPerson"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "signalId": {
                "type": "string",
                "format": "uuid",
                "description": "survey_signal_exists: сигнал, уже заведённый по этой паре «опрос + сотрудник»."
              },
              "limit": {
                "type": "integer",
                "minimum": 1,
                "description": "pin_limit: предел закрепов карточки ленты опросов."
              }
            },
            "required": []
          }
        },
        "required": [
          "code",
          "message",
          "retryable"
        ]
      },
      "SurveyContentInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 10000
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionInput"
            },
            "maxItems": 100
          },
          "goal": {
            "type": "string",
            "maxLength": 10000
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCriterionInput"
            },
            "maxItems": 20
          }
        },
        "required": [],
        "description": "Незавершённый черновик может содержать пустые названия, инструкции и массивы. Пропущенные массивы нормализуются в []. Проверка ready атомарно требует название, цель, вопросы и заполненные выбранные критерии. Критерии не выбираются автоматически. До создания типизированных коллекций проверяются пределы: 100 вопросов, 100 вариантов вопроса, 20 критериев и 20 категорий критерия. Превышение — 422 survey_invalid, details.fields с code=too_many. Эта проверка действует и внутри SaveForm.content."
      },
      "SurveyQuestionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "short_text",
              "long_text",
              "single_choice",
              "multiple_choice",
              "yes_no",
              "number",
              "rating"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "help": {
            "type": "string",
            "maxLength": 10000
          },
          "block": {
            "type": "string",
            "maxLength": 10000
          },
          "required": {
            "type": "boolean"
          },
          "maxLength": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyOptionInput"
            },
            "maxItems": 100
          },
          "min": {
            "type": "number",
            "nullable": true
          },
          "max": {
            "type": "number",
            "nullable": true
          },
          "minLabel": {
            "type": "string",
            "maxLength": 255
          },
          "maxLabel": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "key",
          "kind"
        ],
        "description": "Единая форма семи видов вопроса. Неприменимые options — [], min/max — null, maxLength — 0. Готовая форма дополнительно требует заголовков, вариантов choice и целых границ rating. Изменение kind под прежним key запрещено: создайте новый UUID.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "short_text"
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOptionInput"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "long_text"
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOptionInput"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "single_choice"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "multiple_choice"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "yes_no"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOptionInput"
                },
                "maxItems": 0
              },
              "min": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              },
              "max": {
                "type": "number",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "number"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOptionInput"
                },
                "maxItems": 0
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "rating"
                ]
              },
              "maxLength": {
                "type": "integer",
                "enum": [
                  0
                ]
              },
              "options": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SurveyOptionInput"
                },
                "maxItems": 0
              },
              "min": {
                "type": "integer",
                "nullable": true
              },
              "max": {
                "type": "integer",
                "nullable": true
              }
            },
            "required": [
              "kind"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        }
      },
      "SurveyOptionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string",
            "maxLength": 255
          }
        },
        "required": [
          "key"
        ]
      },
      "SurveyCriterionInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "libraryKey": {
            "type": "string",
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "instruction": {
            "type": "string",
            "maxLength": 10000
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCategoryInput"
            },
            "maxItems": 20
          }
        },
        "required": [
          "key"
        ]
      },
      "SurveyCategoryInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "needsAction": {
            "type": "boolean"
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          }
        },
        "required": [
          "key",
          "importance"
        ]
      },
      "GameAwardSource": {
        "type": "string",
        "enum": [
          "manual",
          "api",
          "credit",
          "streak",
          "tier",
          "season",
          "hrm"
        ],
        "description": "Источник вручения: manual — из кабинета, api — ключом API, credit — награда задания, streak — веха серии, tier — уровень сезона, season — итог сезона, hrm — автоматическое вручение по событию HRM (правило определения источника hrm)."
      },
      "GameAwardStatus": {
        "type": "string",
        "enum": [
          "active",
          "revoked"
        ],
        "description": "active — ачивка у человека, revoked — вручение отозвано."
      },
      "GameAchievementFill": {
        "type": "object",
        "description": "Фон ачивки.",
        "required": [
          "from"
        ],
        "properties": {
          "from": {
            "type": "string",
            "description": "Токен палитры конструктора."
          },
          "to": {
            "type": "string",
            "description": "Второй токен — градиент; без него фон сплошной."
          }
        }
      },
      "GameAchievementAppearance": {
        "type": "object",
        "description": "Вид ачивки из конфигуратора: форма, заливка и значок из готовых наборов. Рамку задаёт редкость.",
        "required": [
          "v",
          "shape",
          "fill",
          "icon"
        ],
        "properties": {
          "v": {
            "type": "integer",
            "description": "Версия формата вида, сейчас 1."
          },
          "shape": {
            "type": "string",
            "description": "Форма из закрытого набора.",
            "enum": [
              "medal",
              "shield",
              "hexagon",
              "star",
              "chevron",
              "diamond",
              "ribbon"
            ]
          },
          "fill": {
            "$ref": "#/components/schemas/GameAchievementFill"
          },
          "icon": {
            "type": "string",
            "description": "Иконка каталога дизайн-системы из закрытого набора."
          },
          "ribbon": {
            "type": "string",
            "description": "Надпись на ленте до 24 символов; без неё ленты нет."
          }
        }
      },
      "GameAchievement": {
        "type": "object",
        "description": "Определение ачивки.",
        "required": [
          "id",
          "departmentId",
          "title",
          "description",
          "appearance",
          "rarity",
          "repeatable",
          "maxVisibility",
          "holders",
          "archivedAt",
          "setId",
          "origin",
          "builtinCode",
          "resultSource",
          "ruleCode",
          "conditionText",
          "companyExplanation",
          "enabled",
          "hideEarned",
          "sourceState",
          "sourceMessage"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id ачивки."
          },
          "departmentId": {
            "type": "integer",
            "description": "Отдел Б24 ачивки; null — ачивка компании.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "Название, до 60 символов."
          },
          "description": {
            "type": "string",
            "description": "Как получить, до 500 символов; видно и тем, у кого её нет."
          },
          "appearance": {
            "$ref": "#/components/schemas/GameAchievementAppearance"
          },
          "rarity": {
            "type": "string",
            "description": "Редкость: рамка и порядок на витрине.",
            "enum": [
              "common",
              "bronze",
              "silver",
              "gold",
              "elite"
            ]
          },
          "repeatable": {
            "type": "boolean",
            "description": "Можно получить ещё раз."
          },
          "maxVisibility": {
            "type": "string",
            "description": "Шире этой ступени вручение не показывают.",
            "enum": [
              "self_manager",
              "department",
              "parent",
              "company"
            ]
          },
          "holders": {
            "type": "integer",
            "description": "Сколько людей держат ачивку активным вручением."
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "В архиве с этого момента: больше не вручается."
          },
          "setId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Публичный id набора достижений (GET /api/v1/games/achievement-sets); null — вне набора."
          },
          "origin": {
            "type": "string",
            "enum": [
              "builtin",
              "custom"
            ],
            "description": "Происхождение определения: builtin — стандартная поставка портала, custom — заведено компанией. Не путать с источником вручения (source вручения)."
          },
          "builtinCode": {
            "type": "string",
            "nullable": true,
            "description": "Код стандартного определения; null у заведённых компанией."
          },
          "resultSource": {
            "type": "string",
            "enum": [
              "hrm",
              "manual",
              "external"
            ],
            "description": "Источник результата: hrm — автоматическое правило HRM (ruleCode), manual — вручение человеком, external — внешняя система. Выбирается при создании и потом не меняется."
          },
          "ruleCode": {
            "type": "string",
            "nullable": true,
            "description": "Код правила HRM (GET /api/v1/games/achievement-rules) у resultSource = hrm; null у manual и external. Выбирается при создании и потом не меняется."
          },
          "conditionText": {
            "type": "string",
            "readOnly": true,
            "description": "Условие получения — текст сервера на русском, показывается как есть; из ruleCode не выводится."
          },
          "companyExplanation": {
            "type": "string",
            "description": "Пояснение компании к условию, до 500 символов; пусто — без пояснения."
          },
          "enabled": {
            "type": "boolean",
            "readOnly": true,
            "description": "Достижение выдаётся новым получателям. Меняет только жизненный цикл, не правка."
          },
          "hideEarned": {
            "type": "boolean",
            "readOnly": true,
            "description": "Определение целиком скрыто из витрин сотрудников. Меняет только жизненный цикл, не правка."
          },
          "sourceState": {
            "type": "string",
            "enum": [
              "ready",
              "not_connected",
              "unavailable"
            ],
            "readOnly": true,
            "description": "Готовность источника результата: ready — путь зачёта работает, not_connected — ещё не подключён, unavailable — источник недоступен."
          },
          "sourceMessage": {
            "type": "string",
            "nullable": true,
            "readOnly": true,
            "description": "Пояснение сервера к sourceState на русском; null — пояснять нечего."
          }
        }
      },
      "GameAchievementsResponse": {
        "type": "object",
        "required": [
          "achievements",
          "nextCursor"
        ],
        "properties": {
          "achievements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAchievement"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameAward": {
        "type": "object",
        "description": "Вручение ачивки.",
        "required": [
          "id",
          "achievementId",
          "achievementTitle",
          "playerId",
          "b24UserId",
          "playerName",
          "source",
          "awardedBy",
          "comment",
          "externalId",
          "awardedOn",
          "visibility",
          "status",
          "revokedAt",
          "revokedBy",
          "revokeReason",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id вручения."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "description": "Ачивка."
          },
          "achievementTitle": {
            "type": "string",
            "description": "Название ачивки."
          },
          "playerId": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id получателя."
          },
          "b24UserId": {
            "type": "integer",
            "description": "Получатель — человек Б24.",
            "nullable": true
          },
          "playerName": {
            "type": "string",
            "description": "ФИО получателя по оргструктуре; пусто — человека в ней нет."
          },
          "source": {
            "$ref": "#/components/schemas/GameAwardSource"
          },
          "awardedBy": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Кто вручил — публичный id пользователя; у автовручения null."
          },
          "comment": {
            "type": "string",
            "description": "Комментарий вручения.",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "description": "Внешний ключ элемента вызова.",
            "nullable": true
          },
          "awardedOn": {
            "type": "string",
            "description": "День вручения в поясе игр.",
            "format": "date"
          },
          "visibility": {
            "type": "string",
            "description": "Ступень, до которой получатель сузил видимость; null — не сужал.",
            "enum": [
              "self_manager",
              "department",
              "parent",
              "company"
            ],
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/GameAwardStatus"
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда отозвано."
          },
          "revokedBy": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Кто отозвал — публичный id пользователя."
          },
          "revokeReason": {
            "type": "string",
            "description": "Причина отзыва.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда вручение записано."
          }
        }
      },
      "GameAwardsResult": {
        "type": "object",
        "required": [
          "awards"
        ],
        "properties": {
          "awards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAward"
            },
            "description": "Вручения в порядке получателей вызова."
          }
        }
      },
      "GameAwardsPage": {
        "type": "object",
        "required": [
          "awards",
          "nextCursor"
        ],
        "properties": {
          "awards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAward"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameDepartment": {
        "type": "object",
        "description": "Отдел оргструктуры, на который смотрящий заводит сценарии.",
        "required": [
          "id",
          "parentId",
          "name",
          "path",
          "mine"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Отдел Б24: им называют корень сценария (departmentId)."
          },
          "parentId": {
            "type": "integer",
            "description": "Родительский отдел; null — верх дерева.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Название по оргструктуре."
          },
          "path": {
            "type": "string",
            "description": "Путь от верха дерева: номера отделов через «/»."
          },
          "mine": {
            "type": "boolean",
            "description": "Смотрящий в отделе состоит или им руководит."
          }
        }
      },
      "GameDepartmentsResponse": {
        "type": "object",
        "required": [
          "departments",
          "nextCursor"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameDepartment"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "id отдела последнего отданного; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameAwardRecipient": {
        "type": "object",
        "description": "Получатель вызова: ровно одно из b24UserId и playerId.",
        "required": [],
        "properties": {
          "b24UserId": {
            "type": "integer",
            "description": "Человек Б24."
          },
          "playerId": {
            "type": "string",
            "description": "Публичный id игрока.",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "description": "В этой поставке отклоняется кодом player_unknown.",
            "format": "uuid"
          },
          "externalId": {
            "type": "string",
            "description": "Внешний ключ элемента, до 128 символов: по нему повтор находит вручение.",
            "maxLength": 128
          }
        }
      },
      "GameAwardRequest": {
        "type": "object",
        "required": [
          "recipients"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "description": "До 500 символов."
          },
          "awardedOn": {
            "type": "string",
            "description": "День вручения; по умолчанию сегодня в поясе игр.",
            "format": "date"
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAwardRecipient"
            },
            "minItems": 1,
            "maxItems": 50
          }
        }
      },
      "GameScenarioStatus": {
        "type": "string",
        "enum": [
          "draft",
          "scheduled",
          "active",
          "closing",
          "finished",
          "stopped"
        ],
        "description": "Статус сценария: draft — настраивается; scheduled — сезон ждёт начала; active — идёт; closing — окно после конца сезона; finished — завершён; stopped — остановлен с причиной. У слоя — только draft, active, stopped."
      },
      "GameScenarioType": {
        "type": "string",
        "enum": [
          "season",
          "challenges"
        ],
        "description": "season — «Сезон отдела», challenges — слой челленджей."
      },
      "GameCreditStatus": {
        "type": "string",
        "enum": [
          "pending",
          "confirmed",
          "rejected",
          "reversed"
        ],
        "description": "pending — заявка ждёт решения; confirmed — подтверждён, очки начислены; rejected — заявка отклонена; reversed — сторнирован."
      },
      "GameScenarioSummary": {
        "type": "object",
        "description": "Сценарий в списке: настройки и очки отдела.",
        "required": [
          "id",
          "type",
          "departmentId",
          "departmentName",
          "departmentMissing",
          "withSubdepartments",
          "title",
          "description",
          "status",
          "startsOn",
          "endsOn",
          "weeks",
          "teamVisibility",
          "personalVisibility",
          "leaderboard",
          "seasonAchievementId",
          "streakFreezesPerMonth",
          "templateId",
          "stopReason",
          "points",
          "activatedAt",
          "finishedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id сценария."
          },
          "type": {
            "$ref": "#/components/schemas/GameScenarioType"
          },
          "departmentId": {
            "type": "integer",
            "description": "Корневой отдел Б24."
          },
          "departmentName": {
            "type": "string",
            "description": "Название корневого отдела по оргструктуре; пусто — отдела в ней нет."
          },
          "departmentMissing": {
            "type": "boolean",
            "description": "Корневого отдела в оргструктуре нет или он пропал из неё."
          },
          "withSubdepartments": {
            "type": "boolean",
            "description": "Охват включает подотделы корня."
          },
          "title": {
            "type": "string",
            "description": "Название."
          },
          "description": {
            "type": "string",
            "description": "Описание."
          },
          "status": {
            "$ref": "#/components/schemas/GameScenarioStatus"
          },
          "startsOn": {
            "type": "string",
            "description": "Начало сезона; у слоя null.",
            "format": "date",
            "nullable": true
          },
          "endsOn": {
            "type": "string",
            "description": "Последний день сезона: startsOn + 7·weeks − 1; у слоя null.",
            "format": "date",
            "nullable": true
          },
          "weeks": {
            "type": "integer",
            "description": "Длительность сезона в неделях; у слоя null.",
            "nullable": true
          },
          "teamVisibility": {
            "type": "string",
            "description": "Кому видны очки отдела.",
            "enum": [
              "department",
              "parent",
              "company"
            ]
          },
          "personalVisibility": {
            "type": "string",
            "description": "Кому видны личные очки.",
            "enum": [
              "self_manager",
              "department",
              "parent",
              "company"
            ]
          },
          "leaderboard": {
            "type": "boolean",
            "description": "Рейтинг игроков включён."
          },
          "seasonAchievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка сезона: вручается участникам после завершения."
          },
          "streakFreezesPerMonth": {
            "type": "integer",
            "description": "Заморозок серии в месяц; только у слоя.",
            "nullable": true
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Шаблон каталога HR, из которого собран сезон."
          },
          "stopReason": {
            "type": "string",
            "description": "Причина остановки.",
            "nullable": true
          },
          "points": {
            "type": "integer",
            "description": "Очки отдела в сценарии."
          },
          "activatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда сценарий перешёл в active."
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда сезон завершился."
          }
        }
      },
      "GameScenario": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameScenarioSummary"
          },
          {
            "type": "object",
            "required": [
              "tiers",
              "contracts",
              "milestones"
            ],
            "properties": {
              "tiers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GameTier"
                },
                "description": "Уровни сезона по порядку."
              },
              "contracts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GameContract"
                },
                "description": "Задания по порядку, включая архивные."
              },
              "milestones": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GameMilestone"
                },
                "description": "Вехи серий слоя."
              }
            }
          }
        ],
        "description": "Карточка сценария: настройки, уровни, задания и вехи."
      },
      "GameScenariosResponse": {
        "type": "object",
        "required": [
          "scenarios",
          "nextCursor"
        ],
        "properties": {
          "scenarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameScenarioSummary"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameTier": {
        "type": "object",
        "required": [
          "ordinal",
          "thresholdPoints",
          "achievementId",
          "rewardText",
          "reached"
        ],
        "properties": {
          "ordinal": {
            "type": "integer",
            "description": "Порядковый номер уровня с 1."
          },
          "thresholdPoints": {
            "type": "integer",
            "description": "Порог очков отдела."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка уровня: вручается участникам при достижении."
          },
          "rewardText": {
            "type": "string",
            "description": "Реальная награда словами автора.",
            "nullable": true
          },
          "reached": {
            "type": "boolean",
            "description": "Уровень достигнут: у него есть награда, и он больше не меняется."
          }
        }
      },
      "GameContract": {
        "type": "object",
        "required": [
          "code",
          "kind",
          "title",
          "description",
          "points",
          "repeat",
          "maxCount",
          "weekNo",
          "cadence",
          "activeDays",
          "needsConfirmation",
          "rewardAchievementId",
          "templateId",
          "position",
          "archivedAt"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Код задания: по нему обращаются интеграции."
          },
          "kind": {
            "type": "string",
            "description": "contract — контракт сезона, challenge — челлендж слоя.",
            "enum": [
              "contract",
              "challenge"
            ]
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "points": {
            "type": "integer",
            "description": "Очки за зачёт, 1–10000."
          },
          "repeat": {
            "type": "string",
            "description": "Повтор контракта; у челленджа null.",
            "enum": [
              "once",
              "weekly",
              "limited"
            ],
            "nullable": true
          },
          "maxCount": {
            "type": "integer",
            "description": "Предел зачётов у repeat = limited.",
            "nullable": true
          },
          "weekNo": {
            "type": "integer",
            "description": "Неделя сезона, в которую действует контракт; null — весь сезон.",
            "nullable": true
          },
          "cadence": {
            "type": "string",
            "description": "Ритм челленджа; у контракта null.",
            "enum": [
              "daily",
              "weekly"
            ],
            "nullable": true
          },
          "activeDays": {
            "type": "integer",
            "description": "Дни дневного челленджа маской: бит 0 — понедельник … бит 6 — воскресенье.",
            "nullable": true
          },
          "needsConfirmation": {
            "type": "boolean",
            "description": "Заявка игрока ждёт подтверждения."
          },
          "rewardAchievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка за подтверждённый зачёт."
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Задание библиотеки HR, из которого скопировано."
          },
          "position": {
            "type": "integer",
            "description": "Порядок в сценарии."
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "В архиве с этого момента: новых зачётов не принимает."
          }
        }
      },
      "GameMilestone": {
        "type": "object",
        "required": [
          "cadence",
          "length",
          "achievementId"
        ],
        "properties": {
          "cadence": {
            "type": "string",
            "description": "Ритм серии.",
            "enum": [
              "daily",
              "weekly"
            ]
          },
          "length": {
            "type": "integer",
            "description": "Длина серии, 2–1000."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "description": "Ачивка за веху."
          }
        }
      },
      "GameCoveragePerson": {
        "type": "object",
        "required": [
          "b24UserId",
          "lastName",
          "firstName"
        ],
        "properties": {
          "b24UserId": {
            "type": "integer",
            "description": "Человек Б24: им называют игрока в теле зачёта."
          },
          "lastName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          }
        }
      },
      "GameCoveragePeople": {
        "type": "object",
        "required": [
          "people",
          "nextCursor"
        ],
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameCoveragePerson"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "b24UserId последнего отданного; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameCredit": {
        "type": "object",
        "description": "Запись журнала зачётов.",
        "required": [
          "id",
          "scenarioId",
          "contractCode",
          "contractTitle",
          "playerId",
          "b24UserId",
          "playerName",
          "points",
          "occurredOn",
          "source",
          "status",
          "externalId",
          "comment",
          "reason",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id записи."
          },
          "scenarioId": {
            "type": "string",
            "format": "uuid",
            "description": "Сценарий записи."
          },
          "contractCode": {
            "type": "string"
          },
          "contractTitle": {
            "type": "string"
          },
          "playerId": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id игрока."
          },
          "b24UserId": {
            "type": "integer",
            "description": "Человек Б24 игрока.",
            "nullable": true
          },
          "playerName": {
            "type": "string",
            "description": "ФИО игрока по оргструктуре; пусто — человека в ней нет."
          },
          "points": {
            "type": "integer",
            "description": "Очки, скопированные из задания на момент зачёта."
          },
          "occurredOn": {
            "type": "string",
            "description": "День выполнения в поясе игр.",
            "format": "date"
          },
          "source": {
            "type": "string",
            "description": "claim — заявка игрока, manual — отметка в кабинете, api — ключ API.",
            "enum": [
              "claim",
              "manual",
              "api"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/GameCreditStatus"
          },
          "externalId": {
            "type": "string",
            "description": "Внешний ключ элемента вызова.",
            "nullable": true
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "description": "Причина отклонения или сторно.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда запись создана."
          }
        }
      },
      "GameCreditsResult": {
        "type": "object",
        "required": [
          "credits"
        ],
        "properties": {
          "credits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameCredit"
            },
            "description": "Записи в порядке элементов вызова."
          }
        }
      },
      "GameCreditsPage": {
        "type": "object",
        "required": [
          "credits",
          "nextCursor"
        ],
        "properties": {
          "credits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameCredit"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameApproval": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameCredit"
          },
          {
            "type": "object",
            "required": [
              "scenarioTitle",
              "scenarioType"
            ],
            "properties": {
              "scenarioTitle": {
                "type": "string"
              },
              "scenarioType": {
                "$ref": "#/components/schemas/GameScenarioType"
              }
            }
          }
        ],
        "description": "Ждущая заявка: запись журнала с названием и типом сценария."
      },
      "GameApprovalsResponse": {
        "type": "object",
        "required": [
          "approvals",
          "nextCursor"
        ],
        "properties": {
          "approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameApproval"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; null — страница последняя.",
            "nullable": true
          }
        }
      },
      "GameReward": {
        "type": "object",
        "required": [
          "id",
          "scenarioId",
          "ordinal",
          "thresholdPoints",
          "rewardText",
          "achievementId",
          "reachedAt",
          "status",
          "issuedAt",
          "issuedBy",
          "issueNote"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id награды."
          },
          "scenarioId": {
            "type": "string",
            "format": "uuid",
            "description": "Сценарий награды."
          },
          "ordinal": {
            "type": "integer",
            "description": "Уровень."
          },
          "thresholdPoints": {
            "type": "integer",
            "description": "Порог уровня."
          },
          "rewardText": {
            "type": "string",
            "description": "Реальная награда; без неё выдачу не отмечают.",
            "nullable": true
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка уровня."
          },
          "reachedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда уровень достигнут."
          },
          "status": {
            "type": "string",
            "description": "available — достигнут, issued — выдача отмечена.",
            "enum": [
              "available",
              "issued"
            ]
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда отмечена выдача."
          },
          "issuedBy": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Кто отметил выдачу — публичный id пользователя."
          },
          "issueNote": {
            "type": "string",
            "description": "Отметка о выдаче.",
            "nullable": true
          }
        }
      },
      "GameRewardsResponse": {
        "type": "object",
        "required": [
          "rewards"
        ],
        "properties": {
          "rewards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameReward"
            }
          }
        }
      },
      "GameTierWrite": {
        "type": "object",
        "required": [
          "thresholdPoints"
        ],
        "properties": {
          "thresholdPoints": {
            "type": "integer",
            "description": "Порог; пороги строго возрастают."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка уровня."
          },
          "rewardText": {
            "type": "string",
            "description": "Реальная награда, до 500 символов.",
            "nullable": true
          }
        }
      },
      "GameContractWrite": {
        "type": "object",
        "description": "Задание в теле сценария или добавляемое отдельно.",
        "required": [
          "code",
          "title",
          "points"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Код [a-z0-9_-]{1,64}, уникален в сценарии."
          },
          "kind": {
            "type": "string",
            "description": "Вид; по умолчанию — по типу сценария.",
            "enum": [
              "contract",
              "challenge"
            ]
          },
          "title": {
            "type": "string",
            "description": "До 120 символов."
          },
          "description": {
            "type": "string"
          },
          "points": {
            "type": "integer",
            "description": "1–10000."
          },
          "repeat": {
            "type": "string",
            "description": "Повтор контракта.",
            "enum": [
              "once",
              "weekly",
              "limited"
            ]
          },
          "maxCount": {
            "type": "integer",
            "description": "Предел у limited, 1–100."
          },
          "weekNo": {
            "type": "integer",
            "description": "Неделя сезона; не вместе с weekly."
          },
          "cadence": {
            "type": "string",
            "description": "Ритм челленджа.",
            "enum": [
              "daily",
              "weekly"
            ]
          },
          "activeDays": {
            "type": "integer",
            "description": "Дни дневного челленджа маской; по умолчанию пн–пт (31)."
          },
          "needsConfirmation": {
            "type": "boolean",
            "description": "Заявка игрока ждёт подтверждения; по умолчанию true."
          },
          "rewardAchievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка за подтверждённый зачёт."
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Задание библиотеки HR; при строгом режиме обязательно."
          }
        }
      },
      "GameMilestoneWrite": {
        "type": "object",
        "required": [
          "cadence",
          "length",
          "achievementId"
        ],
        "properties": {
          "cadence": {
            "type": "string",
            "enum": [
              "daily",
              "weekly"
            ]
          },
          "length": {
            "type": "integer",
            "description": "2–1000."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "description": "Ачивка за веху."
          }
        }
      },
      "GameScenarioPatchRequest": {
        "type": "object",
        "description": "Правка сценария: поле без ключа не меняется.",
        "required": [],
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "startsOn": {
            "type": "string",
            "description": "Только у черновика сезона.",
            "format": "date"
          },
          "weeks": {
            "type": "integer",
            "description": "У идущего сезона — только больше прежнего."
          },
          "teamVisibility": {
            "type": "string",
            "enum": [
              "department",
              "parent",
              "company"
            ]
          },
          "personalVisibility": {
            "type": "string",
            "enum": [
              "self_manager",
              "department",
              "parent",
              "company"
            ]
          },
          "leaderboard": {
            "type": "boolean"
          },
          "seasonAchievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "null снимает ачивку сезона."
          },
          "streakFreezesPerMonth": {
            "type": "integer"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameTierWrite"
            },
            "maxItems": 30,
            "description": "Набор уровней целиком; достигнутые — на своих местах без изменений."
          },
          "milestones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameMilestoneWrite"
            },
            "description": "Набор вех целиком."
          }
        }
      },
      "GameContractPatchRequest": {
        "type": "object",
        "description": "Правка задания: поле без ключа не меняется.",
        "required": [],
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "points": {
            "type": "integer"
          },
          "needsConfirmation": {
            "type": "boolean"
          },
          "rewardAchievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "null снимает ачивку-награду."
          },
          "activeDays": {
            "type": "integer",
            "description": "Только у дневного челленджа."
          },
          "archived": {
            "type": "boolean",
            "description": "true — в архив, false — вернуть."
          }
        }
      },
      "GameReasonRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "description": "Причина, до 500 символов."
          }
        }
      },
      "GameRewardIssueRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "note": {
            "type": "string",
            "description": "Отметка о выдаче, до 500 символов."
          }
        }
      },
      "GameCreditPlayer": {
        "type": "object",
        "description": "Элемент вызова: ровно одно из b24UserId и playerId.",
        "required": [],
        "properties": {
          "b24UserId": {
            "type": "integer",
            "description": "Человек Б24."
          },
          "playerId": {
            "type": "string",
            "description": "Публичный id игрока.",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "description": "В этой поставке отклоняется кодом player_unknown.",
            "format": "uuid"
          },
          "externalId": {
            "type": "string",
            "description": "Внешний ключ элемента, до 128 символов: по нему повтор находит запись.",
            "maxLength": 128
          }
        }
      },
      "GameCreditRequest": {
        "type": "object",
        "required": [
          "contractCode",
          "players"
        ],
        "properties": {
          "contractCode": {
            "type": "string",
            "description": "Код задания."
          },
          "occurredOn": {
            "type": "string",
            "description": "День выполнения; по умолчанию сегодня в поясе игр.",
            "format": "date"
          },
          "comment": {
            "type": "string",
            "description": "До 500 символов."
          },
          "players": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameCreditPlayer"
            },
            "minItems": 1,
            "maxItems": 50
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "description": "Пакет вызовов.",
        "required": [
          "calls"
        ],
        "properties": {
          "halt": {
            "type": "boolean",
            "description": "Остановиться на первом вызове с отказом: остальные уйдут в skipped. Не ставьте на пакет из вызовов разных строк: отказ одной строки остановит остальные."
          },
          "calls": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BatchCall"
            },
            "description": "Вызовы по порядку исполнения. Предел пакета по умолчанию 50, для тарифа или портала платформа может поднять его до 100 или опустить; по ключу — ещё и не больше k (по умолчанию 10) на единицу полного ведра ключа. Сверх предела — 400 validation_error, предел в error.details.limit."
          }
        }
      },
      "BatchCall": {
        "type": "object",
        "description": "Один вызов пакета.",
        "required": [
          "id",
          "method",
          "path"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "description": "Имя вызова в пакете, уникальное в нём: ключ в results и errors и цель ссылок {{id.поле}}. Удобно нести в нём координату строки источника."
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PATCH",
              "PUT",
              "DELETE"
            ]
          },
          "path": {
            "type": "string",
            "pattern": "^/api/v1/",
            "description": "Путь операции из контракта с подставленными параметрами и query, например /api/v1/vacancies/{{row2-vacancy.id}}. Ссылка в пути — только целым сегментом; в query ссылок нет."
          },
          "body": {
            "description": "Тело вызова — то же, что у операции, вызванной одиночно. У GET тела нет. Строка, целиком равная ссылке {{id.поле}}, заменяется значением со своим типом."
          }
        }
      },
      "BatchResponse": {
        "type": "object",
        "required": [
          "results",
          "errors",
          "skipped",
          "summary"
        ],
        "properties": {
          "results": {
            "type": "object",
            "additionalProperties": {
              "description": "data успешного вызова; у 2xx без тела — null."
            },
            "description": "id вызова → data его успешного ответа."
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/BatchError"
            },
            "description": "id вызова → его отказ."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "id не исполненных вызовов по порядку: после halt, срока пакета, перезапуска сервиса или исчерпания предела ответа. Их отправляют следующим пакетом."
          },
          "summary": {
            "$ref": "#/components/schemas/BatchSummary"
          }
        }
      },
      "BatchError": {
        "type": "object",
        "description": "Отказ одного вызова: отказ самой операции как есть или отказ пакета с кодом из x-batch-call-codes операции appBatch.",
        "required": [
          "status",
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "description": "HTTP-статус, которым ответила бы операция, вызванная одиночно, или статус отказа пакета."
          },
          "code": {
            "type": "string",
            "description": "Машиночитаемая причина: код операции или batch_* пакета."
          },
          "message": {
            "type": "string",
            "description": "Заранее написанный текст для человека."
          },
          "retryable": {
            "type": "boolean",
            "description": "Пройдёт ли тот же вызов при повторе без изменений. У отказов пакета — всегда false."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Уточнение операции, как у одиночного отказа."
          }
        }
      },
      "BatchSummary": {
        "type": "object",
        "required": [
          "total",
          "succeeded",
          "failed",
          "skipped",
          "stopped"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "description": "Вызовов в пакете."
          },
          "succeeded": {
            "type": "integer",
            "description": "Вызовов в results."
          },
          "failed": {
            "type": "integer",
            "description": "Вызовов в errors."
          },
          "skipped": {
            "type": "integer",
            "description": "Вызовов в skipped."
          },
          "stopped": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "halt",
                  "deadline",
                  "shutdown",
                  "response_limit"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему часть вызовов не исполнена: halt — отказ при halt: true; deadline — истёк срок пакета; shutdown — сервис перезапускался; response_limit — исчерпан общий предел ответа пакета в 4 МиБ. null — исполнены все."
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Отказ. Внутренних подробностей здесь нет: текст ошибки базы — это подсказка о схеме, и в ответе ей не место.",
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Машиночитаемая причина. Различает исходы, у которых совпал HTTP-код."
          },
          "message": {
            "type": "string",
            "description": "Заранее написанный текст для человека."
          },
          "retryable": {
            "type": "boolean",
            "description": "Пройдёт ли тот же запрос при повторе без изменений. Поле обязательное: клиент, отличающий false от «не прислали», начинает угадывать по HTTP-коду."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Машиночитаемое уточнение: имя поля формы, лимит, срок. Свободного текста здесь не бывает, для человека есть message."
          }
        }
      },
      "MeUser": {
        "type": "object",
        "required": [
          "id",
          "lastName",
          "firstName",
          "middleName",
          "avatarUrl",
          "timeZone",
          "timeZoneSource"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отчество; null у иностранцев."
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес фото профиля: путь ручки этого сервиса с версией (своё загруженное фото), абсолютный https (фото из сети) либо null. Путь /api/v1/…/avatar открывается только из кабинета (cookieOnly): по ключу API он отвечает 403."
          },
          "timeZone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IANA-пояс человека; null — не задан, бот считает по Europe/Moscow."
          },
          "timeZoneSource": {
            "type": "string",
            "enum": [
              "auto",
              "manual"
            ],
            "description": "Откуда пояс: auto — определил браузер, manual — выбран в профиле."
          }
        }
      },
      "MePortal": {
        "type": "object",
        "required": [
          "id",
          "domain",
          "currency"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "Валюта кабинета, ISO 4217. Свойство ПОРТАЛА, поэтому едет вместе с его описанием и забирается один раз за сессию. Значение даёт цепочка «настройка портала → настройка платформы → код»; настроек кабинета ещё нет, поэтому работает последнее звено."
          }
        }
      },
      "MeResponse": {
        "type": "object",
        "required": [
          "user",
          "portal",
          "roles",
          "grants",
          "platformAdmin",
          "workItemsScope",
          "cabinetMode",
          "features"
        ],
        "properties": {
          "user": {
            "$ref": "#/components/schemas/MeUser"
          },
          "portal": {
            "$ref": "#/components/schemas/MePortal"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platformAdmin": {
            "type": "boolean",
            "description": "Признак сотрудника платформы — того, кто обслуживает сам сервис, а не портал. Прав в портале не даёт и не отнимает: их перечисляет roles. Под ключом API всегда false — роль читается по учётной записи входа, которой у ключа нет."
          },
          "grants": {
            "type": "object",
            "description": "Действующие уровни доступа: сущность → операция → код уровня (none, own, dept, all). По ним кабинет решает состав меню и видимость действий; сервер проверяет то же самое сам, и одно другого не заменяет.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "enum": [
                  "none",
                  "own",
                  "dept",
                  "all"
                ]
              }
            }
          },
          "workItemsScope": {
            "type": "string",
            "description": "Непрозрачный отпечаток области ленты «Мои задачи»: действующих прав, отделов и личности смотрящего. Кабинет передаёт его параметром scope ленты; меняется, когда меняются права или личность. Прав не даёт и не раскрывает."
          },
          "cabinetMode": {
            "type": "string",
            "enum": [
              "full",
              "simplified"
            ],
            "description": "Текущий режим после локального восстановления подтверждённого назначения найма. Всегда корневое поле; ошибка восстановления возвращает retryable 500, а не успешный full. Старый API может не иметь этого поля."
          },
          "features": {
            "$ref": "#/components/schemas/MeFeatures"
          }
        }
      },
      "Vacancy": {
        "type": "object",
        "description": "Вакансия. ОДНА форма на список и на карточку: ни одно поле не требует лишнего соединения, а две формы пришлось бы держать в согласии руками. Условия заявки (legalEntity, employmentType, marketReview, salaryComment, languages, location, timezone, workSchedule, customerWishes, files, observers) и признак termsUnreadable несёт только ответ об одной вакансии или заявке: карточка, ответы заведения, правки и перевода этапа. Строки списков их не несут; незаданное поле и пустой набор приходят без ключа.",
        "required": [
          "id",
          "position",
          "headcount",
          "openReason",
          "desiredStartDate",
          "deadline",
          "salaryMin",
          "salaryMax",
          "currency",
          "justification",
          "department",
          "interviewer",
          "stage",
          "closeReason",
          "allowedStages",
          "createdAt",
          "activeApplications",
          "recruiter",
          "company",
          "number",
          "publishedAt",
          "author",
          "customer",
          "completedAt",
          "archivedAt",
          "request",
          "salaryHidden",
          "salaryMasked",
          "departmentName",
          "departmentMissing",
          "scenario"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id вакансии. Автоинкремент наружу не уходит никогда."
          },
          "position": {
            "type": "string",
            "description": "Название должности, а НЕ идентификатор: нормальная форма названия уникальна в портале, поэтому между названием и строкой справочника биекция."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "description": "Сколько человек нужно нанять."
          },
          "openReason": {
            "type": "string"
          },
          "desiredStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "С желаемой датой выхода не сверяется: закрыть надо до выхода, но обратный порядок тоже встречается, когда ищут на уже освободившееся место."
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Десятичное СТРОКОЙ, а не числом: два знака после запятой при четырнадцати значащих в double помещаются не всегда, а JSON-число многие разборщики читают именно как double. Разбирайте десятичным типом; валюту называет соседнее поле currency. null — не задана или скрыта от смотрящего (salaryMasked)."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки, десятичное строкой. null — не задана или скрыта от смотрящего (salaryMasked)."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Снимок скрытости вилки: вакансия заведена по шаблону с вилкой в режиме hidden. Приходит всегда, false — у открытой. При true автору вакансии ниже правки вакансий на уровне all salaryMin и salaryMax приходят null в каждом ответе с вакансией — /api/v1/vacancies и /api/v1/requests. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. Остальным, кому вакансия видна, вилка видна, и признак приходит им тоже."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Вилка скрыта ОТ ЭТОГО смотрящего: salaryHidden = true, смотрящий — автор вакансии, правка вакансий ниже all. Приходит всегда. Только этот признак отличает скрытую вилку от незаданной: вилка hidden бывает и без границ, и null в salaryMin и salaryMax сам по себе ничего не говорит."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "ISO 4217. Заполняет сервер: справочника валют ещё нет, значение даёт цепочка «настройка портала → настройка платформы → код»."
          },
          "justification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Обоснование для кадрового департамента."
          },
          "department": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер отдела в структуре компании Б24. У заявки по шаблону — отдел автора из аудитории шаблона; null — отдел не задан."
          },
          "departmentName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название отдела из снимка Б24. null — отдела нет или его строки в снимке нет (тогда показывается номер из department)."
          },
          "departmentMissing": {
            "type": "boolean",
            "description": "Отдел помечен пропавшим из Б24 (missing_since); название при этом остаётся. false и при отсутствии строки в снимке."
          },
          "interviewer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто проводит профессиональное интервью. Человек НАШЕГО сервиса, а не пользователь Б24: строка user заводится при входе в сервис."
          },
          "stage": {
            "$ref": "#/components/schemas/VacancyStage"
          },
          "closeReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заполнена ровно тогда, когда stage = completed, и пуста на любом другом этапе: перевод с completed причину стирает, поэтому переоткрытая вакансия её теряет."
          },
          "allowedStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyStage"
            },
            "description": "Куда эту вакансию можно перевести прямо сейчас. Правило переходов повторять у себя не нужно: оно приходит готовым списком, и об ужесточении правила вызывающий узнаёт отсюда же. У архивной строки (archivedAt не null) список пуст: до возврата из архива её не переводят."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "activeApplications": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько у вакансии активных откликов — на всех этапах, кроме «Отказ» (rejected) и «Выход на работу» (hired). Число сужено уровнем вызывающего к откликам — правом application · view из grants ответа GET /api/v1/me: при «только своих» считаются отклики, где он ответственный или автор. null — уровень к откликам не позволяет их видеть, и число не сообщается вовсе; 0 — в пределах уровня доступа вызывающего активных откликов нет. Приходит одинаково в списке, в карточке и в ответах на создание, правку и перевод."
          },
          "recruiter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто ведёт подбор. null — рекрутера ещё не назначили: у согласованной заявки это её законное состояние, назначает его кадровик."
          },
          "company": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VacancyCompany"
              },
              {
                "type": "null"
              }
            ],
            "description": "Профиль компании ЭТОЙ вакансии: адрес, название и признак архива. null — своего профиля не выбрано, и соискатель видит профиль портала по умолчанию."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер вакансии в пределах портала. Нумерация у каждого портала своя: сквозной счётчик протекал бы наружу чужой темп заведения вакансий. null бывает только у вакансий, заведённых до появления номера."
          },
          "publishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Дата первого подтверждённого размещения. Исторические значения, записанные прежними версиями при переходе этапа, сохраняются. Перемещение этапа, снятие и повторное размещение её не переписывают. null — подтверждённого размещения ещё не было."
          },
          "author": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              }
            ],
            "description": "Кто завёл заявку. Видит его каждый, кто видит строку."
          },
          "customer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              }
            ],
            "description": "Заказчик — тот, кто примет кандидата в свой отдел: решает по кандидатам после собеседования, первым приглашается в звонок, вакансия считается его. Заполнен всегда: пока заказчика не назвали, это автор заявки. Вилку, скрытую шаблоном, заказчик не видит, как и автор."
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент ПОСЛЕДНЕГО перехода в completed; null у незавершённой. Переоткрытие вакансии его стирает. От него карточка считает «в работе N дней»."
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент, когда строку убрали в архив (POST /api/v1/vacancies/{id}/archive); null — строка не в архиве. Архив — признак, а не этап: stage архивной строки тот, на котором она туда ушла, и возврат продолжает работу с него. По этому полю архивную строку отличают в списках."
          },
          "request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VacancyRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сводка заявки — только на этапах draft, approval и rejected: когда отправлена, кого ждёт, кто и почему отклонил. У согласованной вакансии null. Приходит в списке, в карточке и в ответах на создание, правку и перевод."
          },
          "scenario": {
            "$ref": "#/components/schemas/VacancyScenario"
          },
          "hired": {
            "type": "integer",
            "minimum": 0,
            "description": "Число реально нанятых по вакансии. Присутствует только в актуальных ответах списка вакансий; отсутствие означает, что источник не предоставил число."
          },
          "legalEntity": {
            "$ref": "#/components/schemas/TermsLegalEntity"
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode. Код вне словаря (словарь сузился) приходит как хранится — покажите его как есть. Нет ключа — не задан."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. В ответе об одной вакансии или заявке приходит всегда, false тоже; в строках списков ключа нет."
          },
          "salaryComment": {
            "type": "string",
            "maxLength": 10000,
            "description": "Комментарий про деньги. Скрыт вместе с вилкой тем же правилом: у вакансии со скрытой вилкой её автору и заказчику без правки вакансий на уровне all ключа нет — как salaryMin и salaryMax приходят null. Скрытость берётся из того же чтения, что комментарий. Нет ключа и при пустом комментарии, и при termsUnreadable = true."
          },
          "languages": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LanguageCode"
                },
                {
                  "type": "string"
                }
              ]
            },
            "description": "Языки: коды словаря LanguageCode, без порядка. Нет ключа — языки не заданы."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "Локация: код словаря LocationCode или прежний код вне словаря — как хранится. Нет ключа — не задана."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA. Пояс, выпавший из tzdata, приходит прежним. Нет ключа — не задан."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "График: код словаря WorkScheduleCode или прежний код вне словаря — как хранится. Нет ключа — не задан."
          },
          "customerWishes": {
            "type": "string",
            "maxLength": 10000,
            "description": "Пожелания заказчика. Нет ключа — не заданы или termsUnreadable = true."
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsFile"
            },
            "description": "Файлы условий. Ключу API — без files[].id: файлы прикладывает и скачивает только кабинет. Нет ключа — файлов нет."
          },
          "observers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsObserver"
            },
            "description": "Наблюдатели — сотрудники Битрикс24. Ключу API — только observers[].id: снимок людей Битрикс24 ключу закрыт. Нет ключа — наблюдателей нет."
          },
          "termsUnreadable": {
            "type": "boolean",
            "description": "true — тексты условий заявки (salaryComment, customerWishes) лежат шифротекстом, который сервер не открыл: их ключей нет, правка их не трогает, а присланные тексты не пишутся — прочие поля правки пишутся. Нет ключа — тексты открыты."
          },
          "callPlanId": {
            "type": "string",
            "format": "uuid",
            "description": "Выбранный общий план; у ранее созданной вакансии поле отсутствует до явного выбора."
          },
          "callPlanRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "description": "Нужно ли согласовывать оффер. Снимок заведения; false — вакансия создана до правила «согласование оффера всегда». После заведения не меняется ничем. Только в ответах об одном объекте (карточка вакансии и заявки, ответы записи и перевода этапа); строка списка ключа не несёт."
          }
        }
      },
      "VacancyRequest": {
        "type": "object",
        "required": [
          "submittedAt",
          "awaiting",
          "awaitingTotal",
          "rejection"
        ],
        "description": "Сводка заявки без отдельного запроса на строку. Считается по последнему кругу согласования.",
        "properties": {
          "submittedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало ОТКРЫТОГО круга — когда заявку отправили. null — круг не открыт: черновик или решённый круг."
          },
          "awaiting": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppPerson"
            },
            "description": "До трёх человек, чьего решения ждёт открытый круг, по фамилии. Пустой — никого не ждут."
          },
          "awaitingTotal": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько всего людей ждёт круг; каждый человек один раз, даже если стоит на нескольких шагах."
          },
          "rejection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VacancyRejection"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отказной шаг последнего круга; null — отказа не было."
          }
        }
      },
      "VacancyRejection": {
        "type": "object",
        "required": [
          "by",
          "at",
          "reason"
        ],
        "description": "Кто, когда и почему отклонил заявку.",
        "properties": {
          "by": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отклонивший; null, если его строки нет."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "Момент решения."
          },
          "reason": {
            "type": "string",
            "description": "Причина, которую назвал отклонивший."
          }
        }
      },
      "VacancyCompany": {
        "type": "object",
        "description": "Профиль компании вакансии — лицо работодателя, которое она показывает соискателю: адрес, название и признак архива. Своя схема, а не AppPerson: архивный профиль остаётся у вакансии, и признак говорит, что выбрать его заново нельзя.",
        "required": [
          "id",
          "name",
          "archived"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id профиля компании — тот, что принимает PUT /api/v1/vacancies/{id}/company."
          },
          "name": {
            "type": "string",
            "description": "Название профиля для соискателей."
          },
          "archived": {
            "type": "boolean",
            "description": "Профиль в архиве. Архивация профиль у вакансии не снимает, но выбрать архивный профиль заново нельзя: и выбор, и создание вакансии ответят 409 company_archived."
          }
        }
      },
      "VacancyStage": {
        "type": "string",
        "enum": [
          "draft",
          "approval",
          "rejected",
          "new",
          "preparation",
          "screening",
          "completed"
        ],
        "description": "Этап вакансии в порядке процесса. draft — черновик заявки; approval — на согласовании; rejected — отклонена согласующим; new — согласована. В эти четыре попадают только действием процесса: draft — заведением и «Доработать», approval — отправкой на согласование, rejected и new — решением согласующего; переводом этапа (POST /api/v1/vacancies/{id}/stage) в них не попасть, а из draft, approval и rejected переводом не уйти. preparation, screening и completed — рабочие этапы: между ними переводят свободно, и в них же можно завести вакансию сразу (поле stage у POST /api/v1/vacancies при правке вакансий на уровне «все»). Куда можно перевести конкретную вакансию, говорит её allowedStages."
      },
      "VacancyCreateStage": {
        "type": "string",
        "enum": [
          "draft",
          "preparation",
          "screening",
          "completed"
        ],
        "description": "Этап, на котором заводится вакансия: черновик или рабочий этап. approval, rejected и new сюда не входят — в них попадают только действием процесса. Всё, кроме draft, требует правки вакансий на уровне «все» и заводится только без шаблона (templateId)."
      },
      "AppPerson": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id пользователя портала."
          },
          "name": {
            "type": "string",
            "description": "ФИО одной строкой, собранное сервером."
          },
          "avatarUrl": {
            "type": "string",
            "description": "Адрес фото человека (https). Нет фото — ключа нет. Приходит в пикерах людей, у людей вакансии и у ответственного отклика; прочие ответы его не несут."
          }
        }
      },
      "VacancyListResponse": {
        "type": "object",
        "required": [
          "vacancies",
          "nextCursor"
        ],
        "properties": {
          "vacancies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vacancy"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "null — страница последняя. Общего счётчика нет: он стоил бы второго прохода по выборке ради числа, по которому никто не принимает решений."
          }
        }
      },
      "VacancyCreateRequest": {
        "type": "object",
        "description": "Тело заведения вакансии. Без templateId обязательны positionTitle, headcount и openReasonTitle. С templateId вакансия заводится по шаблону: должность — всегда шаблонная, число людей, срок, вилка, интервьюер и профиль компании — значения шаблона, поверх — присланные ключи (null — «снять»), бриф и профиль кандидата — из шаблона. Ниже права vacancy · edit на уровне all присланное поле с режимом fixed или hidden, отличное от значения шаблона, — 400 invalid_value с details.field; вилка скрытого режима (hidden) отвергается на самом присутствии ключа, null и равное шаблону тоже. Этап по шаблону — только draft.",
        "properties": {
          "positionTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "ТЕКСТ, а не идентификатор: название строки справочника должностей, доступной для заявки, — как его отдают подсказки GET /api/v1/job-positions. Название вне справочника, недоступное или архивное отвергается — 400 invalid_value с details.field = positionTitle; справочник этой операцией не пополняется. Обязательно без templateId. С templateId необязательно: должность берётся из шаблона, а присланная, отличная от шаблонной, отвергается на любом уровне прав — 400 invalid_value с details.field = positionTitle."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535,
            "description": "Обязательно без templateId. С templateId не прислано — число людей шаблона; ниже права vacancy · edit на уровне all не выше потолка шаблона."
          },
          "openReasonTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Обязательно без templateId, и новая причина тогда заводится в справочнике причин. С templateId не прислана при одной причине в списке шаблона — берётся она. Ниже права vacancy · edit на уровне all — только из списка причин шаблона, а у шаблона без списка — существующая причина открытия портала или готовая формулировка сервиса; иное — 400 invalid_value с details.field = openReasonTitle. При all — любая, как без шаблона."
          },
          "desiredStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "justification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "interviewerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "public_id пользователя портала из GET /api/v1/users."
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заказчик вакансии — public_id человека портала. Не прислано или null — заказчик вызывающий (у ключа — владелец ключа). Назвать не себя может только держатель vacancy · edit на уровне «все»: ниже — 403 forbidden без details, одинаковый для чужого, неизвестного и неразборного адреса. На уровне «все» пустая строка, неразборный, неизвестный или архивный адрес — 400 invalid_value с details.field = customerId."
          },
          "stage": {
            "$ref": "#/components/schemas/VacancyCreateStage",
            "description": "Не прислан — draft: заявка уходит дальше только отправкой на согласование. Без templateId рабочий этап — только при vacancy · edit на уровне «все» (у ключа — после потолка), иначе 403 forbidden с details.field = stage. С templateId — только draft, иначе 400 invalid_value с details.field = stage на любом уровне."
          },
          "closeReasonTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Причина завершения ТЕКСТОМ, как у перевода в completed. Обязательна ровно при stage = completed и запрещена при любом другом этапе: иначе 400 invalid_value с details.field = closeReasonTitle. С templateId completed не принимается вовсе — отказ по stage приходит раньше. Новая причина навсегда входит в справочник причин портала."
          },
          "companyId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Профиль компании, который вакансия покажет соискателю, — public_id активного профиля портала. Нет поля или null — своего профиля нет, и действует профиль портала по умолчанию. Архивный профиль — 409 company_archived; неразборный адрес, профиль другого портала или профиль, которого нет, — 400 invalid_value с details.field = companyId."
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "description": "Шаблон вакансии — id из GET /api/v1/vacancy-templates/choice. При праве vacancy · edit на уровне all годится любой не архивный шаблон с доступной должностью, ниже — только видимый вызывающему по отделам (у ключа — по отделам его владельца). Неразборный, чужой, неизвестный, архивный, с недоступной должностью или (ниже all) вне аудитории — 400 invalid_value с details.field = templateId: здесь шаблон — ссылка в теле, а не адрес ресурса. Вакансия по шаблону заводится только черновиком: stage, кроме draft, — 400 invalid_value с details.field = stage, и этот отказ приходит раньше проверки самого шаблона."
          },
          "department": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Необязательный отдел вакансии — номер отдела Битрикс24. Для обычной вакансии доступен только при vacancy · edit = all и только для живого отдела текущего портала; чужой, неизвестный или пропавший отдел даёт 400 invalid_value с details.field = department. Для вакансии по шаблону выбор ограничен аудиторией шаблона: ниже уровня all отдел и должность берутся из шаблона, один подходящий отдел берётся сам, при нескольких поле обязательно; на уровне all можно выбрать любой живой отдел, а отсутствие поля оставляет отдел пустым."
          },
          "callPlanId": {
            "type": "string",
            "format": "uuid",
            "description": "Явный активный план портала. Без значения: активный план шаблона, затем общий резервный план. Недоступный явный ID не заменяется резервным. Ключу нужен явный ceiling vacancy.edit."
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "deprecated": true,
            "description": "Принимается и игнорируется: новая вакансия всегда с согласованием оффера. null — 400 invalid_value с полем offerApprovalRequired. Задаётся только при заведении: PATCH /vacancies ключ отвергает."
          }
        }
      },
      "VacancyPatchRequest": {
        "type": "object",
        "description": "Частичная правка: пришло поле — меняем, не пришло — не трогаем. Чтобы стереть необязательное поле, присылают null явно; отсутствие ключа и null здесь значат разное. stage и причина завершения сюда НЕ приходят — они меняются через /stage, потому что смена этапа не правка поля, а переход с проверкой и записью в журнал. Условия заявки (legalEntityId … observerIds) — та же форма, что в теле заявки; тело заведения (VacancyCreateRequest) их не принимает.",
        "properties": {
          "positionTitle": {
            "type": "string",
            "maxLength": 255
          },
          "headcount": {
            "type": "integer",
            "minimum": 1
          },
          "openReasonTitle": {
            "type": "string",
            "maxLength": 255
          },
          "desiredStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "justification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "interviewerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "recruiterId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес человека, ведущего подбор. null стирает назначение. Поля нет в создании заявки: её заводит руководитель, а рекрутера назначает кадровик после согласования."
          },
          "customerId": {
            "type": "string",
            "description": "Новый заказчик вакансии — public_id человека портала. Менять заказчика может только держатель vacancy · edit на уровне «все»: ниже само присутствие поля — 403 forbidden без details, раньше разбора прочих полей. Снять заказчика нельзя: null, пустая строка, неразборный, неизвестный или архивный адрес — 400 invalid_value с details.field = customerId. Ждущие решения по кандидатам остаются у прежнего заказчика."
          },
          "department": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отдел из актуального снимка Битрикс24; только vacancy · edit = all. null очищает отдел."
          },
          "legalEntityId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Юрлицо, от которого открывается вакансия, — адрес из справочника юрлиц (LegalEntity.id); null или пустая строка — снять. Новое обязано быть действующим юрлицом портала, иначе 400 invalid_value, details.reason ref_rejected; равное текущему не проверяется."
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. Снять нельзя: null — 400 invalid_value с полем marketReview; без ключа значение не трогается."
          },
          "salaryComment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий про деньги; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long. Скрыт вместе с вилкой: если вилка вакансии скрыта от вызывающего (снимок salaryHidden, вызывающий — автор или заказчик без правки вакансий на уровне all), ключ с любым значением, null тоже, — 400 invalid_value с полем salaryComment."
          },
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageCode"
            },
            "description": "Языки — коды словаря LanguageCode, без порядка; набор заменяется целиком, [] очищает. Код вне словаря — 400 invalid_value, details.reason invalid; повтор — duplicate."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Локация: код словаря LocationCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA; null — снять. Пустая строка и имя, которого нет в tzdata, — 400 invalid_value, details.reason invalid; уже стоящий пояс не проверяется."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "График: код словаря WorkScheduleCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "customerWishes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания заказчика; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long."
          },
          "fileIds": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Файлы условий — адреса загрузок с назначением vacancy_attachment; набор заменяется целиком, [] очищает. Только кабинет: ключ API с этим ключом (с любым значением, null тоже) получает 400 invalid_value с полем fileIds. Сверх предела — details.reason too_many, повтор — duplicate. Новый файл обязан быть загрузкой автора правки, подтверждённой, не занятой и годной вложением (PDF, JPEG, PNG в пределах размера); иначе, как и при адресе, который не разбирается или порталу неизвестен, — details.reason file_rejected, одна причина на все случаи. Файлы, уже стоящие у вакансии или в её шаблоне, не проверяются."
          },
          "observerIds": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "example": "42"
            },
            "description": "Наблюдатели — номера сотрудников Битрикс24 строкой, как TermsObserver.id; набор заменяется целиком, [] очищает. Ниже права vacancy · edit на уровне all режим у них всегда fixed: набор, отличный от текущего (без учёта порядка), — 400 invalid_value с полем observerIds. Держатель all меняет набор: новый наблюдатель обязан быть в снимке людей Битрикс24 портала и работать; иначе, как и при строке, которая не номер, — details.reason ref_rejected; уже стоящие не проверяются. Сверх предела — details.reason too_many; повтор номера — duplicate."
          }
        }
      },
      "VacancyStageRequest": {
        "type": "object",
        "required": [
          "stage"
        ],
        "properties": {
          "fromStage": {
            "$ref": "#/components/schemas/VacancyStage",
            "description": "Этап, С КОТОРОГО клиент переводит. Расхождение с настоящим — stage_forbidden: без этой проверки перевод по устаревшей карточке молча отменяет чужое завершение вместе с причиной, а allowedStages от этого не спасает — он из того же устаревшего ответа. Не прислан — не проверяем."
          },
          "stage": {
            "$ref": "#/components/schemas/VacancyStage"
          },
          "closeReasonTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Обязательна при переходе в completed и запрещена при любом другом: причина, присланная не к месту, — отказ, а не молчаливое игнорирование, потому что приславший её считает, что закрывает вакансию."
          },
          "reopenReason": {
            "type": "string",
            "maxLength": 1000,
            "description": "Объяснение выхода из completed: необязательное, хранится в журнале закрытия (до 1000 символов после обрезки краёв). Прислано к любому другому переводу или длиннее — invalid_value с details.field = reopenReason."
          }
        }
      },
      "Application": {
        "type": "object",
        "description": "Отклик — пара кандидат × вакансия. ОДНА форма на список и на ответы записи: две формы пришлось бы держать в согласии руками.",
        "required": [
          "id",
          "candidate",
          "vacancy",
          "stage",
          "hiredOn",
          "historicalOn",
          "allowedStages",
          "formStages",
          "responsible",
          "resumeUrl",
          "note",
          "createdAt",
          "source",
          "channels",
          "score",
          "scoreSource",
          "fit",
          "fitBot",
          "fitHuman",
          "reviewStatus",
          "decision",
          "nextInterviewAt",
          "journey",
          "type",
          "submittedBy",
          "submittedSnapshot",
          "rejection",
          "offerApproval",
          "step",
          "state",
          "decider",
          "decisionState",
          "liveInvite",
          "verdict",
          "verdictSource",
          "rejectedFrom",
          "stageEnteredAt",
          "reviewAttempt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id отклика. Автоинкремент наружу не уходит никогда."
          },
          "candidate": {
            "$ref": "#/components/schemas/ApplicationCandidate"
          },
          "vacancy": {
            "$ref": "#/components/schemas/ApplicationVacancy"
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "hiredOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День выхода на работу. Есть только у отклика на этапе hired: его пишет отметка выхода, а перевод с hired очищает. null у отклика на любом другом этапе."
          },
          "fit": {
            "$ref": "#/components/schemas/ApplicationFit",
            "description": "Действующее соответствие. Это разбор «Разбора»: он хранится за откликом и читается на любом шаге, уход со стадии его не стирает; у Собеседования и Оффера своего разбора нет. Устарело: поле будет удалено.",
            "deprecated": true
          },
          "fitBot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationFit"
              },
              {
                "type": "null"
              }
            ],
            "description": "Что предложил бот. null — отклик ещё не разбирали. Это разбор «Разбора»: он хранится за откликом и читается на любом шаге, уход со стадии его не стирает; у Собеседования и Оффера своего разбора нет. Устарело: поле будет удалено.",
            "deprecated": true
          },
          "fitHuman": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationFit"
              },
              {
                "type": "null"
              }
            ],
            "description": "Что решил человек. null — человек не спорил с ботом: СОГЛАСИЕ не хранится, хранится только несогласие, и оно видно расхождением этих двух полей. При возврате отклика на «Новый» система сама ставит maybe («Нужно рассмотреть»), и тогда fitHuman — maybe без решения человека. Новый анализ ИИ — одного отклика или разбор стадии — отметку гасит: fitHuman снова null. Это разбор «Разбора»: он хранится за откликом и читается на любом шаге, уход со стадии его не стирает; у Собеседования и Оффера своего разбора нет. Устарело: поле будет удалено.",
            "deprecated": true
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Оценка «Разбора», 0–100; ручная, если человек её поставил, иначе — оценка бота. null — оценки нет: отклик не разбирали и человек его не оценил. Это разбор «Разбора»: он хранится за откликом и читается на любом шаге, уход со стадии его не стирает; у Собеседования и Оффера своего разбора нет. Оценка бота отдельно — review.scoreBot."
          },
          "scoreSource": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScoreSource"
              },
              {
                "type": "null"
              }
            ],
            "description": "Чья оценка в score: ai — бота, human — человека. null вместе со score."
          },
          "review": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationReview"
              },
              {
                "type": "null"
              }
            ],
            "description": "Разбор: вывод и пункты бота, обоснование человека, оценка бота. Приезжает только при with=review — и у отклика, которого ИИ не разбирал; без него поля в ответе нет вовсе. Это разбор «Разбора»: он хранится за откликом и читается на любом шаге, уход со стадии его не стирает; у Собеседования и Оффера своего разбора нет."
          },
          "reviewStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReviewStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Статус разбора «Разбора». Есть только у отклика на «Новом»; на любом другом шаге null: разбор хранится, но статуса вне «Нового» нет."
          },
          "reviewHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StageReview"
            },
            "maxItems": 20,
            "description": "Разбор прошлых стадий в порядке ухода — последние уходы, не больше maxItems: новые круги оффера растят историю без предела. Приезжает при with=review и только у отклика, у которого прошлые стадии есть; без них поля в ответе нет."
          },
          "allowedStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationStage"
            },
            "description": "Куда этот отклик можно перевести прямо сейчас сменой этапа (POST /api/v1/applications/{id}/stage). Правило переходов повторять у себя не нужно: оно приходит готовым списком, и об ужесточении правила вызывающий узнаёт отсюда же. Этапов, в которые ведёт форма, здесь нет — они в formStages. У исторического отклика (historicalOn не null) список пуст: такой отклик не переводят. У отказанного и вышедшего отклика (rejected, hired) вакансии в архиве активных этапов в списке нет: в работу его не возвращают, пока вакансию не вернут из архива."
          },
          "formStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationStage"
            },
            "description": "Этапы, в которые отклик сейчас ведёт ФОРМА операции, а не смена этапа: offer — у активного отклика (new, interview, offer) без действующего оффера; действующий — принятый либо отправленный с неистёкшим сроком; hired — у любого активного отклика, принятый оффер выходу не обязателен. В offer ведёт только отправка оффера POST /api/v1/applications/{id}/offers, в hired — только отметка выхода POST /api/v1/applications/{id}/hire: смена этапа туда отвечает stage_requires_form. Правило активности повторять у себя не нужно — оно приходит готовым списком. rejected — форма формального отказа у любого активного отклика, включая offer. У вакансии с согласованием оффера offer открывает подготовку оффера и пропадает, пока подготовленный оффер есть."
          },
          "responsible": {
            "$ref": "#/components/schemas/AppPerson",
            "description": "Ответственный за отклик — человек портала. Не назван при заведении — это тот, кто завёл отклик."
          },
          "resumeUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ссылка на резюме, только http или https."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заметка рекрутера."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "$ref": "#/components/schemas/ApplicationSource"
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponseChannelCode"
            },
            "description": "Каналы, откуда отклик пришёл: площадки сбора откликов и Telegram-форма, — коды по разу, по алфавиту; у отклика, заведённого руками, пусто."
          },
          "decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationDecisionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "Решение заказчика по отклику. null — кругов решения у отклика нет: ни одно его собеседование не бронировалось, пока отклик был активен, либо ждущие круги сняты отменой собеседования или отказом отклику."
          },
          "nextInterviewAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало ближайшей забронированной встречи, не закончившейся к моменту ответа, UTC. Идущая сейчас встреча — всё ещё ближайшая. null — такой встречи нет."
          },
          "journey": {
            "$ref": "#/components/schemas/Journey",
            "description": "Фаза отклика — одна и та же для кандидата и для рекрутера."
          },
          "type": {
            "$ref": "#/components/schemas/ApplicationType"
          },
          "submittedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Автор отклика по проверенной Б24-сессии; отделён от кандидата и ответственного рекрутёра."
          },
          "submittedSnapshot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeSubmittedSnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "historicalOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Настоящая дата отклика, внесённого историческим вводом (appCreateHistoricalApplication). null — обычный отклик. Исторический отклик всегда заведён в закрытую вакансию сразу в отказе: он не считается активным и новым и не попадает в разбор и воронку."
          },
          "rejection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationRejection"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина текущего отказа; null у legacy записей и активных откликов."
          },
          "offerApproval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationOfferApproval"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отметка подготовленного оффера (вакансия с согласованием оффера); null — подготовленного оффера нет. Пока он есть, formStages не содержит offer."
          },
          "step": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStepKind"
              },
              {
                "type": "null"
              }
            ],
            "description": "Шаг вида «Откликов» — тот же, по которому отбирает параметр step списка. null — отклик массового подбора: шагов у массовой воронки нет."
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Состояние отклика: что с ним сейчас, чей ход без учёта смотрящего и с какого момента. Считается сервером из этапа, приглашений и встреч, кругов решения на нынешнем этапе, последнего оффера и подготовленного оффера с его запросом согласования; не хранится. null вместе со step."
          },
          "decider": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Решающий круга решения, который сейчас важен для отклика: круг, ждущий решения заказчика сейчас (из нескольких — самый ранний по концу встречи), иначе последний по моменту решения круг, решённый после входа отклика на нынешний этап. Тот же человек, что decider у GET /api/v1/applications/{id}/decisions. null вместе с decisionState — такого круга нет, в том числе когда круг решён до входа на нынешний этап."
          },
          "decisionState": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Состояние того же круга, что decider: pending — ждёт решения заказчика сейчас, decided — решён после входа на нынешний этап. Вердикт решённого круга говорит state (prepare_offer, need_another, пометки на «Оффере»), кроме await_offer_approval и offer_approval_turn: пока у отклика открыт подготовленный оффер, вердикт состояние не называет. null вместе с decider. Поле decision — прежний бейдж по всем кругам — не меняется."
          },
          "liveInvite": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationLiveInvite"
              },
              {
                "type": "null"
              }
            ],
            "description": "Живое приглашение отклика — то, что отменяют (POST /api/v1/interviews/{id}/cancel): назначенная встреча, которая ещё не закончилась, иначе ссылка, по которой кандидат ещё может выбрать время. null — ни того, ни другого."
          },
          "verdict": {
            "$ref": "#/components/schemas/ReviewVerdict",
            "description": "Вердикт «Разбора»: ручная отметка «Подходит» или «Не подходит», иначе вердикт анализа ИИ одного отклика, иначе вердикт разбора стадии ИИ, иначе none — «Нет анализа». Новый анализ ИИ — одного отклика или разбор стадии — ручную отметку гасит. Разбор «Разбора» хранится за откликом, поле есть на любом шаге."
          },
          "verdictSource": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerdictSource"
              },
              {
                "type": "null"
              }
            ],
            "description": "Чей вердикт: human — ручная отметка, ai — анализ ИИ. null у verdict none."
          },
          "matchCounts": {
            "$ref": "#/components/schemas/ApplicationMatchCounts",
            "description": "Числа сверки с портретом. Только в строках списка со step=review — лёгкая форма разбора, без пунктов и цитат (их отдаёт with=review); в прочих ответах поля нет. У отклика без разбора — нули."
          },
          "analysisStale": {
            "type": "boolean",
            "description": "Анализ ИИ устарел: сделан по версии портрета вакансии, которая уже не главная, — то же правило, что verdict=stale и review.botProvenance.stale. Только в строках списка со step=review; в прочих ответах поля нет."
          },
          "reviewSummary": {
            "type": "string",
            "description": "Вывод ИИ одной фразой. Только в строках списка со step=review и только у отклика, у которого вывод есть; в прочих ответах поля нет."
          },
          "rejectedFrom": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStage"
              },
              {
                "type": "null"
              }
            ],
            "description": "С какого этапа отказали — у отклика на этапе rejected: этап последнего ухода в отказ по истории стадий, у отказа без неё — по журналу смены этапа. null у неотказанного отклика и у отказа без следа этапа."
          },
          "stageEnteredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда отклик встал на нынешний этап, UTC. У отклика, заведённого до учёта этого момента, — момент заведения."
          },
          "onboardingStartAvailable": {
            "type": "boolean",
            "description": "Можно передать отклик на кадровое оформление. Право application · edit проверяется отдельно. В ответе одной строки отклика (карточка и ответы правок) — false, если оформление уже идёт или завершено; в списке — по этапу."
          },
          "invitationAvailable": {
            "type": "boolean",
            "description": "Допуск приглашения для этого отклика из подробной карточки. Нужен и для отклика вне ограниченного списка кандидата. При отсутствии признака новый запуск не допускается."
          },
          "reviewAttempt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationReviewAttempt"
              },
              {
                "type": "null"
              }
            ],
            "description": "Independent latest attempt for the retained review stage, on detail, list and comparison. Null when absent or unrepresentable; present independently of with=review and of old result timestamps."
          },
          "process": {
            "$ref": "#/components/schemas/ApplicationProcess",
            "description": "Шаги процесса отклика. Есть только в ответе одной строки — GET /api/v1/applications/{id} и ответах операций над откликом; у строк списка поля нет."
          }
        }
      },
      "ApplicationState": {
        "type": "object",
        "description": "Состояние отклика по таблице фаз: код, чей ход без учёта смотрящего, с какого момента отклик в нём и пометки решения заказчика.",
        "required": [
          "code",
          "kind",
          "since",
          "marks"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ApplicationStateCode"
          },
          "kind": {
            "$ref": "#/components/schemas/ApplicationStateKind"
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "С какого момента отклик в этом состоянии, UTC: вход на этап, отправка, истечение ссылки или отмена приглашения, отправка оффера, бронь, конец встречи, момент решения заказчика, отказа кандидата, истечения или отзыва оффера, принятие оффера, первый момент дня выхода или завершение вакансии — по состоянию. У await_offer_approval и offer_approval_turn — момент подготовленного оффера: запрос согласования, решение заказчика по нему, смена доставки недоставленного запроса или правка черновика без запроса."
          },
          "marks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationStateMark"
            },
            "description": "Пометки решения заказчика по кругам нынешнего этапа: ждущий круг, где состояние — не await_customer, и вердикт круга на «Оффере». Пусто — пометок нет."
          }
        }
      },
      "ApplicationStateCode": {
        "type": "string",
        "enum": [
          "review",
          "need_invite",
          "need_another",
          "invite_expired",
          "await_slot",
          "meeting_scheduled",
          "await_customer",
          "prepare_offer",
          "no_decision",
          "await_offer_answer",
          "remake_offer",
          "send_offer",
          "await_offer_approval",
          "offer_approval_turn",
          "await_start",
          "mark_start",
          "hired",
          "rejected",
          "closed"
        ],
        "description": "Состояние отклика: review — разбор; need_invite — нужно пригласить; need_another — нужна ещё встреча; invite_expired — ссылка на выбор времени истекла; await_slot — ждём, пока кандидат выберет время; meeting_scheduled — встреча назначена; await_customer — ждём решения заказчика; prepare_offer — заказчик решил «Подходит», подготовить оффер; no_decision — встреча прошла, а запроса решения нет; await_offer_answer — ждём ответа на оффер; remake_offer — оффер отклонён, истёк или отозван; send_offer — оффер действует, а кандидату не передан ни ссылкой, ни через hh, ни отметкой «Передал сам»: отправить оффер; await_offer_approval — подготовленный оффер ждёт согласования заказчика; offer_approval_turn — подготовленный оффер ждёт шага рекрутера: запросить решение, отправить повторно, отправить кандидату или изменить; await_start — оффер принят, день выхода впереди; mark_start — день выхода настал, отметить выход; hired — вышел; rejected — отказ; closed — вакансия завершена, процесса по отклику нет."
      },
      "ApplicationStateKind": {
        "type": "string",
        "enum": [
          "turn",
          "wait",
          "none"
        ],
        "description": "Чей ход без учёта смотрящего: turn — действовать сотруднику (ответственному отклика), wait — ждём кандидата, заказчика или дня выхода, none — процесса нет."
      },
      "ApplicationStateMark": {
        "type": "string",
        "enum": [
          "customer_pending",
          "customer_fit",
          "customer_unfit",
          "customer_another"
        ],
        "description": "Пометка решения заказчика: customer_pending — ждёт решения заказчика, customer_fit — заказчик: подходит, customer_unfit — заказчик: не подходит, customer_another — заказчик: нужна ещё встреча."
      },
      "ApplicationLiveInvite": {
        "type": "object",
        "description": "Живое приглашение отклика: собеседование и его статус.",
        "required": [
          "id",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id собеседования — адрес отмены POST /api/v1/interviews/{id}/cancel."
          },
          "state": {
            "$ref": "#/components/schemas/ApplicationLiveInviteState"
          }
        }
      },
      "ApplicationLiveInviteState": {
        "type": "string",
        "enum": [
          "pending",
          "booked"
        ],
        "description": "pending — ссылка жива, кандидат ещё выбирает время; booked — встреча назначена и ещё не закончилась."
      },
      "ApplicationMatchCounts": {
        "type": "object",
        "description": "Числа пунктов сверки отклика с портретом вакансии.",
        "required": [
          "closed",
          "missing",
          "unclear"
        ],
        "properties": {
          "closed": {
            "type": "integer",
            "minimum": 0,
            "description": "Требование закрыто: в отклике нашлось подтверждение."
          },
          "missing": {
            "type": "integer",
            "minimum": 0,
            "description": "Требования нет в отклике."
          },
          "unclear": {
            "type": "integer",
            "minimum": 0,
            "description": "Не ясно — уточнить у кандидата."
          }
        }
      },
      "ReviewVerdict": {
        "type": "string",
        "enum": [
          "fit",
          "unsure",
          "unfit",
          "none"
        ],
        "description": "Вердикт «Разбора»: fit — «Подходит», unsure — «Под вопросом», unfit — «Не подходит», none — «Нет анализа»."
      },
      "VerdictSource": {
        "type": "string",
        "enum": [
          "human",
          "ai"
        ],
        "description": "Источник вердикта: human — ручная отметка, ai — анализ ИИ."
      },
      "Journey": {
        "type": "object",
        "description": "Фаза отклика: код фазы, шаг главной линии (null — концовка) и шаги по порядку.",
        "required": [
          "phase",
          "step",
          "steps"
        ],
        "properties": {
          "phase": {
            "$ref": "#/components/schemas/JourneyPhase"
          },
          "step": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JourneyStep"
              },
              {
                "type": "null"
              }
            ],
            "description": "Шаг главной линии, на котором стоит отклик. null — концовка: rejected, closed."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JourneyStep"
            },
            "description": "Шаги главной линии по порядку. Порядок отдаёт сервер: клиент не держит свою копию."
          }
        }
      },
      "JourneyPhase": {
        "type": "string",
        "enum": [
          "review",
          "mass_screening",
          "mass_registered",
          "mass_attended",
          "interview_invited",
          "interview_waiting",
          "interview_scheduled",
          "decision",
          "offer",
          "offer_accepted",
          "offer_declined",
          "offer_lapsed",
          "hired",
          "rejected",
          "closed"
        ],
        "description": "Фаза отклика — где он в пути; одна для кандидата и рекрутера. review — отклик рассматривают; interview_invited — приглашение на собеседование ждёт выбора времени — в кабинете или по ссылке; interview_waiting — этап собеседования, живого приглашения нет; interview_scheduled — встреча назначена и ещё не закончилась; decision — встреча прошла, ждём решения; offer — оффер отправлен и действует (или этап оффера без строки оффера); offer_accepted — оффер принят; offer_declined — кандидат отказался; offer_lapsed — оффер истёк или отозван; hired — вышел на работу; rejected — отказ; closed — вакансия завершена, живого процесса по отклику нет: ни принятого или действующего оффера на этапе offer, ни назначенной встречи, ни живого приглашения. Перечень может расти: клиент обязан переносить неизвестную фазу."
      },
      "JourneyStep": {
        "type": "string",
        "enum": [
          "application",
          "interview",
          "decision",
          "mass_screening",
          "mass_registered",
          "mass_attended",
          "offer",
          "hired"
        ],
        "description": "Шаг главной линии пути: application — отклик, interview — собеседование, decision — решение, offer — оффер, hired — выход."
      },
      "ApplicationDecisionSummary": {
        "type": "object",
        "description": "Решение заказчика по отклику одной строкой — бейдж доски и списка откликов. Круги решения целиком отдаёт GET /api/v1/applications/{id}/decisions.",
        "required": [
          "verdict",
          "pending"
        ],
        "properties": {
          "verdict": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionVerdict"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вердикт последнего решённого круга — по моменту, с которого круг ждал решения. null — ни один круг не решён. Круг, который ещё не решён, прежний вердикт не стирает."
          },
          "pending": {
            "type": "boolean",
            "description": "Круг ждёт решения заказчика сейчас: встреча закончилась, решения нет, отклик активен и вакансия не завершена — тот же отбор, по которому строка стоит в очереди заказчика GET /api/v1/decisions."
          }
        }
      },
      "ApplicationCandidate": {
        "type": "object",
        "description": "Кандидат — человек, откликнувшийся на вакансию. Один кандидат стоит в откликах на разные вакансии: его находят по контакту.",
        "required": [
          "id",
          "name",
          "contacts"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id кандидата — один и тот же во всех его откликах."
          },
          "name": {
            "type": "string",
            "description": "ФИО одной строкой, собранное сервером."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateContact"
            },
            "description": "Все контакты кандидата в порядке заведения. Контакт принадлежит человеку, а не отклику: правка через любой его отклик видна во всех."
          }
        }
      },
      "CandidateContact": {
        "type": "object",
        "required": [
          "kind",
          "value"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ContactKind"
          },
          "value": {
            "type": "string",
            "maxLength": 255,
            "description": "Контакт так, как его ввели, без пробелов по краям. Кандидата находят не по этой строке, а по её нормальной форме, поэтому «+7 916 555-12-34» и «89165551234» — один и тот же контакт."
          }
        }
      },
      "ContactKind": {
        "type": "string",
        "enum": [
          "phone",
          "email",
          "telegram"
        ],
        "description": "Вид контакта кандидата: телефон, почта или имя пользователя Telegram."
      },
      "ApplicationVacancy": {
        "type": "object",
        "description": "Вакансия отклика ссылкой. Остальное о вакансии отдаёт GET /api/v1/vacancies/{id}.",
        "required": [
          "id",
          "number",
          "position",
          "scenario"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id вакансии."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер вакансии; null у старых вакансий без номера."
          },
          "position": {
            "type": "string",
            "description": "Название должности."
          },
          "scenario": {
            "$ref": "#/components/schemas/VacancyScenario"
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "description": "У вакансии согласование оффера: «Оффер» отклика открывает подготовку, а не отправку. Снимок заведения; false — вакансия создана до правила «согласование оффера всегда». Приходит только в строке отклика (Application); у откликов кандидата и в отзывах согласия поля нет."
          }
        }
      },
      "ApplicationStage": {
        "type": "string",
        "enum": [
          "new",
          "interview",
          "mass_screening",
          "mass_registered",
          "mass_attended",
          "offer",
          "hired",
          "rejected"
        ],
        "description": "Этап отклика в порядке воронки: new — новый, interview — собеседование, offer — оффер, hired — выход на работу, rejected — отказ. Порядок значим: в нём строится меню этапов."
      },
      "ApplicationStageFilter": {
        "type": "string",
        "enum": [
          "new",
          "interview",
          "mass_screening",
          "mass_registered",
          "mass_attended",
          "offer",
          "hired",
          "rejected",
          "active"
        ],
        "description": "Отбор по этапу: код одного этапа или active — все этапы, кроме rejected и hired, то есть те, что считает activeApplications вакансии."
      },
      "ApplicationStepKind": {
        "type": "string",
        "enum": [
          "review",
          "interview",
          "decision",
          "offer",
          "hired",
          "rejected"
        ],
        "description": "Шаг вида «Откликов» в порядке ленты: «Разбор», «Собеседование», «Решение», «Оффер», «Выход», «Отказы». Шаг не хранится — его считает сервер из этапа, живого приглашения и назначенной встречи, прошедших встреч и кругов решения на нынешнем этапе: живое приглашение держит на «Собеседовании» и отклик «Нового», а у этапа «Собеседование» два шага — «Собеседование» и «Решение». У отклика завершённой вакансии без процесса — шаг своего этапа. У массового подбора шагов нет."
      },
      "ReviewVerdictFilter": {
        "type": "string",
        "enum": [
          "fit",
          "unsure",
          "unfit",
          "none",
          "stale"
        ],
        "description": "Отбор по вердикту «Разбора»: вердикт ReviewVerdict (fit — «Подходит», unsure — «Под вопросом», unfit — «Не подходит», none — «Нет анализа») или stale — «Устарел»: анализ ИИ сделан по версии портрета, которая уже не главная у вакансии. stale — не вердикт, а признак анализа: такой отклик попадает и под свой вердикт."
      },
      "ApplicationListResponse": {
        "type": "object",
        "required": [
          "applications",
          "nextCursor"
        ],
        "properties": {
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Application"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "null — страница последняя. Общего счётчика нет: он стоил бы второго прохода по выборке ради числа, по которому никто не принимает решений."
          }
        }
      },
      "ApplicationCreateRequest": {
        "type": "object",
        "required": [
          "vacancyId",
          "lastName",
          "firstName",
          "contact"
        ],
        "properties": {
          "vacancyId": {
            "type": "string",
            "description": "public_id вакансии, на которую откликаются."
          },
          "lastName": {
            "type": "string",
            "maxLength": 100
          },
          "firstName": {
            "type": "string",
            "maxLength": 100
          },
          "middleName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Отчество; null, пустая строка или одни пробелы — отчества нет."
          },
          "contact": {
            "$ref": "#/components/schemas/CandidateContact",
            "description": "Ровно один контакт. Уже известный порталу контакт указывает на существующего кандидата, и имя из тела тогда не применяется."
          },
          "responsibleId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "public_id пользователя портала — тот же id, что в GET /api/v1/users. Не прислан или null — ответственным становится вызывающий."
          },
          "resumeUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "description": "Только http или https. Пустая строка и null — ссылки нет."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationSource"
              }
            ],
            "description": "Откуда пришёл отклик. Без поля — manual."
          }
        }
      },
      "ApplicationPatchRequest": {
        "type": "object",
        "description": "Частичная правка: пришло поле — меняем, не пришло — не трогаем. resumeUrl и note стираются null или пустой строкой. responsibleId null не принимает: ответственный у отклика есть всегда. Другие поля сюда не приходят: имя кандидата и вакансия не правятся, этап меняется через /stage.",
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/CandidateContact",
            "description": "Контакт кандидата: заменяет его контакт того же вида или добавляет контакт нового вида. kind и value приходят только вместе."
          },
          "responsibleId": {
            "type": "string",
            "description": "public_id пользователя портала — тот же id, что в GET /api/v1/users."
          },
          "resumeUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "description": "Только http или https."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "$ref": "#/components/schemas/ApplicationSource"
          }
        }
      },
      "ApplicationMoveRequest": {
        "type": "object",
        "required": [
          "fromStage",
          "stage"
        ],
        "properties": {
          "fromStage": {
            "$ref": "#/components/schemas/ApplicationStage",
            "description": "Этап, С КОТОРОГО переводят, — тот, что вызывающий видел. Расхождение с настоящим — stage_forbidden: без этой проверки перевод по устаревшей странице молча отменял бы чужую работу."
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          }
        }
      },
      "TitleListResponse": {
        "type": "object",
        "required": [
          "titles"
        ],
        "properties": {
          "titles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Названия для выпадающего списка: строки портала и ещё не выбранные заготовки, склеенные по названию. Различать их незачем — показываются одинаково и уезжают на сервер одинаково, текстом."
          }
        }
      },
      "AppUser": {
        "type": "object",
        "description": "Строка справочника кабинета: ОДИН портальный пользователь. В отличие от строки платформенного справочника здесь ничего не склеено из порталов — портал один, поэтому статус и роли однозначны и показываются без оговорок.",
        "required": [
          "id",
          "lastName",
          "firstName",
          "middleName",
          "roles",
          "archived",
          "b24Account",
          "lastLoginAt",
          "createdAt",
          "avatarUrl",
          "can"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id пользователя."
          },
          "lastName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отчество; null у иностранцев."
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Действующие роли в этом портале, отсортированы по коду. Пустой список — «сотрудник»: это не роль, а отсутствие ролей вовсе."
          },
          "archived": {
            "type": "boolean"
          },
          "b24Account": {
            "type": "boolean",
            "description": "Есть ли учётка на портале Битрикс24. У «синего воротничка» её нет и не будет — это не край, а основная аудитория продукта."
          },
          "lastLoginAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последний зафиксированный вход в HRM через кабинет или встраивание по действующему способу входа, RFC 3339 в UTC. null — время входа не зафиксировано; входы до начала учёта неизвестны. Вызовы по API-ключу и эмуляция не учитываются."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true,
            "description": "Фото человека: путь ручки этого сервиса с версией, если он загрузил своё, иначе адрес из сети, иначе null. Тумблер сетевого фото здесь не учитывается — он личный. Путь /api/v1/…/avatar открывается только из кабинета (cookieOnly): по ключу API он отвечает 403."
          },
          "can": {
            "type": "object",
            "description": "Права вызывающего над этим человеком — что ему разрешено с ним делать; считает сервер по матрице прав и уровню вызывающего. У человека в архиве все false, кроме restore.",
            "required": [
              "editRoles",
              "archive",
              "restore"
            ],
            "properties": {
              "editRoles": {
                "type": "boolean",
                "description": "Вправе менять прямые назначения ролей этого человека: у вызывающего есть access · edit, и это не он сам — своих ролей вызывающий не меняет."
              },
              "archive": {
                "type": "boolean",
                "description": "Вправе перевести этого человека в архив: у вызывающего portal_user · edit с уровнем, накрывающим человека, и это не он сам."
              },
              "restore": {
                "type": "boolean",
                "description": "Вправе вернуть этого человека из архива: человек в архиве, и у вызывающего portal_user · edit с уровнем, накрывающим человека."
              }
            }
          }
        }
      },
      "AppUsersResponse": {
        "type": "object",
        "required": [
          "users",
          "roles",
          "nextCursor"
        ],
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUser"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Какие роли вообще выданы в портале — список для выпадашки фильтра. Считается независимо от фильтров: иначе выбор роли схлопнул бы выпадашку до самой себя."
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "null — страница последняя."
          }
        }
      },
      "ApplicationSource": {
        "type": "string",
        "description": "Источник отклика: откуда человек пришёл на ЭТУ вакансию. У кандидата источника нет — он приходит с hh.ru на одну вакансию и по реферальной ссылке на другую. До интеграций с площадками источник проставляет рекрутер руками, и умолчание manual — правда о накопленных строках. telegram — отклик через Telegram-форму: ставит его только отправка формы; заведение и правка рекрутером отвечают на него invalid_value с details.field = source.",
        "enum": [
          "hh",
          "avito",
          "career_site",
          "referral",
          "manual",
          "bitrix24",
          "telegram"
        ]
      },
      "CandidateStatusGroup": {
        "type": "string",
        "description": "Группа статуса кандидата, вычисленная по ВСЕМ его откликам. working — есть хоть один отклик на активном этапе; hired — активных нет, но есть вышедший на работу; rejected — остались одни отказы; none — откликов нет вовсе.",
        "enum": [
          "working",
          "hired",
          "rejected",
          "none"
        ]
      },
      "CandidateStatus": {
        "type": "object",
        "description": "Статус кандидата: группа и подпись. Подпись — этап самого продвинутого активного отклика; у группы none её нет. Текста здесь не бывает: сервер не знает языка смотрящего.",
        "required": [
          "group",
          "stage"
        ],
        "properties": {
          "group": {
            "$ref": "#/components/schemas/CandidateStatusGroup"
          },
          "stage": {
            "type": "string",
            "enum": [
              "new",
              "interview",
              "mass_screening",
              "mass_registered",
              "mass_attended",
              "offer",
              "hired",
              "rejected"
            ],
            "nullable": true,
            "description": "Этап лучшего отклика. null у кандидата без откликов. Список тот же, что у ApplicationStage; совпадение держит тест."
          }
        }
      },
      "CandidateListItem": {
        "type": "object",
        "description": "Строка базы кандидатов. Статус и счётчик считаются по всем откликам человека и одинаковы для всех смотрящих; должность и источник берутся у лучшего ВИДИМОГО отклика и равны null, если ни одного не видно — право candidate · view даёт человека, право application · view даёт работу по нему.",
        "required": [
          "id",
          "name",
          "status",
          "applicationsCount",
          "lastActivityAt",
          "position",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id кандидата."
          },
          "name": {
            "type": "string",
            "description": "ФИО одной строкой, собранное сервером."
          },
          "status": {
            "$ref": "#/components/schemas/CandidateStatus"
          },
          "applicationsCount": {
            "type": "integer",
            "description": "Сколько всего откликов у человека."
          },
          "lastActivityAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда его отклики трогали в последний раз. null — откликов нет."
          },
          "position": {
            "type": "string",
            "nullable": true,
            "description": "Должность лучшего видимого отклика."
          },
          "source": {
            "type": "string",
            "enum": [
              "hh",
              "avito",
              "career_site",
              "referral",
              "manual",
              "bitrix24",
              "telegram"
            ],
            "nullable": true,
            "description": "Источник лучшего ВИДИМОГО отклика; null — ни одного отклика не видно. Список тот же, что у ApplicationSource; совпадение держит тест."
          },
          "invitationAttention": {
            "type": "boolean",
            "description": "Только true: начатое приглашение этого рекрутера требует действия. Отсутствует для API-ключей."
          }
        }
      },
      "CandidateListResponse": {
        "type": "object",
        "required": [
          "candidates"
        ],
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateListItem"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Курсор следующей страницы; null — страница последняя. Непрозрачный."
          }
        }
      },
      "CandidateApplication": {
        "type": "object",
        "description": "Отклик в истории кандидата. Полная карточка отклика — GET /api/v1/applications/{id}.",
        "required": [
          "id",
          "vacancy",
          "stage",
          "source",
          "createdAt",
          "historicalOn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id отклика."
          },
          "vacancy": {
            "$ref": "#/components/schemas/ApplicationVacancy"
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "source": {
            "$ref": "#/components/schemas/ApplicationSource"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "historicalOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Настоящий день отклика, внесённого историческим вводом в закрытую вакансию (appCreateHistoricalApplication), ГГГГ-ММ-ДД. null — обычный отклик. createdAt у исторического отклика — момент внесения, а не отклика."
          }
        }
      },
      "CandidateCommunicationContact": {
        "type": "object",
        "description": "Communication-only email from a response or connected email request visible to this staff viewer. It is not a candidate login contact. All sources of the address within its application are retained.",
        "required": [
          "value",
          "norm",
          "sources",
          "applicationId",
          "unverified"
        ],
        "properties": {
          "value": {
            "type": "string",
            "description": "Адрес для связи, с сохранившимся в источнике регистром. Сравнение адресов идёт по norm."
          },
          "norm": {
            "type": "string",
            "description": "Normalized address for comparison and fresh server admission."
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CandidateCommunicationSource"
            }
          },
          "applicationId": {
            "type": "string",
            "description": "Публичный ID отклика, в котором этот адрес доступен пользователю и прошёл повторную проверку сервера."
          },
          "unverified": {
            "type": "boolean",
            "description": "Always true: the projected address has not been registered as a candidate login contact."
          }
        }
      },
      "CandidateCommunicationSource": {
        "type": "string",
        "description": "Communication-only source: a visible hh/Avito response or a connected candidate email request. Pending and rejected requests are not sources. These projections do not create login identities.",
        "enum": [
          "hh",
          "avito",
          "candidate_request"
        ]
      },
      "CandidateCard": {
        "type": "object",
        "description": "Карточка кандидата: человек, его контакты и видимая история откликов. Истории нет вовсе — значит либо откликов нет, либо ни один не виден под правом application · view; различить это можно по applicationsCount, который считается по всем.",
        "required": [
          "id",
          "name",
          "lastName",
          "firstName",
          "middleName",
          "contacts",
          "status",
          "applicationsCount",
          "lastActivityAt",
          "applications"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "lastName": {
            "type": "string",
            "description": "Фамилия отдельным полем: форма правки не вправе разбирать name пробелами — двойная фамилия развалилась бы на фамилию и имя."
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "type": "string",
            "nullable": true,
            "description": "Отчество; null — его нет."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateContact"
            }
          },
          "communicationContacts": {
            "type": "array",
            "description": "Адреса только для связи, доступные пользователю в откликах этого кандидата. Отсутствуют при наличии identity-email кандидата. Не является записываемым полем CandidatePatchRequest.",
            "items": {
              "$ref": "#/components/schemas/CandidateCommunicationContact"
            }
          },
          "status": {
            "$ref": "#/components/schemas/CandidateStatus"
          },
          "applicationsCount": {
            "type": "integer"
          },
          "lastActivityAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "applications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateApplication"
            }
          },
          "purgedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Персональные данные стёрты по сроку хранения или отзыву согласия: ФИО — заглушки, контактов нет. Нет поля — данные живы."
          }
        }
      },
      "CandidateCreateRequest": {
        "type": "object",
        "description": "Заведение человека без отклика. Контакт ровно один: два могли бы указать на двух разных существующих людей. Контакт уже занят — 409 candidate_exists с public_id найденного в details.id.",
        "required": [
          "lastName",
          "firstName",
          "contact"
        ],
        "properties": {
          "lastName": {
            "type": "string",
            "maxLength": 100
          },
          "firstName": {
            "type": "string",
            "maxLength": 100
          },
          "middleName": {
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "contact": {
            "$ref": "#/components/schemas/CandidateContact"
          }
        }
      },
      "CandidatePatchRequest": {
        "type": "object",
        "description": "Правка карточки. Присланное поле меняется, отсутствующее не трогается. contacts — НАБОР целиком: чего в нём нет, то снимается. Пустой набор отвергается — человек без контакта не находится поиском и не склеивается со своим следующим откликом.",
        "properties": {
          "lastName": {
            "type": "string",
            "maxLength": 100
          },
          "firstName": {
            "type": "string",
            "maxLength": 100
          },
          "middleName": {
            "type": "string",
            "maxLength": 100,
            "description": "Отчество. Пустая строка СНИМАЕТ его; null не годится — в теле правки он неотличим от «поле не прислали», то есть от «не трогать»."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateContact"
            }
          }
        }
      },
      "JobPosition": {
        "type": "object",
        "description": "Строка справочника должностей. Адресуется названием: идентификатора у неё нет.",
        "required": [
          "title",
          "available",
          "archived",
          "createdAt"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Название, оно же адрес строки."
          },
          "available": {
            "type": "boolean",
            "description": "Предлагается ли в форме заявки."
          },
          "archived": {
            "type": "boolean",
            "description": "Убрана ли в архив."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "JobPositionListResponse": {
        "type": "object",
        "required": [
          "positions"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobPosition"
            }
          }
        }
      },
      "JobPositionCreateRequest": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          }
        }
      },
      "JobPositionPatchRequest": {
        "type": "object",
        "description": "Все три поля правки необязательны, но хотя бы одно из newTitle, available, archived обязано присутствовать.",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Адрес правимой строки — её текущее название."
          },
          "newTitle": {
            "type": "string",
            "nullable": true,
            "description": "Новое название строки. Уникально в портале вместе с архивными строками."
          },
          "available": {
            "type": "boolean",
            "nullable": true
          },
          "archived": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "ApprovalRouteStep": {
        "type": "object",
        "description": "Шаг маршрута. Номера нет: порядок в массиве и есть порядок шагов. Заполнено ровно одно поле субъекта или ни одного — смотря какой вид.",
        "required": [
          "kind",
          "userId",
          "b24UserId",
          "b24DeptId",
          "roleCode"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ]
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "b24UserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "b24DeptId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "roleCode": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ApprovalRoute": {
        "type": "object",
        "required": [
          "id",
          "title",
          "mode",
          "isDefault",
          "createdAt",
          "steps",
          "updatedAt",
          "updatedBy",
          "archivedAt",
          "stepCount",
          "version",
          "objectType",
          "hasParallel",
          "hasConditions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "sequential",
              "parallel"
            ],
            "description": "Прежнее устройство маршрута: `parallel`, если маршрут — одна группа из нескольких шагов, иначе `sequential` (и у смешанного маршрута). Параллельные блоки точнее называют groupNo шагов и hasParallel."
          },
          "isDefault": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteStepView"
            },
            "description": "Пуст в списке, заполнен в карточке и в ответах записи. Шаг несёт прежние поля (kind, userId, …) и форму с участниками: groupNo, rule, title, members, conditions."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Время последней правки маршрута: шаги, название, архив, возврат, умолчание."
          },
          "updatedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApprovalRouteActor"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто правил последним; null — неизвестен."
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда маршрут отправлен в архив; null — маршрут действующий."
          },
          "stepCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Число шагов маршрута."
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "Растёт на записи названия и шагов; архив, возврат и умолчание её не трогают."
          },
          "objectType": {
            "type": "string",
            "description": "Что согласует маршрут: ключ типа объекта из GET /api/v1/approval-routes/object-types (сейчас `vacancy_request`). Открытая строка, а не перечисление: типы публикует каталог. Задаётся при создании и не меняется."
          },
          "hasParallel": {
            "type": "boolean",
            "description": "Есть группа из нескольких шагов, идущих параллельно."
          },
          "hasConditions": {
            "type": "boolean",
            "description": "Есть шаг с условием."
          }
        }
      },
      "ApprovalRouteListResponse": {
        "type": "object",
        "required": [
          "routes",
          "nextCursor"
        ],
        "properties": {
          "routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteListItem"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Курсор следующей страницы; null — страниц больше нет, а также без `limit`."
          }
        }
      },
      "ApprovalRouteCreateRequest": {
        "type": "object",
        "required": [
          "title",
          "mode"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "mode": {
            "type": "string",
            "enum": [
              "sequential",
              "parallel"
            ]
          }
        }
      },
      "ApprovalRouteStepsRequest": {
        "type": "object",
        "required": [
          "steps"
        ],
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteStepWrite"
            }
          }
        }
      },
      "VacancyTemplateFieldMode": {
        "type": "string",
        "enum": [
          "author",
          "fixed",
          "range",
          "hidden"
        ],
        "description": "Режим вилки (salary): у неё все четыре. Прочие поля шаблона — VacancyTemplatePlainMode. Совпадение с hiring.AllowedModes держит тест."
      },
      "VacancyTemplatePlainMode": {
        "type": "string",
        "enum": [
          "author",
          "fixed"
        ],
        "description": "Режим поля без вилки: у всех полей, кроме salary, только author и fixed. Совпадение с hiring.AllowedModes держит тест."
      },
      "VacancyTemplateChannel": {
        "type": "string",
        "enum": [
          "bitrix24",
          "telegram",
          "avito",
          "hh"
        ],
        "description": "Код площадки по умолчанию. Закрытое множество — совпадение с Go держит тест."
      },
      "VacancyTemplateModes": {
        "type": "object",
        "description": "Режим каждого поля условий: что с полем делает заказчик в форме заявки. author — заполняет заказчик (значение шаблона — подсказка), fixed — задано HR, range — заказчик сужает вилку внутри границ шаблона, hidden — поля у заказчика нет. range и hidden бывают только у salary. Должности, профиля компании и интервьюера здесь нет: они всегда fixed. В ответе назван режим каждого поля, author тоже. Коды условий заявки — legal_entity (юрлицо), employment_type (формат оформления), market_review (обзор рынка зарплат), salary_comment (комментарий про деньги), languages, location, timezone, work_schedule (график), customer_wishes (пожелания заказчика), files — бывают только author и fixed. При скрытой вилке (salary: hidden) salary_comment всегда fixed. Обязательны в ответе прежние коды: коды условий заявки бывают пропущены (сервер прежней версии их не знает), и отсутствующий код читается как author.",
        "required": [
          "headcount",
          "deadline",
          "salary",
          "work_format",
          "brief_tasks",
          "brief_conditions",
          "brief_schedule",
          "brief_hiring_steps",
          "profile_experience",
          "profile_skills",
          "profile_education",
          "profile_stoppers"
        ],
        "properties": {
          "headcount": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "deadline": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "salary": {
            "$ref": "#/components/schemas/VacancyTemplateFieldMode"
          },
          "work_format": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_tasks": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_conditions": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_schedule": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_hiring_steps": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_experience": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_skills": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_education": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_stoppers": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "legal_entity": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "employment_type": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "market_review": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "salary_comment": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "languages": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "location": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "timezone": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "work_schedule": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "customer_wishes": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "files": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          }
        },
        "additionalProperties": false
      },
      "VacancyTemplateModesWrite": {
        "type": "object",
        "description": "Режим каждого поля условий: что с полем делает заказчик в форме заявки. author — заполняет заказчик (значение шаблона — подсказка), fixed — задано HR, range — заказчик сужает вилку внутри границ шаблона, hidden — поля у заказчика нет. range и hidden бывают только у salary. Должности, профиля компании, интервьюера и наблюдателей здесь нет: они всегда fixed. Коды условий заявки — legal_entity (юрлицо), employment_type (формат оформления), market_review (обзор рынка зарплат), salary_comment (комментарий про деньги), languages, location, timezone, work_schedule (график), customer_wishes (пожелания заказчика), files — бывают только author и fixed. Замена набора: прежние коды (headcount, deadline, salary, work_format, brief_*, profile_*) заменяются целиком — не названный становится author; код условий заявки, не названный в присланном наборе, сохраняет свой режим, названный — получает присланный. modes: {} сбрасывает прежние коды в author, а режимы условий заявки оставляет. При скрытой вилке (salary: hidden) salary_comment всегда fixed: не названный сервер пишет fixed сам, явный salary_comment: author в том же теле — 400 invalid_value с полем modes.",
        "properties": {
          "headcount": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "deadline": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "salary": {
            "$ref": "#/components/schemas/VacancyTemplateFieldMode"
          },
          "work_format": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_tasks": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_conditions": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_schedule": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "brief_hiring_steps": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_experience": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_skills": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_education": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "profile_stoppers": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "legal_entity": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "employment_type": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "market_review": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "salary_comment": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "languages": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "location": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "timezone": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "work_schedule": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "customer_wishes": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          },
          "files": {
            "$ref": "#/components/schemas/VacancyTemplatePlainMode"
          }
        },
        "additionalProperties": false
      },
      "VacancyTemplateBrief": {
        "type": "object",
        "required": [
          "tasks",
          "conditions",
          "schedule",
          "hiringSteps"
        ],
        "description": "Тексты брифа, которые шаблон кладёт в заявку. В списке поля brief — null.",
        "properties": {
          "tasks": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "hiringSteps": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacancyTemplateProfile": {
        "type": "object",
        "required": [
          "experience",
          "skills",
          "education",
          "stoppers"
        ],
        "description": "Портрет кандидата, который шаблон кладёт в заявку. В списке поля profile — null.",
        "properties": {
          "experience": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "skills": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "education": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "stoppers": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacancyTemplateAudience": {
        "type": "object",
        "required": [
          "departmentId",
          "includeChildren",
          "name",
          "missing"
        ],
        "description": "Отдел Битрикс24 аудитории: шаблон виден в каталоге заявок тем, кто в нём состоит.",
        "properties": {
          "departmentId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Номер отдела в Б24 — id из пикера отделов."
          },
          "includeChildren": {
            "type": "boolean",
            "description": "Вместе с подразделениями отдела."
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название отдела из снимка Б24. null — строки отдела в снимке нет: у аудитории нет внешнего ключа на снимок."
          },
          "missing": {
            "type": "boolean",
            "description": "Отдела нет в снимке или он помечен пропавшим из Б24 (missing_since)."
          }
        }
      },
      "VacancyTemplateAudienceWrite": {
        "type": "object",
        "required": [
          "departmentId",
          "includeChildren"
        ],
        "description": "Отдел аудитории в теле записи: чтение несёт ещё name и missing, запись их не принимает.",
        "properties": {
          "departmentId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Номер отдела в Б24 — id из пикера отделов."
          },
          "includeChildren": {
            "type": "boolean",
            "description": "Вместе с подразделениями отдела."
          }
        }
      },
      "VacancyTemplate": {
        "type": "object",
        "description": "Шаблон вакансии: настройка, по которой заказчик подаёт заявку. Одна форма на список и карточку; список не несёт длинных текстов и наборов (description — null, в списке поля brief и profile — null, reasons, channels — пустые). Условия заявки (legalEntity, employmentType, marketReview, salaryComment, languages, location, timezone, workSchedule, customerWishes, files, observers) несёт только ответ об одном шаблоне — карточка, POST и PATCH; в строке списка этих ключей нет вовсе. В карточке пустое значение условия — тоже отсутствие ключа; marketReview карточка отдаёт всегда.",
        "required": [
          "id",
          "title",
          "description",
          "group",
          "positionTitle",
          "positionUsable",
          "companyId",
          "companyArchived",
          "interviewerId",
          "routeId",
          "routeTitle",
          "recruiterId",
          "interviewerActive",
          "recruiterActive",
          "interviewer",
          "recruiter",
          "headcount",
          "headcountMax",
          "deadlineDays",
          "salaryMin",
          "salaryMax",
          "salaryHidden",
          "salaryMasked",
          "currency",
          "workFormat",
          "brief",
          "profile",
          "modes",
          "audienceAll",
          "audience",
          "reasons",
          "channels",
          "requests",
          "archived",
          "createdAt",
          "updatedAt",
          "massHiring",
          "offerApprovalRequired"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда выбирать шаблон — это читает заказчик в каталоге. В списке — null."
          },
          "group": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Группа для раскладки каталога, свободная строка."
          },
          "positionTitle": {
            "type": "string",
            "description": "Должность названием. Всегда fixed."
          },
          "positionUsable": {
            "type": "boolean",
            "description": "Должность доступна для заявки и не в архиве. false — по шаблону сейчас не подать: в каталог он не попадёт."
          },
          "companyId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Профиль компании; null — не задан."
          },
          "companyArchived": {
            "type": "boolean",
            "description": "Профиль ушёл в архив: в заявку он не скопируется, поле останется пустым."
          },
          "interviewerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Интервьюер — человек сервиса; null — не задан."
          },
          "routeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Маршрут согласования; null — маршрут по должности или умолчанию портала."
          },
          "routeTitle": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название маршрута для грида; null — маршрута нет."
          },
          "recruiterId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Рекрутер по умолчанию; null — не задан."
          },
          "interviewerActive": {
            "type": "boolean",
            "description": "Интервьюер задан и работает; true и без интервьюера. false — он ушёл в архив: заявка по шаблону его не получит, форма шаблона предупреждает."
          },
          "recruiterActive": {
            "type": "boolean",
            "description": "Рекрутер задан и работает; true и без рекрутера. false — он ушёл в архив."
          },
          "interviewer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Интервьюер с именем для выбора человека (то же лицо, что interviewerId); null — не задан."
          },
          "recruiter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Рекрутер с именем для выбора человека (то же лицо, что recruiterId); null — не задан."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "description": "Число людей по умолчанию."
          },
          "headcountMax": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Потолок числа людей; null — без своего потолка."
          },
          "deadlineDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок закрытия — дней от создания заявки."
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки. Десятичное СТРОКОЙ, как у вакансии: разбирайте десятичным типом; валюту называет поле currency. Вилка скрытого шаблона (режим salary = hidden) приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null (спека шаблонов § 7.5)."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки. Десятичное СТРОКОЙ, как у вакансии: разбирайте десятичным типом; валюту называет поле currency."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Режим вилки hidden: заказчик её не видит. Приходит всегда, и тем, кому вилка видна, тоже."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Вилка шаблона скрыта ОТ ЭТОГО смотрящего: режим hidden и правка вакансий ниже all. Приходит всегда; только этот признак отличает скрытую вилку от незаданной — режим hidden бывает и без границ."
          },
          "currency": {
            "type": "string",
            "description": "Валюта вилки. Ставит сервер, не правится."
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат работы: код словаря WorkFormatCode или прежний свободный текст — его показывают как есть."
          },
          "brief": {
            "$ref": "#/components/schemas/VacancyTemplateBrief"
          },
          "profile": {
            "$ref": "#/components/schemas/VacancyTemplateProfile"
          },
          "modes": {
            "$ref": "#/components/schemas/VacancyTemplateModes"
          },
          "audienceAll": {
            "type": "boolean",
            "description": "Шаблон виден всему порталу; иначе — отделам audience."
          },
          "audience": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateAudience"
            },
            "description": "Отделы аудитории по номеру отдела."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Допустимые причины открытия названиями. В списке пусто."
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateChannel"
            },
            "description": "Площадки по умолчанию. В списке пусто."
          },
          "requests": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько вакансий заведено по шаблону."
          },
          "archived": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "massHiring": {
            "type": "boolean"
          },
          "legalEntity": {
            "$ref": "#/components/schemas/TermsLegalEntity"
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode. Код вне словаря (словарь сузился) приходит как хранится — покажите его как есть. Нет ключа — не задан."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. В карточке приходит всегда, false тоже."
          },
          "salaryComment": {
            "type": "string",
            "maxLength": 10000,
            "description": "Комментарий про деньги. Скрыт вместе с вилкой: при режиме salary = hidden смотрящему без правки вакансий на уровне all ключа нет (как salaryMin и salaryMax — null, salaryMasked = true). Нет ключа и при пустом комментарии."
          },
          "languages": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LanguageCode"
                },
                {
                  "type": "string"
                }
              ]
            },
            "description": "Языки: коды словаря LanguageCode, без порядка. Нет ключа — языки не заданы."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "Локация: код словаря LocationCode или прежний код вне словаря — как хранится. Нет ключа — не задана."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA. Пояс, выпавший из tzdata, приходит прежним. Нет ключа — не задан."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "string"
              }
            ],
            "description": "График: код словаря WorkScheduleCode или прежний код вне словаря — как хранится. Нет ключа — не задан."
          },
          "customerWishes": {
            "type": "string",
            "maxLength": 10000,
            "description": "Пожелания заказчика. Нет ключа — не заданы."
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsFile"
            },
            "description": "Файлы условий. Ключу API — без files[].id: файлы прикладывает и скачивает только кабинет. Нет ключа — файлов нет."
          },
          "observers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TermsObserver"
            },
            "description": "Наблюдатели — сотрудники Битрикс24. Ключу API — только observers[].id: снимок людей Битрикс24 ключу закрыт. Нет ключа — наблюдателей нет."
          },
          "callPlanId": {
            "type": "string",
            "format": "uuid"
          },
          "callPlanRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "deprecated": true,
            "description": "Всегда true: новая вакансия по шаблону — с согласованием оффера. Приходит и в строке списка, и в карточке."
          },
          "departmentId": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "departmentName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "departmentMissing": {
            "type": "boolean"
          },
          "accessMode": {
            "type": "string",
            "enum": [
              "legacy",
              "heads"
            ]
          },
          "createdBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Автор шаблона; null — человек недоступен.",
            "readOnly": true
          },
          "updatedBy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто последним изменил шаблон; null — человек неизвестен или запись сделана системой.",
            "readOnly": true
          }
        }
      },
      "VacancyTemplateCard": {
        "description": "Карточка шаблона и ответ после записи. Версия флага соответствует чтению, определившему видимость Telegram в наборе channels. При ошибке чтения флага версия отсутствует.",
        "allOf": [
          {
            "$ref": "#/components/schemas/VacancyTemplate"
          },
          {
            "type": "object",
            "properties": {
              "telegramScenariosVersion": {
                "$ref": "#/components/schemas/TelegramScenariosVersion"
              }
            }
          }
        ]
      },
      "VacancyTemplateListResponse": {
        "type": "object",
        "required": [
          "templates",
          "emptyReason"
        ],
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplate"
            }
          },
          "emptyReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none_configured",
                  "none_available",
                  "no_matches"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the accessible catalog is empty. none_configured requires template-edit admin with template-view permission and full configured-set proof; no hidden counts or IDs."
          }
        }
      },
      "VacancyTemplateBriefWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "Правка брифа шаблона: ключа нет — не трогать, null или пустая строка — снять.",
        "properties": {
          "tasks": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "hiringSteps": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacancyTemplateProfileWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "Правка портрета кандидата: ключа нет — не трогать, null или пустая строка — снять.",
        "properties": {
          "experience": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "skills": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "education": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "stoppers": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacancyTemplateWrite": {
        "type": "object",
        "additionalProperties": false,
        "description": "Тело заведения и правки шаблона. Заведению нужны title и positionTitle. В правке ключа нет — поле не трогается; у полей, которые бывают пустыми, null и пустая строка снимают значение, у прочих null равен отсутствию ключа (кроме кодов условий и timezone — у них снимает только null, и marketReview и offerApprovalRequired — у них null отвергается). Наборы audience, reasons, channels, languages, fileIds и observerIds заменяются целиком: пустой набор очищает. Правило замены modes — в VacancyTemplateModesWrite: коды условий заявки, не названные в нём, сохраняют режим.",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ]
          },
          "group": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "positionTitle": {
            "type": "string",
            "description": "Должность названием; при заведении и смене обязана быть доступной для заявки и не в архиве."
          },
          "companyId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Профиль компании из пикера профилей; null или пустая строка — снять."
          },
          "interviewerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Интервьюер из пикера людей; null или пустая строка — снять."
          },
          "routeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Маршрут из пикера маршрутов; null или пустая строка — снять."
          },
          "recruiterId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Рекрутер из пикера людей; null или пустая строка — снять."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535
          },
          "headcountMax": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "deadlineDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Десятичное СТРОКОЙ, как у вакансии: разбирайте десятичным типом; валюту называет поле currency."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Десятичное СТРОКОЙ, как у вакансии: разбирайте десятичным типом; валюту называет поле currency."
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ]
          },
          "brief": {
            "$ref": "#/components/schemas/VacancyTemplateBriefWrite"
          },
          "profile": {
            "$ref": "#/components/schemas/VacancyTemplateProfileWrite"
          },
          "modes": {
            "$ref": "#/components/schemas/VacancyTemplateModesWrite"
          },
          "audienceAll": {
            "type": "boolean"
          },
          "audience": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateAudienceWrite"
            }
          },
          "reasons": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Причины открытия названиями; новая заводится в справочнике причин."
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateChannel"
            }
          },
          "archived": {
            "type": "boolean",
            "description": "Архив шаблона; заведение ключ не читает."
          },
          "massHiring": {
            "type": "boolean",
            "description": "При создании отсутствие означает false; PATCH без поля сохраняет текущее значение."
          },
          "legalEntityId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Юрлицо, от которого открывается вакансия, — адрес из справочника юрлиц (LegalEntity.id); null или пустая строка — снять. Новое обязано быть действующим юрлицом портала, иначе 400 invalid_value, details.reason ref_rejected; уже стоящее не проверяется."
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. Снять нельзя: null — 400 invalid_value с полем marketReview; без ключа значение не трогается."
          },
          "salaryComment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий про деньги; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long. Скрыт вместе с вилкой: при хранимом режиме salary = hidden правка без vacancy · edit на уровне all, приславшая ключ (с любым значением, null тоже), получает 400 invalid_value с полем salaryComment."
          },
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageCode"
            },
            "description": "Языки — коды словаря LanguageCode, без порядка; набор заменяется целиком, [] очищает. Код вне словаря — 400 invalid_value, details.reason invalid; повтор — duplicate."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Локация: код словаря LocationCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA; null — снять. Пустая строка и имя, которого нет в tzdata, — 400 invalid_value, details.reason invalid; уже стоящий пояс не проверяется."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "График: код словаря WorkScheduleCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "customerWishes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания заказчика; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long."
          },
          "fileIds": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Файлы условий — адреса загрузок с назначением vacancy_attachment; набор заменяется целиком, [] очищает. Только кабинет: ключ API с этим ключом (с любым значением, null тоже) получает 400 invalid_value с полем fileIds. Сверх предела — details.reason too_many, повтор — duplicate. Новый файл обязан быть загрузкой автора правки, подтверждённой, не занятой и годной вложением (PDF, JPEG, PNG в пределах размера); иначе, как и при адресе, который не разбирается или порталу неизвестен, — details.reason file_rejected, одна причина на все случаи. Файлы, уже стоящие в шаблоне, не проверяются."
          },
          "observerIds": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "example": "42"
            },
            "description": "Наблюдатели — номера сотрудников Битрикс24 строкой, как TermsObserver.id; набор заменяется целиком, [] очищает. Сверх предела — 400 invalid_value, details.reason too_many; повтор номера — duplicate. Новый наблюдатель обязан быть в снимке людей Битрикс24 портала и работать; иначе, как и при строке, которая не номер, — details.reason ref_rejected. Уже стоящие не проверяются: ушедший наблюдатель не мешает прислать набор снова."
          },
          "callPlanId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedCallPlanRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "deprecated": true,
            "description": "Принимается и игнорируется: новая вакансия всегда с согласованием оффера. null — 400 invalid_value с полем offerApprovalRequired."
          },
          "departmentId": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "accessMode": {
            "type": "string",
            "enum": [
              "legacy",
              "heads"
            ]
          }
        }
      },
      "RequestTemplateItem": {
        "type": "object",
        "description": "Шаблон в каталоге «Новой заявки»: значения и режимы полей. Настроек процесса — маршрута, рекрутера, площадок, списка аудитории, счётчика заявок — здесь нет: заказчику их не показывают. Длинные тексты брифа и профиля отдаёт карточка шаблона; описание «когда выбирать» — здесь, по нему ищут в каталоге.",
        "required": [
          "id",
          "title",
          "description",
          "group",
          "positionTitle",
          "headcount",
          "headcountMax",
          "deadlineDays",
          "salaryMin",
          "salaryMax",
          "salaryHidden",
          "salaryMasked",
          "currency",
          "workFormat",
          "modes",
          "massHiring"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес шаблона."
          },
          "title": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда выбирать этот шаблон."
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Группа в каталоге; null — без группы."
          },
          "positionTitle": {
            "type": "string",
            "description": "Должность заявки. Из шаблона, в теле заявки её нет."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "description": "Число людей по умолчанию."
          },
          "headcountMax": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Потолок числа людей; null — только общий предел 65535."
          },
          "deadlineDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок закрытия в днях от подачи; null — срок не задан."
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки десятичным строкой. Вилка шаблона с режимом salary = hidden приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. В режиме range границы видны — заказчик выбирает внутри них."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Режим вилки hidden. Приходит всегда."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Вилка шаблона скрыта ОТ ЭТОГО смотрящего: режим hidden и правка вакансий ниже all. Приходит всегда; только этот признак отличает скрытую вилку от незаданной — режим hidden бывает и без границ."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат работы: код словаря WorkFormatCode или прежний свободный текст — его показывают как есть."
          },
          "modes": {
            "$ref": "#/components/schemas/VacancyTemplateModes"
          },
          "massHiring": {
            "type": "boolean"
          },
          "departmentId": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "departmentName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "departmentMissing": {
            "type": "boolean"
          }
        }
      },
      "RequestTemplateListResponse": {
        "type": "object",
        "required": [
          "templates",
          "emptyReason"
        ],
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestTemplateItem"
            },
            "description": "Шаблоны, видимые вызывающему по отделам, по названию."
          },
          "emptyReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none_configured",
                  "none_available",
                  "no_matches"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the accessible catalog is empty. none_configured requires template-edit admin with template-view permission and full configured-set proof; no hidden counts or IDs."
          }
        }
      },
      "RequestDepartment": {
        "type": "object",
        "description": "Отдел Б24 для выбора в заявке.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Номер отдела в Б24; его присылают полем department."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RequestTemplate": {
        "description": "Карточка шаблона для формы заявки: строка каталога, тексты брифа и профиля, допустимые причины открытия и отделы вызывающего, попавшие в аудиторию шаблона. Несёт условия заявки шаблона (legalEntity … observers) — в отличие от строки каталога; salaryComment скрыт по правилу шаблона: при режиме salary = hidden смотрящему без правки вакансий на уровне all ключа нет.",
        "allOf": [
          {
            "$ref": "#/components/schemas/RequestTemplateItem"
          },
          {
            "type": "object",
            "required": [
              "brief",
              "profile",
              "reasons",
              "departments",
              "offerApprovalRequired"
            ],
            "properties": {
              "brief": {
                "$ref": "#/components/schemas/VacancyTemplateBrief"
              },
              "profile": {
                "$ref": "#/components/schemas/VacancyTemplateProfile"
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Допустимые причины открытия: список шаблона, а у шаблона без списка — причины портала и готовые формулировки сервиса. Свободного текста заявка не принимает."
              },
              "departments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RequestDepartment"
                },
                "description": "Отделы, где вызывающий состоит и которые попали в аудиторию. Один — берётся сам, несколько — поле department обязательно, пусто — отдел у заявки не заполняется."
              },
              "legalEntity": {
                "$ref": "#/components/schemas/TermsLegalEntity"
              },
              "employmentType": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/EmploymentTypeCode"
                  },
                  {
                    "type": "string"
                  }
                ],
                "description": "Формат оформления: код словаря EmploymentTypeCode. Код вне словаря (словарь сузился) приходит как хранится — покажите его как есть. Нет ключа — не задан."
              },
              "marketReview": {
                "type": "boolean",
                "description": "Нужен ли обзор рынка зарплат. В карточке приходит всегда, false тоже."
              },
              "salaryComment": {
                "type": "string",
                "maxLength": 10000,
                "description": "Комментарий про деньги. Скрыт вместе с вилкой: при режиме salary = hidden смотрящему без правки вакансий на уровне all ключа нет (как salaryMin и salaryMax — null, salaryMasked = true). Нет ключа и при пустом комментарии."
              },
              "languages": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/LanguageCode"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "description": "Языки: коды словаря LanguageCode, без порядка. Нет ключа — языки не заданы."
              },
              "location": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LocationCode"
                  },
                  {
                    "type": "string"
                  }
                ],
                "description": "Локация: код словаря LocationCode или прежний код вне словаря — как хранится. Нет ключа — не задана."
              },
              "timezone": {
                "type": "string",
                "maxLength": 64,
                "example": "Europe/Moscow",
                "description": "Часовой пояс, имя IANA. Пояс, выпавший из tzdata, приходит прежним. Нет ключа — не задан."
              },
              "workSchedule": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WorkScheduleCode"
                  },
                  {
                    "type": "string"
                  }
                ],
                "description": "График: код словаря WorkScheduleCode или прежний код вне словаря — как хранится. Нет ключа — не задан."
              },
              "customerWishes": {
                "type": "string",
                "maxLength": 10000,
                "description": "Пожелания заказчика. Нет ключа — не заданы."
              },
              "files": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TermsFile"
                },
                "description": "Файлы условий. Ключу API — без files[].id: файлы прикладывает и скачивает только кабинет. Нет ключа — файлов нет."
              },
              "observers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TermsObserver"
                },
                "description": "Наблюдатели — сотрудники Битрикс24. Ключу API — только observers[].id: снимок людей Битрикс24 ключу закрыт. Нет ключа — наблюдателей нет."
              },
              "offerApprovalRequired": {
                "type": "boolean",
                "deprecated": true,
                "description": "Всегда true: новая вакансия по шаблону — с согласованием оффера. Строка каталога (RequestTemplateItem) его не несёт."
              }
            }
          }
        ]
      },
      "VacancyTemplateChoice": {
        "description": "Шаблон в выборе «Плана найма»: строка каталога, причины открытия списка шаблона и отделы вызывающего для поля department операции POST /api/v1/vacancies.",
        "allOf": [
          {
            "$ref": "#/components/schemas/RequestTemplateItem"
          },
          {
            "type": "object",
            "required": [
              "reasons",
              "departments",
              "offerApprovalRequired"
            ],
            "properties": {
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Причины открытия из списка шаблона — ниже права vacancy · edit на уровне all openReasonTitle выбирается из них; одна — берётся сама, если причину не прислать. Пусто — годится существующая причина открытия портала или готовая формулировка сервиса. При all причина любая."
              },
              "departments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RequestDepartment"
                },
                "description": "Отделы, где вызывающий состоит и которые попали в аудиторию шаблона. Один — берётся сам, несколько — поле department обязательно, пусто — отдел не заполняется. При праве vacancy · edit на уровне all всегда пусто: годится любой живой отдел, не прислан — не заполняется."
              },
              "offerApprovalRequired": {
                "type": "boolean",
                "deprecated": true,
                "description": "Всегда true: новая вакансия по шаблону — с согласованием оффера. Строка каталога (RequestTemplateItem) его не несёт."
              }
            }
          }
        ]
      },
      "VacancyTemplateChoiceResponse": {
        "type": "object",
        "required": [
          "choices",
          "emptyReason"
        ],
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateChoice"
            },
            "description": "Шаблоны для выбора, по названию."
          },
          "emptyReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none_configured",
                  "none_available",
                  "no_matches"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the accessible catalog is empty. none_configured requires template-edit admin with template-view permission and full configured-set proof; no hidden counts or IDs."
          }
        }
      },
      "VacancyTemplateApplyRequest": {
        "type": "object",
        "description": "Тело применения шаблона к черновикам.",
        "required": [
          "ids",
          "fingerprint"
        ],
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Адреса заявок из предпросмотра, не больше 100 за вызов. Пустой список или адрес, который не разбирается, — invalid_value с полем ids; больше предела — template_apply_too_many."
          },
          "fingerprint": {
            "type": "string",
            "minLength": 1,
            "description": "Отпечаток из предпросмотра. Не совпал с состоянием шаблона — 409 template_apply_stale."
          }
        }
      },
      "VacancyTemplateApplySkippedField": {
        "type": "object",
        "description": "Поле, которое шаблон изменил бы, но не меняет.",
        "required": [
          "field",
          "reason"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Имя поля контракта: positionTitle, headcount, salaryMin, salaryMax, salaryHidden, companyId, interviewerId, а у условий заявки — ключи записи legalEntityId, observerIds, salaryComment и так далее."
          },
          "reason": {
            "type": "string",
            "enum": [
              "unavailable",
              "archived",
              "inactive",
              "order",
              "unreadable"
            ],
            "description": "unavailable — должность шаблона снята с «доступна для заявки» или в архиве; archived — профиль компании шаблона в архиве; inactive — интервьюер шаблона больше не работает, юрлицо шаблона не действующее или наблюдатели шаблона ушли: значение заявки остаётся прежним, у наблюдателей причина одна на поле, а остальные наблюдатели переносятся; order — граница вилки шаблона поверх другой границы заявки дала бы вилку наоборот; unreadable — тексты заявки не читаются, вилка остаётся скрытой: поля вилки (salaryMin, salaryMax, salaryHidden, salaryComment), которые раскрытие изменило бы, не пишутся."
          }
        }
      },
      "VacancyTemplateApplyItem": {
        "type": "object",
        "description": "Заявка предпросмотра применения шаблона.",
        "required": [
          "id",
          "number",
          "position",
          "stage",
          "fields",
          "skipped"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес заявки."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер заявки; null, пока номера нет."
          },
          "position": {
            "type": "string",
            "description": "Название должности заявки."
          },
          "stage": {
            "$ref": "#/components/schemas/VacancyStage"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Поля, которые применение изменит, по именам контракта; условия заявки — ключами записи: legalEntityId, employmentType, marketReview, salaryComment, languages, location, timezone, workSchedule, customerWishes, fileIds, observerIds. Пустой массив — менять нечего."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplySkippedField"
            },
            "description": "Поля, которые шаблон изменил бы, но не меняет, с причиной. Всегда массив."
          },
          "removedAuthorFiles": {
            "type": "integer",
            "minimum": 1,
            "description": "Сколько файлов автора (файлов заявки вне набора шаблона) снимет замена fileIds: после применения уборка удалит их безвозвратно. Нет ключа — снимать нечего."
          }
        }
      },
      "VacancyTemplateApplyRevealItem": {
        "type": "object",
        "description": "Заявка, у которой скрытая вилка станет видна заказчику: строка предпросмотра и числа, которые он увидит.",
        "allOf": [
          {
            "$ref": "#/components/schemas/VacancyTemplateApplyItem"
          },
          {
            "type": "object",
            "required": [
              "salaryMin",
              "salaryMax"
            ],
            "properties": {
              "salaryMin": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Нижняя граница вилки после применения (значение шаблона); null — пуста."
              },
              "salaryMax": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Верхняя граница вилки после применения; null — пуста."
              }
            }
          }
        ]
      },
      "VacancyTemplateApplyUntouched": {
        "type": "object",
        "description": "Заявка шаблона, которую применение не трогает: она не на draft и не на rejected.",
        "required": [
          "id",
          "number",
          "position",
          "stage"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес заявки."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер заявки; null, пока номера нет."
          },
          "position": {
            "type": "string",
            "description": "Название должности заявки."
          },
          "stage": {
            "$ref": "#/components/schemas/VacancyStage"
          }
        }
      },
      "VacancyTemplateApplyPreview": {
        "type": "object",
        "description": "Предпросмотр применения шаблона к черновикам.",
        "required": [
          "fingerprint",
          "change",
          "reveal",
          "nothing",
          "untouched",
          "truncated",
          "scanTruncated",
          "untouchedTruncated"
        ],
        "properties": {
          "fingerprint": {
            "type": "string",
            "description": "Отпечаток состояния шаблона; уходит в тело POST .../apply."
          },
          "change": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplyItem"
            },
            "description": "Заявки, у которых применение изменит поля."
          },
          "reveal": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplyRevealItem"
            },
            "description": "Заявки, у которых применение изменит поля и откроет вилку заказчику. Вместе с change — не больше 1000."
          },
          "nothing": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplyItem"
            },
            "description": "Заявки, у которых значения уже совпадают с шаблоном. Сверх предела отбрасываются без признака."
          },
          "untouched": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplyUntouched"
            },
            "description": "Заявки шаблона вне draft и rejected: применение их не меняет."
          },
          "truncated": {
            "type": "boolean",
            "description": "change и reveal показаны не все: изменяемых больше 1000. Применённые становятся nothing, и следующий предпросмотр покажет остальные."
          },
          "scanTruncated": {
            "type": "boolean",
            "description": "Просмотр целей упёрся в 10000 заявок, а изменяемые не набрали 1000: дальние цели не проверены, и после применения показанных они не появятся. Не бывает true вместе с truncated."
          },
          "untouchedTruncated": {
            "type": "boolean",
            "description": "untouched показаны не все — первые 1000."
          }
        }
      },
      "VacancyTemplateApplySkippedRequest": {
        "type": "object",
        "description": "Заявка списка, которую применение пропустило.",
        "required": [
          "id",
          "reason"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string",
            "enum": [
              "stage",
              "template",
              "archived",
              "not_found",
              "nothing",
              "headcount"
            ],
            "description": "stage — заявка ушла с draft и rejected; template — у заявки другой шаблон или его нет; archived — заявка в архиве, архивная не меняется; not_found — заявки с таким адресом в портале нет; nothing — значения уже совпадают с шаблоном; headcount — число людей шаблона ниже уже вышедших на работу: заявка не меняется целиком, ни одно поле не пишется."
          }
        }
      },
      "VacancyTemplateApplyResult": {
        "type": "object",
        "description": "Итог применения шаблона к черновикам.",
        "required": [
          "applied",
          "skipped"
        ],
        "properties": {
          "applied": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Применённые заявки в порядке списка."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyTemplateApplySkippedRequest"
            },
            "description": "Пропущенные заявки с причиной."
          }
        }
      },
      "RequestProgress": {
        "type": "object",
        "description": "Открытый круг согласования: решено шагов decided из total и виды субъектов шагов в ожидании. Имя явного человека доступно в waitingSubjects.person, если смотрящему разрешён просмотр этого пользователя.",
        "required": [
          "decided",
          "total",
          "waitingKinds"
        ],
        "properties": {
          "decided": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "waitingKinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "user",
                "b24_user",
                "b24_dept_head",
                "author_dept_head",
                "any_dept_head",
                "role"
              ]
            },
            "description": "В последовательном режиме — один вид, в параллельном — все виды ждущих шагов."
          },
          "mode": {
            "type": "string",
            "enum": [
              "sequential",
              "parallel"
            ]
          },
          "waitingSubjects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalSubject"
            }
          }
        }
      },
      "RequestListItem": {
        "description": "Строка «Моих заявок»: вакансия, название шаблона и прогресс круга.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Vacancy"
          },
          {
            "type": "object",
            "required": [
              "templateTitle",
              "progress",
              "creationMode"
            ],
            "properties": {
              "templateTitle": {
                "type": "string",
                "description": "Название шаблона; пустая строка у самостоятельной заявки."
              },
              "progress": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RequestProgress"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "null — круга нет: заявка не на согласовании."
              },
              "process": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ApprovalProcess"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Personal cookie/embed projection only; omitted for API keys and for drafts without a launch. API keys retain the existing request-list fields and receive no new process history."
              },
              "creationMode": {
                "type": "string",
                "enum": [
                  "template",
                  "blank"
                ],
                "description": "Способ создания: по шаблону или самостоятельно."
              }
            }
          }
        ]
      },
      "RequestListResponse": {
        "type": "object",
        "required": [
          "requests",
          "nextCursor"
        ],
        "properties": {
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestListItem"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы; null — страница последняя."
          }
        }
      },
      "RequestTerms": {
        "type": "object",
        "description": "ТЕКУЩИЙ шаблон заявки глазами формы правки: режимы полей, потолок числа людей, границы вилки для режима range и допустимые причины открытия. Аудитория и архив на него не действуют: заявку открывает авторство.",
        "required": [
          "id",
          "title",
          "archived",
          "headcountMax",
          "salaryMin",
          "salaryMax",
          "salaryHidden",
          "salaryMasked",
          "currency",
          "modes",
          "reasons"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "archived": {
            "type": "boolean",
            "description": "Шаблон в архиве. Правка заявки по его режимам продолжается."
          },
          "headcountMax": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки шаблона. Вилка шаблона с режимом salary = hidden приходит смотрящему без правки вакансий на уровне all как salaryMin и salaryMax = null при salaryHidden = true. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. В режиме range границы видны — заказчик выбирает внутри них."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки шаблона."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Режим вилки шаблона hidden. Приходит всегда."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Вилка шаблона скрыта ОТ ЭТОГО смотрящего: режим hidden и правка вакансий ниже all. Приходит всегда; только этот признак отличает скрытую вилку от незаданной — режим hidden бывает и без границ."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "modes": {
            "$ref": "#/components/schemas/VacancyTemplateModes"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Request": {
        "description": "Карточка своей заявки обоих способов создания: creationMode=blank имеет template=null и отдельные openReasons; creationMode=template сохраняет прежний объект template. Той же отфильтрованной и маскированной формой отвечают GET, POST и PATCH. Карточка заявки: вакансия, её текущий шаблон, бриф и профиль, отделы для выбора и прогресс круга. Той же формой отвечают заведение и правка. Вилка вакансии: salaryMin и salaryMax приходят null, когда сходятся три условия — у заявки снимок salaryHidden = true, вызывающий — её автор, и правка вакансий у него ниже уровня all. Признак salaryHidden приходит всегда. Отличить скрытую вилку от незаданной позволяет именно он.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Vacancy"
          },
          {
            "type": "object",
            "required": [
              "template",
              "brief",
              "profile",
              "departments",
              "progress",
              "creationMode",
              "openReasons"
            ],
            "properties": {
              "template": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RequestTerms"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Обязательное поле: текущий шаблон или null у самостоятельной заявки."
              },
              "brief": {
                "$ref": "#/components/schemas/VacancyBrief",
                "description": "Бриф заявки. textsUnreadable = true — тексты лежат шифротекстом, который сервер не открыл: tasks, conditions, schedule и hiringSteps приходят null, структурные поля — как есть; правка заявки такие тексты не трогает."
              },
              "profile": {
                "$ref": "#/components/schemas/VacancyCandidateProfile",
                "description": "Портрет кандидата заявки. textsUnreadable = true — как у brief: тексты null, правка заявки их не трогает."
              },
              "departments": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RequestDepartment"
                },
                "description": "Отделы вызывающего, годные в отдел заявки."
              },
              "progress": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RequestProgress"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "null — круга нет."
              },
              "creationMode": {
                "type": "string",
                "enum": [
                  "template",
                  "blank"
                ],
                "description": "Способ создания: по шаблону или самостоятельно."
              },
              "openReasons": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Допустимые причины самостоятельной заявки. У шаблонной заявки пустой массив: причины остаются в template.reasons."
              }
            }
          }
        ],
        "examples": [
          {
            "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
            "number": null,
            "publishedAt": null,
            "position": "Сварщик",
            "headcount": 3,
            "openReason": "Расширение штата",
            "desiredStartDate": "2026-11-02",
            "deadline": "2026-10-30",
            "salaryMin": null,
            "salaryMax": null,
            "salaryHidden": true,
            "salaryMasked": true,
            "currency": "RUB",
            "justification": "Цех выходит на вторую смену с ноября.",
            "department": 12,
            "departmentName": "Отдел продаж",
            "departmentMissing": false,
            "interviewer": {
              "id": "0199a1f0-7a8b-7c9d-8e0f-1a2b3c4d5e6f",
              "name": "Одинцова Мария Павловна"
            },
            "recruiter": null,
            "company": null,
            "stage": "draft",
            "closeReason": null,
            "allowedStages": [],
            "createdAt": "2026-09-30T09:00:00Z",
            "activeApplications": null,
            "template": {
              "id": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
              "title": "Сварщик цеха",
              "archived": false,
              "headcountMax": 5,
              "salaryMin": null,
              "salaryMax": null,
              "salaryHidden": true,
              "salaryMasked": true,
              "currency": "RUB",
              "modes": {
                "headcount": "author",
                "deadline": "author",
                "salary": "hidden",
                "work_format": "fixed",
                "brief_tasks": "author",
                "brief_conditions": "fixed",
                "brief_schedule": "fixed",
                "brief_hiring_steps": "fixed",
                "profile_experience": "author",
                "profile_skills": "author",
                "profile_education": "author",
                "profile_stoppers": "fixed"
              },
              "reasons": [
                "Расширение штата",
                "Замена сотрудника"
              ]
            },
            "brief": {
              "tasks": "Сварка металлоконструкций по чертежам.",
              "conditions": "Смена 2/2, спецодежда.",
              "schedule": "2/2 по 12 часов",
              "hiringSteps": "Собеседование с мастером, пробная сварка.",
              "regionId": null,
              "professionId": null,
              "workFormat": "on_site"
            },
            "profile": {
              "experience": "От года на производстве.",
              "skills": "Аргонодуговая сварка.",
              "education": null,
              "stoppers": "Нет допуска НАКС."
            },
            "departments": [
              {
                "id": 12,
                "name": "Цех металлоконструкций"
              }
            ],
            "progress": null,
            "scenario": "regular",
            "marketReview": false,
            "languages": [
              "ru"
            ],
            "workSchedule": "5_2",
            "offerApprovalRequired": true,
            "creationMode": "template",
            "openReasons": []
          },
          {
            "id": "0199a2b4-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
            "number": null,
            "publishedAt": null,
            "position": "Сварщик",
            "headcount": 3,
            "openReason": "Расширение штата",
            "desiredStartDate": "2026-11-02",
            "deadline": "2026-10-30",
            "salaryMin": null,
            "salaryMax": null,
            "salaryHidden": false,
            "salaryMasked": false,
            "currency": "RUB",
            "justification": "Цех выходит на вторую смену с ноября.",
            "department": 12,
            "departmentName": "Отдел продаж",
            "departmentMissing": false,
            "interviewer": null,
            "recruiter": null,
            "company": null,
            "stage": "draft",
            "closeReason": null,
            "allowedStages": [],
            "createdAt": "2026-09-30T09:00:00Z",
            "activeApplications": null,
            "template": null,
            "brief": {
              "tasks": "Сварка металлоконструкций по чертежам.",
              "conditions": "Смена 2/2, спецодежда.",
              "schedule": "2/2 по 12 часов",
              "hiringSteps": "Собеседование с мастером, пробная сварка.",
              "regionId": null,
              "professionId": null,
              "workFormat": "on_site"
            },
            "profile": {
              "experience": "От года на производстве.",
              "skills": "Аргонодуговая сварка.",
              "education": null,
              "stoppers": "Нет допуска НАКС."
            },
            "departments": [
              {
                "id": 12,
                "name": "Цех металлоконструкций"
              }
            ],
            "progress": null,
            "scenario": "regular",
            "marketReview": false,
            "languages": [
              "ru"
            ],
            "workSchedule": "5_2",
            "offerApprovalRequired": true,
            "creationMode": "blank",
            "openReasons": [
              "Расширение штата"
            ]
          }
        ]
      },
      "RequestCreateBody": {
        "type": "object",
        "additionalProperties": false,
        "description": "Заявка по шаблону или самостоятельная. UUID templateId выбирает шаблон; positionTitle в этой ветке запрещён, в том числе null. Отсутствующий или null templateId выбирает самостоятельную заявку draft/regular с обязательными доступной positionTitle и допустимой openReasonTitle. Пустой templateId — 400 invalid_value, неправильный непустой UUID или недоступный шаблон — прежний 404 not_found; ошибочная ссылка не переключает ветку. Поля происхождения, этапа, массовости, автора и заказчика не принимаются. Поля шаблона присылаются только с режимом author или range. Поле с режимом fixed, присланное со значением, отличным от текущего, — invalid_value, а не молчаливое игнорирование; равное проходит. Вилку, скрытую от автора (режим hidden у заведения, снимок salaryHidden у правки), не присылают вовсе: ключ salaryMin или salaryMax отвергается с любым значением. Условия заявки (legalEntityId … observerIds) — та же форма, что в теле шаблона: ключа нет — не трогать, null у кодов, пояса, текстов и юрлица — снять, у наборов — не трогать.",
        "required": [
          "openReasonTitle"
        ],
        "properties": {
          "templateId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Шаблон из каталога; отсутствие или null выбирает самостоятельное создание."
          },
          "department": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Идентификатор отдела из departments. Для самостоятельной заявки список возвращает GET /api/v1/requests/create-context, для шаблонной — GET /api/v1/requests/templates/{id} с учётом аудитории шаблона. При нескольких отделах выберите один. Если поле пропущено или равно null, сервер подставит единственный отдел или оставит заявку без отдела при пустом списке."
          },
          "openReasonTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "В самостоятельной заявке укажите название из GET /api/v1/requests/pickers/reasons. Для шаблона выберите причину из reasons карточки шаблона. Пустая строка подставляет единственную заданную в шаблоне причину."
          },
          "justification": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Обоснование."
          },
          "desiredStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535,
            "description": "Число людей от 1 до 65535. У самостоятельной заявки отсутствие означает 1; null запрещён. У шаблонной заявки действует потолок и режим шаблона."
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок закрытия; null или пустая строка — снять."
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки десятичным строкой."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки."
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат работы: код словаря WorkFormatCode или прежний свободный текст — его показывают как есть."
          },
          "brief": {
            "$ref": "#/components/schemas/VacancyTemplateBriefWrite"
          },
          "profile": {
            "$ref": "#/components/schemas/VacancyTemplateProfileWrite"
          },
          "legalEntityId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Юрлицо, от которого открывается вакансия, — адрес из справочника юрлиц (LegalEntity.id); null или пустая строка — снять. Новое обязано быть действующим юрлицом портала, иначе 400 invalid_value, details.reason ref_rejected; равное текущему не проверяется."
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. Снять нельзя: null — 400 invalid_value с полем marketReview; без ключа значение не трогается."
          },
          "salaryComment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий про деньги; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long. Скрыт вместе с вилкой: если вилка заявки скрыта от вызывающего (режим hidden у заведения, снимок salaryHidden у правки), ключ с любым значением, null тоже, — 400 invalid_value с полем salaryComment, как salaryMin и salaryMax."
          },
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageCode"
            },
            "description": "Языки — коды словаря LanguageCode, без порядка; набор заменяется целиком, [] очищает. Код вне словаря — 400 invalid_value, details.reason invalid; повтор — duplicate."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Локация: код словаря LocationCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA; null — снять. Пустая строка и имя, которого нет в tzdata, — 400 invalid_value, details.reason invalid; уже стоящий пояс не проверяется."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "График: код словаря WorkScheduleCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "customerWishes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания заказчика; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long."
          },
          "fileIds": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Файлы условий — адреса загрузок с назначением vacancy_attachment; набор заменяется целиком, [] очищает. Только кабинет: ключ API с этим ключом (с любым значением, null тоже) получает 400 invalid_value с полем fileIds. Сверх предела — details.reason too_many, повтор — duplicate. Новый файл обязан быть загрузкой автора правки, подтверждённой, не занятой и годной вложением (PDF, JPEG, PNG в пределах размера); иначе, как и при адресе, который не разбирается или порталу неизвестен, — details.reason file_rejected, одна причина на все случаи. Файлы, уже стоящие у заявки или в её шаблоне, не проверяются."
          },
          "observerIds": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "example": "42"
            },
            "description": "Наблюдатели — номера сотрудников Битрикс24 строкой, как TermsObserver.id. Наблюдателей задаёт шаблон, режим у них всегда fixed: набор, отличный от текущего (без учёта порядка), — 400 invalid_value с полем observerIds на любом уровне прав; равный проходит. Сверх предела — details.reason too_many; повтор номера — duplicate."
          },
          "offerApprovalRequired": {
            "type": "boolean",
            "deprecated": true,
            "description": "Принимается и игнорируется: новая вакансия всегда с согласованием оффера. null — 400 invalid_value с полем offerApprovalRequired. PATCH /requests поля не принимает."
          },
          "positionTitle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Существующая доступная должность портала; null и пустая строка — 400 invalid_value с полем positionTitle."
          }
        },
        "oneOf": [
          {
            "required": [
              "templateId"
            ],
            "properties": {
              "templateId": {
                "type": "string",
                "format": "uuid"
              },
              "positionTitle": false
            },
            "not": {
              "required": [
                "positionTitle"
              ]
            }
          },
          {
            "required": [
              "positionTitle"
            ],
            "properties": {
              "templateId": {
                "type": "null"
              },
              "positionTitle": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "openReasonTitle": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        ],
        "examples": [
          {
            "templateId": "0199a1f0-5b6c-7d8e-9f0a-1b2c3d4e5f60",
            "department": 12,
            "openReasonTitle": "Расширение штата",
            "justification": "Цех выходит на вторую смену.",
            "desiredStartDate": "2026-11-02",
            "headcount": 2,
            "deadline": "2026-10-30",
            "brief": {
              "tasks": "Сварка металлоконструкций по чертежам."
            },
            "languages": [
              "ru"
            ],
            "workSchedule": "5_2"
          },
          {
            "positionTitle": "Сварщик",
            "openReasonTitle": "Расширение штата",
            "headcount": 1
          }
        ]
      },
      "RequestPatchBody": {
        "type": "object",
        "additionalProperties": false,
        "description": "Правка самостоятельной или шаблонной заявки. Должность самостоятельного черновика меняется только на доступную; неприсланная сохраняется. Правка заявки: ключа нет — поле не трогается. Шаблон не меняется: другой шаблон — новая заявка. Поля шаблона присылаются только с режимом author или range. Поле с режимом fixed, присланное со значением, отличным от текущего, — invalid_value, а не молчаливое игнорирование; равное проходит. Вилку, скрытую от автора (режим hidden у заведения, снимок salaryHidden у правки), не присылают вовсе: ключ salaryMin или salaryMax отвергается с любым значением. Условия заявки (legalEntityId … observerIds) — та же форма, что в теле шаблона: ключа нет — не трогать, null у кодов, пояса, текстов и юрлица — снять, у наборов — не трогать.",
        "properties": {
          "department": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отдел из departments карточки заявки; null — по правилу: единственный допустимый, при нескольких — отказ."
          },
          "openReasonTitle": {
            "type": "string",
            "maxLength": 255,
            "description": "Причина из template.reasons или openReasons карточки. Отсутствие сохраняет, null и пустая строка запрещены.",
            "minLength": 1
          },
          "justification": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Обоснование; null или пустая строка — снять."
          },
          "desiredStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65535,
            "description": "Число людей; не выше потолка шаблона."
          },
          "deadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок закрытия; null или пустая строка — снять."
          },
          "salaryMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки десятичным строкой."
          },
          "salaryMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки."
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат работы: код словаря WorkFormatCode или прежний свободный текст — его показывают как есть."
          },
          "brief": {
            "$ref": "#/components/schemas/VacancyTemplateBriefWrite"
          },
          "profile": {
            "$ref": "#/components/schemas/VacancyTemplateProfileWrite"
          },
          "legalEntityId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Юрлицо, от которого открывается вакансия, — адрес из справочника юрлиц (LegalEntity.id); null или пустая строка — снять. Новое обязано быть действующим юрлицом портала, иначе 400 invalid_value, details.reason ref_rejected; равное текущему не проверяется."
          },
          "employmentType": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmploymentTypeCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат оформления: код словаря EmploymentTypeCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "marketReview": {
            "type": "boolean",
            "description": "Нужен ли обзор рынка зарплат. Снять нельзя: null — 400 invalid_value с полем marketReview; без ключа значение не трогается."
          },
          "salaryComment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий про деньги; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long. Скрыт вместе с вилкой: если вилка заявки скрыта от вызывающего (режим hidden у заведения, снимок salaryHidden у правки), ключ с любым значением, null тоже, — 400 invalid_value с полем salaryComment, как salaryMin и salaryMax."
          },
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageCode"
            },
            "description": "Языки — коды словаря LanguageCode, без порядка; набор заменяется целиком, [] очищает. Код вне словаря — 400 invalid_value, details.reason invalid; повтор — duplicate."
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LocationCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Локация: код словаря LocationCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "example": "Europe/Moscow",
            "description": "Часовой пояс, имя IANA; null — снять. Пустая строка и имя, которого нет в tzdata, — 400 invalid_value, details.reason invalid; уже стоящий пояс не проверяется."
          },
          "workSchedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkScheduleCode"
              },
              {
                "type": "null"
              }
            ],
            "description": "График: код словаря WorkScheduleCode; null — снять. Пустая строка — не «снять», а значение вне словаря: 400 invalid_value, details.reason invalid."
          },
          "customerWishes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания заказчика; null или пустая строка — снять. Длиннее предела — 400 invalid_value, details.reason too_long."
          },
          "fileIds": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Файлы условий — адреса загрузок с назначением vacancy_attachment; набор заменяется целиком, [] очищает. Только кабинет: ключ API с этим ключом (с любым значением, null тоже) получает 400 invalid_value с полем fileIds. Сверх предела — details.reason too_many, повтор — duplicate. Новый файл обязан быть загрузкой автора правки, подтверждённой, не занятой и годной вложением (PDF, JPEG, PNG в пределах размера); иначе, как и при адресе, который не разбирается или порталу неизвестен, — details.reason file_rejected, одна причина на все случаи. Файлы, уже стоящие у заявки или в её шаблоне, не проверяются."
          },
          "observerIds": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "example": "42"
            },
            "description": "Наблюдатели — номера сотрудников Битрикс24 строкой, как TermsObserver.id. Наблюдателей задаёт шаблон, режим у них всегда fixed: набор, отличный от текущего (без учёта порядка), — 400 invalid_value с полем observerIds на любом уровне прав; равный проходит. Сверх предела — details.reason too_many; повтор номера — duplicate."
          },
          "positionTitle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Существующая доступная должность портала; null и пустая строка — 400 invalid_value с полем positionTitle. Только у самостоятельного черновика; отсутствие сохраняет должность. У шаблонной заявки фактическая смена запрещена."
          }
        }
      },
      "PositionRouteRequest": {
        "type": "object",
        "required": [
          "title",
          "routeId"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "routeId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "null — снять привязку."
          }
        }
      },
      "VacancyDecisionRequest": {
        "type": "object",
        "required": [
          "position",
          "approve"
        ],
        "properties": {
          "position": {
            "type": "integer",
            "minimum": 1,
            "description": "Номер шага круга, по которому принято решение. ОБЯЗАТЕЛЕН: в параллельном режиме один человек бывает решающим нескольких шагов одного круга, и решение без номера закрывало бы их все разом."
          },
          "approve": {
            "type": "boolean",
            "description": "true — согласовать шаг, false — отклонить заявку."
          },
          "comment": {
            "type": "string",
            "description": "Причина. ОБЯЗАТЕЛЬНА при отказе, необязательна при согласовании. После обрезки краёв не более 2000 Unicode символов; превышение — 400 invalid_value (comment).",
            "maxLength": 2000
          },
          "expectedRound": {
            "type": "integer",
            "minimum": 1,
            "description": "Ожидаемый круг. Несовпадение с текущим кругом отвечает 409 not_approver и ничего не меняет. При пропуске сохраняется прежнее поведение."
          }
        }
      },
      "VacancyApprovalStep": {
        "type": "object",
        "required": [
          "position",
          "kind",
          "state",
          "decidedBy",
          "decidedAt",
          "comment",
          "canDecide",
          "skipReason",
          "groupNo",
          "rule",
          "title",
          "members",
          "conditions",
          "conditionsMasked",
          "decisions",
          "actorCount"
        ],
        "properties": {
          "position": {
            "type": "integer",
            "description": "Номер шага, с первого."
          },
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ],
            "description": "Вид субъекта, снятый со шаблона при отправке."
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "pending",
              "approved",
              "rejected",
              "skipped"
            ],
            "description": "waiting — очередь шага не пришла; pending — ждёт решения; skipped — шаг не потребовался: круг остановлен отказом на другом шаге (skipReason = null) или рождён пропущенным — выше заказчика и автора по оргструктуре согласовать некому (skipReason = no_head_above) либо ложно условие шага (skipReason = condition_false)."
          },
          "decidedBy": {
            "type": "string",
            "nullable": true,
            "description": "Кто решил. null — шаг ещё не решён."
          },
          "decidedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "comment": {
            "type": "string",
            "nullable": true,
            "description": "Причина решения. У отказа непуста всегда."
          },
          "canDecide": {
            "type": "boolean",
            "description": "Вправе ли вызывающий решить по этому шагу СЕЙЧАС: шаг pending и решение вызывающего он ещё ждёт (в шаге rule = all решивший кнопок больше не получает). Подсказка интерфейсу: право проверяет сервер в любом случае."
          },
          "skipReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "no_head_above",
                  "condition_false"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему шаг рождён пропущенным: no_head_above — выше заказчика и автора по оргструктуре согласовать некому; condition_false — ложна строка условий шага (conditions). null — шаг не пропущен или пропущен отказом на другом шаге. Значение перечисления может добавиться: незнакомое показывайте общим «Пропущен».",
            "example": null
          },
          "subject": {
            "$ref": "#/components/schemas/ApprovalSubject"
          },
          "groupNo": {
            "type": "integer",
            "minimum": 1,
            "description": "Группа шага, с первой. Шаги одной группы идут параллельно: группа закрыта, когда согласованы все её непропущенные шаги. mode круга остаётся прежним значением и для смешанного маршрута говорит sequential — параллельный блок узнаётся по groupNo."
          },
          "rule": {
            "type": "string",
            "enum": [
              "any",
              "all"
            ],
            "description": "any — шаг закрывает первое решение любого участника; all — нужны решения всех, ход — в decisions."
          },
          "title": {
            "type": "string",
            "nullable": true,
            "description": "Название шага на момент отправки; null — не задано."
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalStepMember"
            },
            "description": "Участники шага по снимку отправки."
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalConditionFact"
            },
            "description": "Условия шага на момент отправки; [] — шаг без условий или все его строки скрыты маской вилки."
          },
          "conditionsMasked": {
            "type": "boolean",
            "description": "Из conditions вырезаны денежные строки: вилка заявки скрыта от вызывающего (salaryMasked). Шаг, пропущенный по такой строке, приходит со skipReason = condition_false без порога и суммы."
          },
          "decisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalStepDecision"
            },
            "description": "У шага rule = all — кто и как уже решил, по времени решения; у any — [] (решение шага — decidedBy, decidedAt, comment)."
          },
          "actorCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Число решающих шага: сколько людей шаг открыл решению при запуске круга. Имён не раскрывает. Приходит у каждого шага; смысл имеет у rule = all — «2 из 3 согласовали» по decisions. 0 — шаг рождён пропущенным."
          }
        }
      },
      "VacancyApproval": {
        "type": "object",
        "required": [
          "round",
          "mode",
          "route",
          "outcome",
          "startedAt",
          "finishedAt",
          "steps"
        ],
        "properties": {
          "round": {
            "type": "integer",
            "description": "Номер круга, с первого."
          },
          "mode": {
            "type": "string",
            "enum": [
              "sequential",
              "parallel"
            ],
            "description": "Снят со шаблона при отправке: правка шаблона идущий круг не трогает."
          },
          "route": {
            "type": "string",
            "description": "Название маршрута на момент отправки."
          },
          "outcome": {
            "type": "string",
            "nullable": true,
            "enum": [
              "approved",
              "rejected",
              null
            ],
            "description": "null — круг идёт."
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyApprovalStep"
            }
          }
        }
      },
      "ApplicationReviewAttempt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "stage",
          "state",
          "startedAt",
          "finishedAt",
          "code"
        ],
        "description": "Latest persisted review attempt, independent of the saved score, review and bot provenance. Visible with application view. Background maintenance persists expired work; reads never synthesize a clock-edge state or change data. Nullable legacy records without a representable identity/start time are returned as null.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Opaque attempt identity; no sequence or queue generation is exposed."
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Actual saved attempt start, UTC."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ai_not_connected",
                  "ai_key_dead",
                  "ai_scope_missing",
                  "ai_quota",
                  "ai_unavailable",
                  "timeout",
                  "internal",
                  "reply_invalid",
                  "portrait_changed",
                  "left_stage",
                  "doc_unreadable",
                  "resume_url_rejected",
                  "resume_route_unsupported",
                  "resume_access_required",
                  "resume_access_denied",
                  "resume_unavailable",
                  "resume_format_unsupported",
                  "resume_unreadable",
                  "resume_resource_limit",
                  "resume_input_too_large",
                  "resume_unsafe_content",
                  "resume_source_changed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Known machine code for failed only; null for queued, running and done. Resume preparation refusals happen before the model and do not create a score. Existing saved results remain independent."
          }
        },
        "if": {
          "properties": {
            "state": {
              "const": "failed"
            }
          }
        },
        "then": {
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "type": "string",
              "enum": [
                "ai_not_connected",
                "ai_key_dead",
                "ai_scope_missing",
                "ai_quota",
                "ai_unavailable",
                "timeout",
                "internal",
                "reply_invalid",
                "portrait_changed",
                "left_stage",
                "doc_unreadable",
                "resume_url_rejected",
                "resume_route_unsupported",
                "resume_access_required",
                "resume_access_denied",
                "resume_unavailable",
                "resume_format_unsupported",
                "resume_unreadable",
                "resume_resource_limit",
                "resume_input_too_large",
                "resume_unsafe_content",
                "resume_source_changed"
              ]
            }
          }
        },
        "else": {
          "properties": {
            "code": {
              "type": "null"
            }
          }
        }
      },
      "AwaitingCount": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Заявок ждёт решения вызывающего."
          },
          "offers": {
            "type": "integer",
            "minimum": 0,
            "description": "Офферов ждёт решения вызывающего: запрос согласования оффера, где он решающий, ждёт решения. Только в сессии человека; запросу по ключу доступа поля нет."
          }
        }
      },
      "Company": {
        "type": "object",
        "required": [
          "id",
          "title",
          "summary",
          "description",
          "benefits",
          "siteUrl",
          "city",
          "industry",
          "address",
          "headcount",
          "contactPhone",
          "contactEmail",
          "logoFileUrl",
          "isDefault",
          "archived",
          "createdAt",
          "pdnOperator"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "description": "Название ДЛЯ СОИСКАТЕЛЕЙ, а не юридическое.",
            "maxLength": 255
          },
          "summary": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "description": "Короткое описание: то, что видно в строке списка."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Чем компания занимается — то, что читает соискатель."
          },
          "benefits": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия — что компания предлагает соискателю."
          },
          "siteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес сайта. Значение могло не пройти проверку ссылки: перепроверьте перед показом ссылкой."
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Город."
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Сфера."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес — детальнее города."
          },
          "headcount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Численность. ТЕКСТ, а не число: компании говорят о себе «100–500»."
          },
          "contactPhone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Телефон для соискателя."
          },
          "contactEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Почта для соискателя. Значение могло не пройти проверку: перепроверьте перед отправкой письма."
          },
          "logoFileUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Путь к картинке логотипа в кабинете; открывается только по куке кабинета, ключу API — 403. Меняется при каждой правке профиля; null — логотипа нет."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Карточка портала по умолчанию: действует у вакансий, у которых своей не выбрано. В портале таких не больше одной; умолчания может не быть. У архивной карточки (archived: true) отметка не действует, даже если пришла true: умолчанием считается только активная карточка."
          },
          "archived": {
            "type": "boolean",
            "description": "Выведена из обращения; в пикере не предлагается."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "inn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?:[0-9]{10}|[0-9]{12})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "director": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "addressComponents": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySyncAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "pdnOperator": {
            "$ref": "#/components/schemas/CompanyPdnOperator"
          }
        }
      },
      "CompanyListItem": {
        "type": "object",
        "required": [
          "id",
          "title",
          "summary",
          "siteUrl",
          "city",
          "industry",
          "address",
          "headcount",
          "contactPhone",
          "contactEmail",
          "logoFileUrl",
          "isDefault",
          "archived",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "description": "Название ДЛЯ СОИСКАТЕЛЕЙ, а не юридическое.",
            "maxLength": 255
          },
          "summary": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "description": "Короткое описание: то, что видно в строке списка."
          },
          "siteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес сайта. Значение могло не пройти проверку ссылки: перепроверьте перед показом ссылкой."
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Город."
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Сфера."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес — детальнее города."
          },
          "headcount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Численность. ТЕКСТ, а не число: компании говорят о себе «100–500»."
          },
          "contactPhone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Телефон для соискателя."
          },
          "contactEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Почта для соискателя. Значение могло не пройти проверку: перепроверьте перед отправкой письма."
          },
          "logoFileUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Путь к картинке логотипа в кабинете; открывается только по куке кабинета, ключу API — 403. Меняется при каждой правке профиля; null — логотипа нет."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Карточка портала по умолчанию: действует у вакансий, у которых своей не выбрано. В портале таких не больше одной; умолчания может не быть. У архивной карточки (archived: true) отметка не действует, даже если пришла true: умолчанием считается только активная карточка."
          },
          "archived": {
            "type": "boolean",
            "description": "Выведена из обращения; в пикере не предлагается."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CompanyCreateRequest": {
        "type": "object",
        "description": "Заводит профиль компании: title обязателен, остальное необязательно — отсутствующий ключ означает null. Новые inn/director/addressComponents необязательны: отсутствие сохраняет значение; null/пусто очищает строки. Полный snapshot адреса определяет display≤255, COUNTRY_CODE сохраняется, LOC_ADDR_ID только server-owned. Равный старый address без components сохраняет snapshot; изменённый непустой address сохраняется локально с needs_address_mapping. При закрытом флаге old-only CRUD работает без отправки; явно переданные новые поля отклоняются до записи:403 feature_disabled /503 feature_flags_unavailable. Локальное сохранение не подтверждает внешнюю доставку.",
        "required": [
          "title"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Название для соискателей.",
            "maxLength": 255
          },
          "summary": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "description": "Короткое описание: то, что видно в строке списка."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Чем компания занимается — то, что читает соискатель."
          },
          "benefits": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия — что компания предлагает соискателю."
          },
          "siteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес сайта. Значение могло не пройти проверку ссылки: перепроверьте перед показом ссылкой."
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Город."
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Сфера."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес — детальнее города."
          },
          "headcount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Численность. ТЕКСТ, а не число: компании говорят о себе «100–500»."
          },
          "contactPhone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Телефон для соискателя."
          },
          "contactEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Почта для соискателя. Значение могло не пройти проверку: перепроверьте перед отправкой письма."
          },
          "logoFileId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "id файла, загруженного в кабинете с назначением company_logo этим же человеком; без ключа логотип не меняется; null снимает; только из кабинета — запрос по ключу API с этим ключом получает 403."
          },
          "inn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?:[0-9]{10}|[0-9]{12})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "director": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "addressComponents": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySyncAddress"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CompanyUpdateRequest": {
        "type": "object",
        "description": "Правка карточки ЦЕЛИКОМ: у формы нет разницы между «не менял» и «стёр», поэтому PUT, а не PATCH. Пустая строка стирает значение. Новые inn/director/addressComponents необязательны: отсутствие сохраняет значение; null/пусто очищает строки. Полный snapshot адреса определяет display≤255, COUNTRY_CODE сохраняется, LOC_ADDR_ID только server-owned. Равный старый address без components сохраняет snapshot; изменённый непустой address сохраняется локально с needs_address_mapping. При закрытом флаге old-only CRUD работает без отправки; явно переданные новые поля отклоняются до записи:403 feature_disabled /503 feature_flags_unavailable. Локальное сохранение не подтверждает внешнюю доставку.",
        "required": [
          "title",
          "summary",
          "description",
          "benefits",
          "siteUrl",
          "city",
          "industry",
          "address",
          "headcount",
          "contactPhone",
          "contactEmail"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Название для соискателей.",
            "maxLength": 255
          },
          "summary": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ],
            "description": "Короткое описание: то, что видно в строке списка."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Чем компания занимается — то, что читает соискатель."
          },
          "benefits": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия — что компания предлагает соискателю."
          },
          "siteUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес сайта. Значение могло не пройти проверку ссылки: перепроверьте перед показом ссылкой."
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Город."
          },
          "industry": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Сфера."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес — детальнее города."
          },
          "headcount": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Численность. ТЕКСТ, а не число: компании говорят о себе «100–500»."
          },
          "contactPhone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Телефон для соискателя."
          },
          "contactEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Почта для соискателя. Значение могло не пройти проверку: перепроверьте перед отправкой письма."
          },
          "logoFileId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "id файла, загруженного в кабинете с назначением company_logo этим же человеком; без ключа логотип не меняется; null снимает; только из кабинета — запрос по ключу API с этим ключом получает 403."
          },
          "inn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?:[0-9]{10}|[0-9]{12})?$"
              },
              {
                "type": "null"
              }
            ]
          },
          "director": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "addressComponents": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySyncAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "logoDraftUpdate": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "enabled",
              "expectedLogoRevision"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "expectedLogoRevision": {
                "type": "integer",
                "minimum": 0
              }
            },
            "description": "Cabinet cookie only; a bearer request containing this property is rejected with forbidden."
          }
        }
      },
      "CompanyArchiveRequest": {
        "type": "object",
        "required": [
          "archived"
        ],
        "additionalProperties": false,
        "properties": {
          "archived": {
            "type": "boolean"
          }
        }
      },
      "VacancyCompanyRequest": {
        "type": "object",
        "required": [
          "companyId"
        ],
        "additionalProperties": false,
        "description": "Чьё лицо показывать соискателю. Поле ОБЯЗАТЕЛЬНО, и null в нём значит «снять выбор»: тогда действует профиль портала по умолчанию. Тело без companyId, с лишним ключом или со значением не строкой и не null — 400 bad_request.",
        "properties": {
          "companyId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "format": "uuid"
          }
        }
      },
      "CompanyListResponse": {
        "type": "object",
        "required": [
          "companies"
        ],
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanyListItem"
            }
          }
        }
      },
      "VacancyBrief": {
        "type": "object",
        "required": [
          "tasks",
          "conditions",
          "schedule",
          "hiringSteps",
          "regionId",
          "professionId",
          "workFormat"
        ],
        "description": "То, что рекрутер снял с заказчика. Одна схема и на чтение, и на запись: полей мало и они одни и те же. null и пустая строка здесь одно и то же — у абзаца брифа нет разницы между «не заполняли» и «стёрли».",
        "properties": {
          "tasks": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Задачи на позиции. До 10000 знаков."
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия: оформление, оплата, соцпакет. До 10000 знаков."
          },
          "schedule": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "График работы. До 10000 знаков."
          },
          "hiringSteps": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Этапы отбора, о которых договорились с заказчиком. До 10000 знаков."
          },
          "regionId": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Регион работы: узел нашего справочника. Выбирается один раз и подставляется в каждый канал."
          },
          "professionId": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Профессия: узел нашего справочника. От неё зависит, какие поля спрашивает площадка."
          },
          "workFormat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkFormatCode"
              },
              {
                "type": "string",
                "maxLength": 24
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат работы: код словаря WorkFormatCode или прежний свободный текст — его показывают как есть. Обе площадки требуют его отдельным полем."
          },
          "textsUnreadable": {
            "type": "boolean",
            "readOnly": true,
            "description": "Тексты брифа лежат шифротекстом, который сервер не смог открыть (например, после смены ключа шифрования): tasks, conditions, schedule и hiringSteps приходят null, структурные поля — как есть. Поля нет или false — тексты прочитаны. Только для чтения: в PUT поле принимается и игнорируется; сохранение документа записывает тексты заново."
          }
        }
      },
      "VacancyCandidateProfile": {
        "type": "object",
        "required": [
          "experience",
          "skills",
          "education",
          "stoppers"
        ],
        "description": "Портрет того, кого ищут. Отдельно от брифа: это разные документы с разной судьбой — профиль материал будущей работы с откликами, бриф договорённость с заказчиком.",
        "properties": {
          "experience": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Опыт: сколько и какой. До 10000 знаков."
          },
          "skills": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Навыки. До 10000 знаков."
          },
          "education": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Образование. До 10000 знаков."
          },
          "stoppers": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000
              },
              {
                "type": "null"
              }
            ],
            "description": "Стоп-факторы: с чем не берут. До 10000 знаков."
          },
          "textsUnreadable": {
            "type": "boolean",
            "readOnly": true,
            "description": "Тексты портрета лежат шифротекстом, который сервер не смог открыть (например, после смены ключа шифрования): experience, skills, education и stoppers приходят null. Поля нет или false — тексты прочитаны. Только для чтения: в PUT поле принимается и игнорируется; сохранение документа записывает тексты заново."
          },
          "mainVersionId": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "description": "Адрес основной версии портрета, которую показывает это чтение; экран разбора шлёт его ожидаемой версией оценки (portraitVersion). Нет — у портрета версий нет. Только для чтения: PUT поле принимает и игнорирует."
          }
        }
      },
      "VacancyChannelText": {
        "type": "object",
        "required": [
          "channel",
          "headline",
          "body",
          "state",
          "publishedAt",
          "externalUrl",
          "limit",
          "marks",
          "source",
          "paid",
          "added",
          "membershipRevision",
          "unsentChanges",
          "descriptionMode"
        ],
        "description": "Текст вакансии под канал и отметка публикации. Приходит НА КАЖДЫЙ канал словаря, даже когда под него ещё не писали.",
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "bitrix24",
              "telegram",
              "avito",
              "hh"
            ]
          },
          "headline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заголовок под этот канал."
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текст описания под этот канал."
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "removed"
            ]
          },
          "publishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ссылка на размещение у площадки, если её вставили. У площадок с публикацией через API (hh, avito) без права публикации vacancy_publication · edit к вакансии — null, и у ключа API тоже; у Telegram ссылка приходит с правом vacancy · view."
          },
          "limit": {
            "type": "integer",
            "description": "Потолок длины тела в символах; 0 — предела нет. Приходит с сервера, а не зашит в интерфейс: предел принадлежит площадке, и две его копии разошлись бы на первой правке."
          },
          "marks": {
            "type": "boolean",
            "description": "true — «Опубликовать» ОТМЕЧАЕТ факт, сделанный руками на стороне площадки, и никуда не ходит. false — канал публикует сам и ручной отметки не принимает: у Битрикс24 всегда, у Telegram — когда бот настроен и канал портала подключён."
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "api"
            ],
            "description": "Чем сделана отметка. Сегодня всегда manual: интеграции с площадками ещё нет. Поле в контракте с самого начала, потому что именно на ручной публикации плоскую модель легче всего унаследовать не заметив."
          },
          "paid": {
            "type": "boolean",
            "description": "Было ли размещение платным. Сегодня всегда false: рука денег не тратит. Отвечает на вопрос «сколько мы потратили на эту вакансию», который задают независимо от того, кто нажал кнопку."
          },
          "added": {
            "type": "boolean",
            "description": "Активная основная карточка; строка истории не означает added."
          },
          "membershipRevision": {
            "type": "integer",
            "minimum": 0,
            "description": "Версия состава карточек; отсутствие строки — 0."
          },
          "unsentChanges": {
            "anyOf": [
              {
                "type": "boolean",
                "description": "Сохранённый черновик отличается от подтверждённой версии; null — сравнение недоступно."
              },
              {
                "type": "null"
              }
            ]
          },
          "descriptionMode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "inherit",
                  "ai",
                  "manual"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Режим текста площадки из описания вакансии: inherit — общий заголовок и общее описание, ai или manual — свои. Только при vacancy · edit из кабинета, иначе null."
          }
        }
      },
      "VacancyChannelListResponse": {
        "type": "object",
        "required": [
          "channels"
        ],
        "properties": {
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancyChannelText"
            }
          }
        }
      },
      "VacancyChannelSaveRequest": {
        "type": "object",
        "required": [
          "headline",
          "body"
        ],
        "properties": {
          "headline": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "Текст публикации. У hh и Авито — Markdown, у остальных каналов — простой текст."
          },
          "membershipRevision": {
            "anyOf": [
              {
                "type": "integer",
                "format": "uint64",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия участия площадки. Нет значения допустимо только у активной initial revision=1; hidden даёт channel_removed, изменённая версия — stale_form."
          },
          "descriptionMode": {
            "type": "string",
            "enum": [
              "inherit",
              "ai",
              "manual"
            ],
            "description": "Галка «свой текст» слайдера: inherit — присланные headline и body заменяются общим заголовком и проекцией общего описания; ai или manual — свои. Нет поля — режим по правилу заголовка: текст, отличный от общего, переводит площадку в manual."
          },
          "descriptionRevision": {
            "type": "integer",
            "minimum": 0,
            "description": "Ревизия описания, которую видела форма; забор — только когда прислана."
          }
        }
      },
      "VacancyChannelPublishRequest": {
        "type": "object",
        "required": [
          "published"
        ],
        "properties": {
          "published": {
            "type": "boolean",
            "description": "true — отметить публикацию, false — снять."
          },
          "externalUrl": {
            "type": "string",
            "description": "Ссылка на размещение у площадки."
          },
          "membershipRevision": {
            "anyOf": [
              {
                "type": "integer",
                "format": "uint64",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия участия площадки. Нет значения допустимо только у активной initial revision=1; hidden даёт channel_removed, изменённая версия — stale_form."
          }
        }
      },
      "CustomerCallCreateRequest": {
        "type": "object",
        "required": [
          "startsAt",
          "durationMin",
          "tz"
        ],
        "properties": {
          "startsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Начало встречи, RFC 3339 со смещением. Строго в будущем и не дальше года вперёд."
          },
          "durationMin": {
            "type": "integer",
            "minimum": 15,
            "maximum": 240,
            "multipleOf": 15,
            "description": "Длительность в минутах: 15–240, шаг 15."
          },
          "tz": {
            "type": "string",
            "description": "Зона IANA, в которой назначали время: в ней встреча покажется в календаре Битрикс24."
          }
        }
      },
      "CustomerCall": {
        "type": "object",
        "required": [
          "publicId",
          "startsAt",
          "endsAt",
          "tz"
        ],
        "description": "Назначенный созвон. Идентификаторов Битрикс24 здесь нет.",
        "properties": {
          "publicId": {
            "type": "string",
            "format": "uuid",
            "description": "public_id созвона."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Начало, UTC."
          },
          "endsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Конец, UTC."
          },
          "tz": {
            "type": "string",
            "description": "Зона IANA, в которой назначали."
          }
        }
      },
      "CustomerCallListResponse": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallView"
            }
          }
        }
      },
      "CustomerCallView": {
        "type": "object",
        "required": [
          "publicId",
          "startsAt",
          "endsAt",
          "tz",
          "calls"
        ],
        "description": "Назначенный созвон вакансии со звонками. Идентификаторов Битрикс24 здесь нет.",
        "properties": {
          "publicId": {
            "type": "string",
            "format": "uuid",
            "description": "public_id созвона."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Начало, UTC."
          },
          "endsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Конец, UTC."
          },
          "tz": {
            "type": "string",
            "description": "Зона IANA, в которой назначали."
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "unavailable",
              "relogin",
              "no_calls",
              "closed"
            ],
            "description": "waiting — звонков ещё ждут; unavailable — у портала нет Follow-up; relogin — назначившему нужно войти в сервис заново; no_calls — окно закрыто без звонков; closed — закрыто со звонками."
          },
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallFollowupView"
            },
            "description": "Звонки Follow-up из чата встречи."
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "scheduled",
              "failed"
            ]
          },
          "creationState": {
            "type": "string",
            "enum": [
              "not_started",
              "event_started",
              "chat_started",
              "unknown",
              "confirmed"
            ]
          },
          "participants": {
            "$ref": "#/components/schemas/CustomerCallParticipantStatus"
          }
        }
      },
      "CallFollowupView": {
        "type": "object",
        "required": [
          "publicId",
          "startedAt",
          "durationSeconds",
          "analysis"
        ],
        "description": "Звонок созвона и его разбор. Полной расшифровки нет: наружу идут только пункты с цитатами.",
        "properties": {
          "publicId": {
            "type": "string",
            "format": "uuid",
            "description": "public_id звонка: его передают в запуск разбора."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало звонка, UTC; null — портал его не прислал."
          },
          "durationSeconds": {
            "type": "integer",
            "minimum": 0,
            "description": "Длительность в секундах."
          },
          "analysis": {
            "$ref": "#/components/schemas/CallAnalysis"
          }
        }
      },
      "CallAnalysis": {
        "type": "object",
        "required": [
          "state",
          "reason",
          "truncated",
          "items"
        ],
        "description": "Разбор звонка в пункты брифа.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "running",
              "done",
              "failed"
            ],
            "description": "none — не запускали; running — идёт; done — готов; failed — не удался, код в reason."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ai_not_connected",
                  "ai_key_dead",
                  "ai_scope_missing",
                  "ai_quota",
                  "ai_unavailable",
                  "no_transcript",
                  "timeout",
                  "internal"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Код причины у failed, иначе null. ai_not_connected — ИИ к порталу не подключён; ai_key_dead — ключ ИИ отозван; ai_scope_missing — у ключа нет права; ai_quota — квота исчерпана; ai_unavailable — ИИ недоступен или ответил не по форме; no_transcript — у звонка нет расшифровки; timeout — разбор не уложился в срок или был прерван; internal — сбой сервиса. Повтор запуска разбирает звонок заново."
          },
          "truncated": {
            "type": "boolean",
            "description": "true — расшифровка длиннее предела, разобрано только начало."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallAnalysisItem"
            },
            "description": "Пункты готового разбора; у остальных состояний пусто."
          }
        }
      },
      "TranscriptItem": {
        "type": "object",
        "required": [
          "transcriptId",
          "source",
          "callDate",
          "startedAt",
          "durationSeconds"
        ],
        "description": "Расшифровка созвона в списке.",
        "properties": {
          "transcriptId": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес расшифровки."
          },
          "source": {
            "type": "string",
            "enum": [
              "followup",
              "manual"
            ],
            "description": "followup — звонок Follow-up назначенного созвона; manual — вставлена рекрутёром."
          },
          "callDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День звонка у ручной; у Follow-up null."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало звонка у Follow-up (null — портал не прислал); у ручной null."
          },
          "durationSeconds": {
            "type": "integer",
            "description": "Длительность звонка Follow-up в секундах; у ручной 0."
          }
        }
      },
      "TranscriptListResponse": {
        "type": "object",
        "required": [
          "items"
        ],
        "description": "Расшифровки вакансии новыми первыми.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranscriptItem"
            },
            "description": "Расшифровки."
          }
        }
      },
      "TranscriptCreateRequest": {
        "type": "object",
        "required": [
          "callDate",
          "text"
        ],
        "description": "Ручная расшифровка созвона.",
        "properties": {
          "callDate": {
            "type": "string",
            "format": "date",
            "description": "День звонка, ГГГГ-ММ-ДД; не позже завтрашнего дня по UTC."
          },
          "text": {
            "type": "string",
            "maxLength": 60000,
            "description": "Текст расшифровки, до 60000 знаков."
          }
        }
      },
      "TranscriptLine": {
        "type": "object",
        "required": [
          "at",
          "role",
          "text"
        ],
        "description": "Реплика звонка. Имени говорящего нет — только роль.",
        "properties": {
          "at": {
            "type": "string",
            "description": "Таймкод от начала звонка ЧЧ:ММ:СС; пусто — портал не прислал."
          },
          "role": {
            "type": "string",
            "enum": [
              "recruiter",
              "customer",
              "participant"
            ],
            "description": "recruiter — рекрутёр (организатор созвона); customer — заказчик; participant — прочие."
          },
          "text": {
            "type": "string",
            "description": "Текст реплики."
          }
        }
      },
      "Transcript": {
        "type": "object",
        "required": [
          "transcriptId",
          "source",
          "callDate",
          "startedAt",
          "durationSeconds",
          "text",
          "lines"
        ],
        "description": "Расшифровка созвона целиком.",
        "properties": {
          "transcriptId": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес расшифровки."
          },
          "source": {
            "type": "string",
            "enum": [
              "followup",
              "manual"
            ],
            "description": "followup — звонок Follow-up; manual — вставлена рекрутёром."
          },
          "callDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День звонка у ручной; у Follow-up null."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало звонка у Follow-up; у ручной null."
          },
          "durationSeconds": {
            "type": "integer",
            "description": "Длительность звонка Follow-up в секундах; у ручной 0."
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текст ручной расшифровки; null у Follow-up и у нечитаемой."
          },
          "lines": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TranscriptLine"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Реплики звонка Follow-up; null у ручной и у нечитаемой."
          }
        }
      },
      "DocVersionSource": {
        "type": "string",
        "enum": [
          "manual",
          "ai",
          "import"
        ],
        "description": "manual — сохранение руками; ai — итог генерации; import — документ, записанный до версий."
      },
      "DocVersionTranscript": {
        "type": "object",
        "required": [
          "transcriptId",
          "source",
          "date",
          "deleted",
          "unavailable"
        ],
        "description": "Расшифровка, легшая во вход генерации. deleted и unavailable — почему её больше нет среди расшифровок вакансии; оба false — она на месте.",
        "properties": {
          "transcriptId": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес расшифровки."
          },
          "source": {
            "type": "string",
            "enum": [
              "followup",
              "manual"
            ],
            "description": "followup или manual."
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День звонка."
          },
          "deleted": {
            "type": "boolean",
            "description": "Ручную расшифровку удалили — до генерации или после. У звонка Follow-up всегда false: его не удаляют."
          },
          "unavailable": {
            "type": "boolean",
            "description": "Звонка Follow-up больше нет среди расшифровок вакансии — до генерации или после: созвон отменён или звонок вне видимости. Его никто не удалял. У ручной всегда false."
          }
        }
      },
      "DocVersion": {
        "type": "object",
        "required": [
          "publicId",
          "number",
          "source",
          "main",
          "readable",
          "createdAt",
          "author",
          "prePrompt",
          "transcripts",
          "truncated",
          "mainUnreadable"
        ],
        "description": "Версия брифа или портрета без текстов.",
        "properties": {
          "publicId": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес версии."
          },
          "number": {
            "type": "integer",
            "description": "Номер версии документа, с 1."
          },
          "source": {
            "$ref": "#/components/schemas/DocVersionSource"
          },
          "main": {
            "type": "boolean",
            "description": "Версия основная: её тексты — тексты документа."
          },
          "readable": {
            "type": "boolean",
            "description": "Сервер расшифровал версию; false — пожеланий, расшифровок и признаков нет."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда версия создана."
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто сохранил версию или поставил генерацию; null — человека больше нет в портале."
          },
          "prePrompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания рекрутёра, с которыми шла генерация; у правки руками null."
          },
          "transcripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocVersionTranscript"
            },
            "description": "Расшифровки входа генерации; у правки руками пусто."
          },
          "truncated": {
            "type": "boolean",
            "description": "Во вход генерации вошло не всё: данные длиннее предела."
          },
          "mainUnreadable": {
            "type": "boolean",
            "description": "Основной бриф был недоступен генерации (не расшифровался)."
          }
        }
      },
      "DocVersionDetail": {
        "type": "object",
        "required": [
          "publicId",
          "number",
          "source",
          "main",
          "readable",
          "createdAt",
          "author",
          "prePrompt",
          "transcripts",
          "truncated",
          "mainUnreadable",
          "fields"
        ],
        "description": "Версия брифа или портрета с текстами.",
        "properties": {
          "publicId": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес версии."
          },
          "number": {
            "type": "integer",
            "description": "Номер версии документа, с 1."
          },
          "source": {
            "$ref": "#/components/schemas/DocVersionSource"
          },
          "main": {
            "type": "boolean",
            "description": "Версия основная: её тексты — тексты документа."
          },
          "readable": {
            "type": "boolean",
            "description": "Сервер расшифровал версию; false — пожеланий, расшифровок и признаков нет."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда версия создана."
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто сохранил версию или поставил генерацию; null — человека больше нет в портале."
          },
          "prePrompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Пожелания рекрутёра, с которыми шла генерация; у правки руками null."
          },
          "transcripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocVersionTranscript"
            },
            "description": "Расшифровки входа генерации; у правки руками пусто."
          },
          "truncated": {
            "type": "boolean",
            "description": "Во вход генерации вошло не всё: данные длиннее предела."
          },
          "mainUnreadable": {
            "type": "boolean",
            "description": "Основной бриф был недоступен генерации (не расшифровался)."
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Тексты версии: у брифа — tasks, conditions, schedule, hiringSteps; у портрета — experience, skills, education, stoppers. Пустое поле — null."
          }
        }
      },
      "DocVersionList": {
        "type": "object",
        "required": [
          "mainVersionId",
          "items"
        ],
        "description": "Версии документа.",
        "properties": {
          "mainVersionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес основной версии; null — версий нет."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocVersion"
            },
            "description": "Версии новыми первыми."
          }
        }
      },
      "DocGenerationReason": {
        "type": "string",
        "enum": [
          "ai_not_connected",
          "ai_key_dead",
          "ai_scope_missing",
          "ai_quota",
          "ai_unavailable",
          "timeout",
          "no_input",
          "empty_reply",
          "reply_too_long",
          "all_fields_fixed",
          "vacancy_archived",
          "internal"
        ],
        "description": "Причина отказа генерации. ai_not_connected — ИИ к порталу не подключён; ai_key_dead — ключ ИИ отозван; ai_scope_missing — у ключа нет права; ai_quota — квота исчерпана; ai_unavailable — ИИ недоступен или ответил не по форме; timeout — генерация не уложилась в срок или зависла; no_input — нечего разбирать: у вакансии нет текстов, брифа и отмеченных расшифровок; empty_reply — модель вернула пустой документ; reply_too_long — модель вернула поле длиннее предела; all_fields_fixed — шаблон закрепил все поля после запуска; vacancy_archived — вакансию убрали в архив после запуска; internal — сбой сервиса или у запустившего к итогу больше нет права vacancy · edit на вакансию. Версия ни в одном случае не создаётся."
      },
      "DocGeneration": {
        "type": "object",
        "required": [
          "state",
          "reason",
          "prePrompt",
          "finishedAt",
          "versionId"
        ],
        "description": "Фоновая генерация брифа или портрета.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "none",
              "running",
              "done",
              "failed"
            ],
            "description": "none — не запускали; running — идёт; done — готово; failed — не удалось, код в reason."
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocGenerationReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "Код причины у failed, иначе null."
          },
          "prePrompt": {
            "type": "string",
            "description": "Сохранённые пожелания рекрутёра; пустая строка — их нет."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда генерация закончилась; null — не закончилась или не запускалась."
          },
          "versionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес версии итога у done, иначе null."
          }
        }
      },
      "DocGenerationRequest": {
        "type": "object",
        "required": [],
        "description": "Запуск генерации.",
        "properties": {
          "prePrompt": {
            "type": "string",
            "maxLength": 2000,
            "description": "Пожелания рекрутёра к генерации, до 2000 знаков; сохраняются у вакансии."
          },
          "transcripts": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "transcriptId расшифровок вакансии, которые идут во вход; до 20."
          }
        }
      },
      "CallAnalysisItem": {
        "type": "object",
        "required": [
          "field",
          "text",
          "quote",
          "at"
        ],
        "description": "Предложение для поля брифа или профиля кандидата с дословной цитатой.",
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "tasks",
              "conditions",
              "schedule",
              "hiringSteps",
              "experience",
              "skills",
              "education",
              "stoppers"
            ],
            "description": "Поле: tasks, conditions, schedule, hiringSteps — брифа; experience, skills, education, stoppers — профиля кандидата."
          },
          "text": {
            "type": "string",
            "description": "Предлагаемый текст поля."
          },
          "quote": {
            "type": "string",
            "description": "Дословная цитата из расшифровки, на которой пункт основан."
          },
          "at": {
            "type": "string",
            "description": "Таймкод начала реплики с цитатой от начала звонка, ЧЧ:ММ:СС; пусто, если портал его не прислал."
          }
        }
      },
      "ApplicationFit": {
        "type": "string",
        "enum": [
          "high",
          "maybe",
          "low"
        ],
        "description": "Соответствие отклика вакансии: high — очень подходит, maybe — стоит посмотреть, low — не подходит. ВТОРАЯ ось рядом с этапом воронки, а не её замена: смена соответствия не двигает человека по воронке, а отказ в воронке не меняет соответствия. Отклик, которого никто не разбирал, имеет maybe. Поле fit отклика — ДЕЙСТВУЮЩЕЕ значение: решение человека, если оно есть, иначе предложение бота, иначе умолчание."
      },
      "ApplicationMatch": {
        "type": "object",
        "required": [
          "kind",
          "source",
          "text"
        ],
        "description": "Пункт разбора: чем отклик совпал с требованиями вакансии, чем разошёлся или о чём данных не хватило. Пункт с привязкой к портрету несёт section, requirement и evidence; у пункта прежней формы их нет, и читается text.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "match",
              "gap",
              "unclear"
            ],
            "description": "match — совпадение, gap — расхождение, unclear — данных в отклике не хватает, чтобы судить."
          },
          "source": {
            "type": "string",
            "enum": [
              "resume",
              "application"
            ],
            "description": "На чём основан пункт: resume — резюме, application — поля отклика. Утверждение бота обязано называть свой источник."
          },
          "text": {
            "type": "string",
            "description": "Формулировка пункта."
          },
          "section": {
            "type": "string",
            "enum": [
              "experience",
              "skills",
              "education",
              "stoppers",
              "brief",
              "outside"
            ],
            "description": "Раздел портрета или брифа, к которому привязан пункт: experience — опыт, skills — навыки, education — образование, stoppers — стоп-факторы, brief — бриф, outside — без опоры в портрете и брифе. Поля нет у пункта прежней формы."
          },
          "requirement": {
            "type": "string",
            "description": "Цитата требования из раздела (у outside — короткая тема). Поля нет у пункта прежней формы."
          },
          "evidence": {
            "type": "string",
            "description": "Что нашлось в отклике. Поля нет у пункта прежней формы и там, где данных не нашлось."
          }
        }
      },
      "ApplicationReview": {
        "type": "object",
        "required": [
          "summary",
          "matches",
          "note",
          "scoreBot",
          "provenance",
          "questions"
        ],
        "description": "Разбор отклика: вывод и пункты бота, обоснование человека и оценка бота. Приезжает ТОЛЬКО при with=review — в том числе у отклика, которого ИИ не разбирал: тот же отклик отдают и другие вызовы этого списка, которым пункты не нужны.",
        "properties": {
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Фраза-вывод под именем кандидата."
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationMatch"
            },
            "description": "Пункты в порядке показа."
          },
          "note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationReviewNote"
              },
              {
                "type": "null"
              }
            ],
            "description": "Обоснование решения по «Разбору»; null — его нет."
          },
          "scoreBot": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Оценка бота в «Разборе» — даже когда её перекрыла ручная (score отклика). null — бот отклик не оценивал. К ней возвращает стирание ручной оценки."
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScoreProvenance"
              },
              {
                "type": "null"
              }
            ],
            "description": "Происхождение действующей оценки (score отклика): ручной, если она есть, иначе бота. null — оценки нет или она поставлена до записи происхождения: тогда происхождение неизвестно и не угадывается."
          },
          "suggestion": {
            "$ref": "#/components/schemas/ApplicationFit",
            "description": "Предложение ИИ в «Разборе»: вердикт анализа одного отклика, иначе вердикт разбора стадии. Приходит, только если записано вместе с последним происхождением оценки бота (botProvenance); вердикты, записанные до этого, предложением не считаются. Предложение не меняет статус отклика: его держит fit. Поля нет — предложения нет."
          },
          "botProvenance": {
            "$ref": "#/components/schemas/ScoreProvenance",
            "description": "Происхождение оценки бота в «Разборе» — та же форма, что provenance, но всегда о боте, даже когда действующая оценка ручная. Поля нет — оно неизвестно."
          },
          "questions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Вопросы рекрутёру из последнего анализа, под тем же условием, что suggestion. Пустой массив — вопросов нет."
          },
          "run": {
            "$ref": "#/components/schemas/ApplicationReviewRunOne",
            "description": "ИИ-анализ этого отклика, запущенный из кабинета. Приходит только в GET /api/v1/applications/{id}?with=review, в списках его нет. Поля нет — анализ не ставили, строка относится к другой стадии, закончилась больше суток назад или раньше последнего анализа."
          }
        }
      },
      "ApplicationReviewNote": {
        "type": "object",
        "required": [
          "text",
          "author",
          "at"
        ],
        "description": "Обоснование решения человека по стадии. Текст — персональные данные о кандидате: в журнал он не пишется.",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 2000
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто написал обоснование; null — автор неизвестен."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "Когда обоснование записано."
          }
        }
      },
      "ScoreSource": {
        "type": "string",
        "enum": [
          "ai",
          "human"
        ],
        "description": "Чья оценка: ai — бота, human — человека."
      },
      "ApplicationReviewCounts": {
        "type": "object",
        "required": [
          "high",
          "maybe",
          "low",
          "total"
        ],
        "description": "Сколько живых откликов вакансии в каждой группе соответствия. Всё по ЖИВЫМ: нанятые и отказанные решены, их место в воронке. high + maybe + low = total — это инвариант, а не совпадение.",
        "properties": {
          "high": {
            "type": "integer",
            "description": "Очень подходят."
          },
          "maybe": {
            "type": "integer",
            "description": "Стоит посмотреть. Сюда же попадают неразобранные."
          },
          "low": {
            "type": "integer",
            "description": "Не подходят."
          },
          "total": {
            "type": "integer",
            "description": "Живых откликов вакансии всего."
          }
        }
      },
      "ApplicationStepCounts": {
        "type": "object",
        "required": [
          "steps"
        ],
        "description": "Числа откликов по шагам вида «Откликов» тем же отбором, что список откликов со step.",
        "properties": {
          "steps": {
            "$ref": "#/components/schemas/ApplicationStepCountSteps"
          }
        }
      },
      "ApplicationStepCountSteps": {
        "type": "object",
        "required": [
          "review",
          "interview",
          "decision",
          "offer",
          "hired",
          "rejected"
        ],
        "description": "Число на каждый шаг ApplicationStepKind, ноль тоже. «Все» — сумма review, interview, decision и offer: отклики в работе.",
        "properties": {
          "review": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          },
          "interview": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          },
          "decision": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          },
          "offer": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          },
          "hired": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          },
          "rejected": {
            "$ref": "#/components/schemas/ApplicationStepCount"
          }
        }
      },
      "ApplicationStepCount": {
        "type": "object",
        "required": [
          "n",
          "capped"
        ],
        "description": "Число откликов шага.",
        "properties": {
          "n": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько откликов на шаге. При capped — 1000."
          },
          "capped": {
            "type": "boolean",
            "description": "true — с поиском q совпадений больше 1000, и n равно 1000 (показывайте «1000+»). Без q — всегда false."
          }
        }
      },
      "VacancySummaryScope": {
        "type": "string",
        "enum": [
          "mine",
          "all"
        ],
        "description": "Набор свода вакансий: mine — где вызывающий рекрутер вакансии или у него есть дела по ней, all — все вакансии в работе."
      },
      "VacancySummarySort": {
        "type": "string",
        "enum": [
          "turn",
          "review_wait",
          "new"
        ],
        "description": "Порядок свода: turn — где больше дел у вызывающего, review_wait — где отклик дольше всех ждёт разбора, new — недавно опубликованные."
      },
      "VacancySummaryEventKind": {
        "type": "string",
        "enum": [
          "review",
          "meeting",
          "offer_answer",
          "await_customer",
          "start",
          "none"
        ],
        "description": "Событие вакансии: review — отклики ждут разбора; meeting — назначенная встреча; offer_answer — срок ответа кандидата на оффер; await_customer — ждём решения заказчика; start — день выхода по принятому офферу; none — дел нет."
      },
      "VacancySummary": {
        "type": "object",
        "required": [
          "vacancies",
          "total",
          "next"
        ],
        "description": "Страница свода вакансий.",
        "properties": {
          "vacancies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacancySummaryRow"
            },
            "description": "Вакансии страницы в порядке sort."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько вакансий в своде по всем страницам."
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы — в cursor с теми же scope и sort. null — страниц больше нет."
          }
        }
      },
      "VacancySummaryRow": {
        "type": "object",
        "required": [
          "id",
          "number",
          "position",
          "completed",
          "publishedAt",
          "headcount",
          "hired",
          "waiting",
          "steps",
          "verdicts",
          "reviewSince",
          "mainEvent",
          "nearestEvent"
        ],
        "description": "Вакансия свода: числа откликов и события. Остальное о вакансии отдаёт GET /api/v1/vacancies/{id}.",
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id вакансии."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер вакансии в портале."
          },
          "position": {
            "type": "string",
            "description": "Название должности."
          },
          "completed": {
            "type": "boolean",
            "description": "true — вакансия завершена; такие приходят только с поиском q."
          },
          "publishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда вакансию впервые опубликовали, UTC; null — ещё не публиковали. По ней сортирует sort = new."
          },
          "headcount": {
            "type": "integer",
            "minimum": 1,
            "description": "Сколько человек нужно нанять: мест у вакансии."
          },
          "hired": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько мест закрыто: откликов вакансии, вышедших на работу, — «1 из 3 мест закрыто». Факт вакансии: считается по всей вакансии и уровнем application · view не сужается, в отличие от steps.hired."
          },
          "waiting": {
            "type": "integer",
            "minimum": 0,
            "description": "«Ждут вас»: сколько дел у вызывающего по откликам вакансии — разобрать, пригласить, решить по кандидату, сделать оффер, отметить выход."
          },
          "steps": {
            "$ref": "#/components/schemas/VacancySummarySteps"
          },
          "verdicts": {
            "$ref": "#/components/schemas/VacancySummaryVerdicts"
          },
          "reviewSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Самый давний вход отклика на «Разбор», UTC; null — откликов на «Разборе» нет. По нему сортирует sort = review_wait."
          },
          "mainEvent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VacancySummaryEvent"
              }
            ],
            "description": "Главное событие — первое подходящее по порядку: отклики на «Разборе» (review), назначенная встреча, которая уже идёт или начнётся в ближайшие 24 часа (meeting), ближайший срок ответа на оффер (offer_answer), самое давнее ждущее решение заказчика (await_customer); иначе none."
          },
          "nearestEvent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VacancySummaryEvent"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ближайшее событие — самое раннее из будущих: начало назначенной встречи (meeting; идущая встреча уже не будущая), срок ответа на оффер (offer_answer), день выхода (start). null — будущих нет."
          }
        }
      },
      "VacancySummarySteps": {
        "type": "object",
        "required": [
          "review",
          "interview",
          "decision",
          "offer",
          "hired",
          "rejected"
        ],
        "description": "Сколько откликов вакансии на каждом шаге ApplicationStepKind, ноль тоже: шаг тот же, что у поля step отклика.",
        "properties": {
          "review": {
            "type": "integer",
            "minimum": 0
          },
          "interview": {
            "type": "integer",
            "minimum": 0
          },
          "decision": {
            "type": "integer",
            "minimum": 0
          },
          "offer": {
            "type": "integer",
            "minimum": 0
          },
          "hired": {
            "type": "integer",
            "minimum": 0
          },
          "rejected": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "VacancySummaryVerdicts": {
        "type": "object",
        "required": [
          "fit",
          "unsure",
          "unfit",
          "none"
        ],
        "description": "Вердикты откликов на «Разборе», как verdict отклика: fit — «Подходит», unsure — «Под вопросом», unfit — «Не подходит», none — «Нет анализа». В сумме — steps.review.",
        "properties": {
          "fit": {
            "type": "integer",
            "minimum": 0
          },
          "unsure": {
            "type": "integer",
            "minimum": 0
          },
          "unfit": {
            "type": "integer",
            "minimum": 0
          },
          "none": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "VacancySummaryEvent": {
        "type": "object",
        "required": [
          "kind",
          "at",
          "date",
          "count"
        ],
        "description": "Событие вакансии.",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/VacancySummaryEventKind"
          },
          "at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент события, UTC: review — самый давний вход на «Разбор»; meeting — начало встречи, у главного события — и уже идущей; offer_answer — когда оффер истекает, первый момент дня после date; await_customer — с какого момента ждём заказчика, конец встречи; start — первый момент дня выхода. У none — null."
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День события в зоне оффера: у offer_answer — последний день ответа кандидата, у start — день выхода; у прочих — null."
          },
          "count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "У review — сколько откликов на «Разборе»; у прочих — null."
          }
        }
      },
      "ApplicationFitRequest": {
        "type": "object",
        "required": [
          "fromFit",
          "fit"
        ],
        "description": "Тело смены соответствия. fromFit — соответствие, которое вызывающий ВИДЕЛ: расходится с настоящим, и смены нет, ответ fit_forbidden. Иначе запись по устаревшему состоянию молча отменила бы чужое решение. fit, совпавший с fromFit, — тоже 409: менять нечего.",
        "properties": {
          "fromFit": {
            "$ref": "#/components/schemas/ApplicationFit"
          },
          "fit": {
            "$ref": "#/components/schemas/ApplicationFit"
          }
        }
      },
      "ApplicationInterview": {
        "type": "object",
        "description": "Собеседование в карточке отклика: статус, время брони и собеседующие с именами. Контакта кандидата здесь нет; ссылка — только у приглашения без токена (см. link).",
        "required": [
          "id",
          "status",
          "startsAt",
          "endsAt",
          "tz",
          "attendees",
          "createdAt",
          "link",
          "durationMin",
          "b24EventId",
          "calendarOperation"
        ],
        "properties": {
          "configureSend": {
            "type": "boolean",
            "description": "True when the invitation was created for configured sending. This does not indicate delivery. Omitted for other invitations."
          },
          "canConfigureSend": {
            "type": "boolean",
            "description": "True for an active configured invitation when the viewer may edit its application and this interview. Omitted otherwise."
          },
          "canCancel": {
            "type": "boolean",
            "description": "True for a pending invitation or a meeting whose scheduled end has not passed, if the viewer can edit this interview. Omitted otherwise."
          },
          "sourceChat": {
            "type": "boolean",
            "description": "The invitation can only be sent in its originating application chat."
          },
          "id": {
            "type": "string",
            "description": "public_id приглашения — тот же, что у GET /api/v1/interviews/{id}."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "booked",
              "cancelled",
              "expired"
            ],
            "description": "expired не хранится, а вычисляется: ожидающее приглашение с истёкшим сроком ссылки."
          },
          "startsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало забронированной встречи, UTC. null — брони нет."
          },
          "endsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Конец забронированной встречи, UTC. null — брони нет."
          },
          "tz": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Зона IANA приглашения — в ней рекрутер задавал окно и в ней встреча записана в календари. null — брони нет."
          },
          "attendees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInterviewAttendee"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "link": {
            "type": "string",
            "description": "Ссылка для кандидата в чтении: у приглашения из отклика без токена — страница кабинета кандидата /join/vacancies/<id вакансии>, открывается после входа тем контактом, что в отклике; у токенного — пустая строка: секрет показывается только в ответе на создание."
          },
          "durationMin": {
            "type": "integer",
            "description": "Длительность встречи в минутах: перенос её сохраняет."
          },
          "b24EventId": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Встреча в календаре Б24 — источник времени брони. null — встречи нет."
          },
          "calendarOperation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewCalendarOperation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя операция календаря (перенос или запись встречи бронью). null — операций не было."
          }
        }
      },
      "ApplicationInterviewAttendee": {
        "type": "object",
        "description": "Собеседующий. Имя берётся у пользователя сервиса с тем же b24UserId в этом портале; null — сотрудник Битрикс24 в сервис не входил.",
        "required": [
          "b24UserId",
          "name"
        ],
        "properties": {
          "b24UserId": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ApplicationInterviewsResponse": {
        "type": "object",
        "required": [
          "interviews"
        ],
        "properties": {
          "interviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInterview"
            }
          }
        }
      },
      "DecisionVerdict": {
        "type": "string",
        "description": "Ответ заказчика по кандидату после собеседования: fit — подходит, another_meeting — нужна ещё встреча, unfit — не подходит.",
        "enum": [
          "fit",
          "another_meeting",
          "unfit"
        ]
      },
      "DecisionState": {
        "type": "string",
        "description": "Состояние решения: pending — ждёт ответа заказчика, decided — ответ записан.",
        "enum": [
          "pending",
          "decided"
        ]
      },
      "DecisionQueueItem": {
        "type": "object",
        "description": "Строка очереди решений: выжимка отклика ровно под решение. Контактов кандидата и заметки рекрутера здесь нет — решению они не нужны.",
        "required": [
          "interviewId",
          "applicationId",
          "candidateName",
          "position",
          "source",
          "resumeUrl",
          "availableAt",
          "readyAt",
          "ready",
          "startsAt",
          "endsAt",
          "tz",
          "attendees"
        ],
        "properties": {
          "interviewId": {
            "type": "string",
            "description": "public_id собеседования — адрес решения в POST /api/v1/decisions/{interviewId}."
          },
          "applicationId": {
            "type": "string",
            "description": "public_id отклика."
          },
          "candidateName": {
            "type": "string",
            "description": "ФИО кандидата одной строкой, собранное сервером."
          },
          "position": {
            "type": "string",
            "description": "Должность вакансии."
          },
          "source": {
            "$ref": "#/components/schemas/ApplicationSource"
          },
          "resumeUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ссылка на резюме, только http или https. null — ссылки нет. Только у открывшейся строки (ready: true): ранняя строка видов waiting и all ссылки не несёт — null, решения по ней ещё нет. Строки вида ready отдают ссылку, как раньше."
          },
          "availableAt": {
            "type": "string",
            "format": "date-time",
            "description": "С какого момента решение ждёт — конец забронированного слота, UTC."
          },
          "readyAt": {
            "type": "string",
            "format": "date-time",
            "description": "С какого момента решение можно принять — конец подтверждённой встречи. То же значение, что availableAt."
          },
          "ready": {
            "type": "boolean",
            "description": "Решение открылось на момент ответа. Ранняя строка видна в виде waiting или all; решение по ней сервер отвергает decision_not_ready."
          },
          "startsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало встречи, UTC. null — брони у собеседования нет."
          },
          "endsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Конец встречи, UTC. null — брони у собеседования нет."
          },
          "tz": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Зона IANA приглашения — в ней встреча записана в календари. null — брони нет."
          },
          "attendees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInterviewAttendee"
            }
          },
          "vacancyId": {
            "type": "string",
            "description": "public_id вакансии отклика. Очередь GET /api/v1/decisions отдаёт поле всегда; строка «Ваш ход» (GET /api/v1/turn) его не несёт."
          },
          "vacancyNumber": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер вакансии в пределах портала — «В-N» в подписи строки; null — номера нет. Очередь GET /api/v1/decisions отдаёт поле всегда; строка «Ваш ход» (GET /api/v1/turn) его не несёт."
          },
          "aiAdvice": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionQueueAiAdvice"
              },
              {
                "type": "null"
              }
            ],
            "description": "Совет ИИ по сохранённой сводке решения: рекомендация и дробь портрета, без текста сводки. null — у ранней строки (ready: false), у отклика без сводки и у сводки, которую сервер не прочёл; запросу по ключу доступа — всегда null: сводка решения доступна только из кабинета. Устаревание сводки здесь не считается. Очередь GET /api/v1/decisions отдаёт поле всегда; строка «Ваш ход» (GET /api/v1/turn) его не несёт."
          }
        }
      },
      "DecisionQueueAiAdvice": {
        "type": "object",
        "description": "Совет ИИ строке очереди решений: категория рекомендации сводки и счёт требований портрета. Ни текста сводки, ни самих требований.",
        "required": [
          "recommendation",
          "requirementsMet",
          "requirementsTotal"
        ],
        "properties": {
          "recommendation": {
            "type": "string",
            "enum": [
              "fit",
              "another_meeting",
              "unfit",
              "unsure"
            ],
            "description": "Рекомендация ИИ — тот же словарь, что DecisionSummary.recommendation: fit — скорее подходит; another_meeting — стоит встретиться ещё; unfit — скорее не подходит; unsure — данных мало."
          },
          "requirementsMet": {
            "type": "integer",
            "description": "Сколько требований портрета (вид requirement) сводка считает подтверждёнными."
          },
          "requirementsTotal": {
            "type": "integer",
            "description": "Сколько требований портрета вида requirement сводка оценивает: все, кроме «Не оценивается» (excluded). Стоп-факторы не считаются."
          }
        }
      },
      "DecisionQueueResponse": {
        "type": "object",
        "required": [
          "decisions",
          "nextCursor"
        ],
        "properties": {
          "decisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DecisionQueueItem"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы; null — страница последняя."
          }
        }
      },
      "DecisionCount": {
        "type": "object",
        "required": [
          "count",
          "waiting",
          "total",
          "nextReadyAt"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Сколько собеседований уже ждёт решения вызывающего."
          },
          "waiting": {
            "type": "integer",
            "description": "Сколько запросов ждёт конца встречи."
          },
          "total": {
            "type": "integer",
            "description": "Все ожидающие запросы решения: count + waiting."
          },
          "nextReadyAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ближайший конец встречи среди ожидающих решения; null — ожидающих нет."
          }
        }
      },
      "DecisionRequest": {
        "type": "object",
        "required": [
          "verdict"
        ],
        "properties": {
          "verdict": {
            "$ref": "#/components/schemas/DecisionVerdict"
          },
          "comment": {
            "type": "string",
            "maxLength": 4000,
            "description": "Комментарий заказчика. ОБЯЗАТЕЛЕН у unfit: отказ отклику без причины рекрутеру не даёт ничего. Края обрезаются; пустой хранится как отсутствие комментария."
          }
        }
      },
      "ApplicationDecision": {
        "type": "object",
        "description": "Круг решения заказчика по собеседованию отклика.",
        "required": [
          "interviewId",
          "decider",
          "availableAt",
          "state",
          "verdict",
          "comment",
          "decidedAt",
          "awaiting"
        ],
        "properties": {
          "interviewId": {
            "type": "string",
            "description": "public_id собеседования, по итогам которого решение."
          },
          "decider": {
            "$ref": "#/components/schemas/AppPerson",
            "description": "Кто решает — заказчик вакансии на момент брони (пока заказчик не назван — автор)."
          },
          "availableAt": {
            "type": "string",
            "format": "date-time",
            "description": "С какого момента решение ждёт — конец забронированного слота, UTC."
          },
          "state": {
            "$ref": "#/components/schemas/DecisionState"
          },
          "verdict": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionVerdict"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ответ заказчика; null — решения ещё нет."
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий заказчика; null — его нет."
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент решения, UTC; null — решения ещё нет."
          },
          "awaiting": {
            "type": "boolean",
            "description": "Круг ждёт решения заказчика сейчас — тот же отбор, по которому строка стоит в его очереди GET /api/v1/decisions: встреча закончилась, решения нет, отклик активен, вакансия не завершена. state = pending этого не говорит: отклик, ушедший в rejected или hired, и завершённая вакансия снимают вопрос, а строка остаётся ждущей."
          }
        }
      },
      "ApplicationDecisionsResponse": {
        "type": "object",
        "required": [
          "decisions"
        ],
        "properties": {
          "decisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationDecision"
            }
          }
        }
      },
      "VacancyStageFilter": {
        "type": "string",
        "enum": [
          "draft",
          "approval",
          "rejected",
          "new",
          "preparation",
          "screening",
          "completed",
          "open",
          "requests",
          "approved"
        ],
        "description": "Отбор по этапу вакансии: код одного этапа, open — все этапы, кроме completed, или группа плана найма. requests — заявки: draft и approval; approved — согласованные: new, preparation, screening и completed. Группа «Отклонённые» — это код этапа rejected. Группы не пересекаются и вместе покрывают все этапы."
      },
      "InterviewPerson": {
        "type": "object",
        "description": "Человек портала в пикере собеседующих. b24_user_id, а не наш public_id: собеседующему не нужно входить в сервис, и своей строки в user у него может не быть вовсе.",
        "required": [
          "b24UserId",
          "name"
        ],
        "properties": {
          "b24UserId": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "InterviewPeopleResponse": {
        "type": "object",
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InterviewPerson"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "null — страница последняя."
          }
        }
      },
      "Interval": {
        "type": "object",
        "description": "Отрезок времени, в UTC: предложенное рекрутёром время или свободное окно расчёта.",
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InterviewAvailabilityRequest": {
        "type": "object",
        "required": [
          "attendees",
          "durationMin",
          "days",
          "fromMin",
          "toMin",
          "tz",
          "from",
          "to"
        ],
        "properties": {
          "attendees": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "b24_user_id собеседующих, чья занятость проверяется."
          },
          "durationMin": {
            "type": "integer",
            "minimum": 5,
            "maximum": 480
          },
          "days": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 6
            },
            "description": "Дни недели рабочего окна: 0 — воскресенье, 6 — суббота."
          },
          "fromMin": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "toMin": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "tz": {
            "type": "string",
            "description": "Зона IANA рабочего окна, например Europe/Kaliningrad. Пустая строка и Local не принимаются — отказ поля tz, как у оффера и отметки выхода."
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InterviewAvailabilityResponse": {
        "type": "object",
        "required": [
          "slots"
        ],
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          }
        }
      },
      "InterviewDay": {
        "type": "object",
        "required": [
          "date",
          "freeCount"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "Календарная дата в зоне окна (tz запроса), YYYY-MM-DD."
          },
          "freeCount": {
            "type": "integer",
            "description": "Сколько свободных окон длиной durationMin помещается в этот день."
          }
        }
      },
      "InterviewAvailabilityDaysResponse": {
        "type": "object",
        "required": [
          "days"
        ],
        "properties": {
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InterviewDay"
            },
            "description": "Запись на каждый календарный день диапазона, включая дни с нулём окон."
          }
        }
      },
      "InterviewCreateRequest": {
        "type": "object",
        "required": [
          "durationMin",
          "tz",
          "attendees",
          "leadB24UserId",
          "slots"
        ],
        "properties": {
          "configureSend": {
            "type": "boolean",
            "description": "On POST /api/v1/interviews, create a linked invitation without queuing any channel or changing the candidate's outbound email preference. Requires applicationId and an existing email contact or a sourceChat challenge. Cannot be combined with sendInvite=true, deliveryChannel, or an email decision. Other commands reject this mode."
          },
          "sourceChat": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Opaque challenge from interview-preset for configureSend. Leave candidateContact and contactKind empty."
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "public_id отклика, из которого зовут на собеседование. С ним имя кандидата и вакансию берёт сервер: имя — снимком из карточки кандидата на момент приглашения, вакансия — вакансия отклика. Создание такого приглашения переводит отклик вакансии сценария regular, стоящий на new, на этап interview. Не прислан или null — приглашение ни к чему не привязано, как у человека вне базы."
          },
          "candidateName": {
            "type": "string",
            "maxLength": 255,
            "description": "Имя кандидата. Обязательно без applicationId; вместе с applicationId — отказ invalid_value: имя берёт сервер, и присланное имя не игнорируется молча."
          },
          "candidateContact": {
            "type": "string",
            "maxLength": 255,
            "description": "Куда уйдёт ссылка. С applicationId — строго одно из значений контактов кандидата этого отклика (candidate.contacts[].value в GET /api/v1/applications/{id}), иначе invalid_value: свободного ввода контакта при привязке нет. Для deliveryChannel=telegram не передаётся или пусто: исходный чат берётся только из подтверждённого отклика."
          },
          "contactKind": {
            "type": "string",
            "enum": [
              "phone",
              "email",
              "other",
              ""
            ],
            "description": "Вид контакта кандидата. Решает, каким каналом доставить приглашение: почтой сегодня, СМС когда появится. Значение other хранится как telegram — тип «другое» на клиенте означает «не почта и не телефон». Поле НЕОБЯЗАТЕЛЬНО, и таким останется: клиент, выпущенный до его появления, продолжает заводить приглашения. Без него вид контакта остаётся неизвестным, и отправка такому приглашению отвечает delivery_unroutable — доставить его нечем. Присланное, но неизвестное значение — invalid_value. Известный вид, не сошедшийся со значением (например email у «<a@b.ru>» или phone у «12345»), записывается как НЕИЗВЕСТНЫЙ: создание проходит, а contactKind в ответе null — отправка такому контакту всё равно ответила бы delivery_unroutable, и обещать её кнопкой было бы ложью. Вид «other» со значением не сверяется: образца у него нет. Приглашение из отклика сверяется с карточкой кандидата и отвечает invalid_value, а не обнуляет."
          },
          "durationMin": {
            "type": "integer",
            "minimum": 5,
            "maximum": 480
          },
          "tz": {
            "type": "string",
            "description": "Зона IANA: та же, что видел рекрутёр в расчёте окон. Пустая строка и Local не принимаются — отказ поля tz, как у оффера и отметки выхода."
          },
          "attendees": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "leadB24UserId": {
            "type": "integer",
            "format": "int64",
            "description": "Ведущий обязан входить в attendees."
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            },
            "description": "Предложенные времена — то, что рекрутёр отметил после расчёта свободных окон."
          },
          "sendInvite": {
            "type": "boolean",
            "description": "Отправить приглашение кандидату сразу после создания. Требует contactKind, которому есть чем доставить: иначе отказ delivery_unroutable. Отправки без этого признака не бывает — ссылка уходит человеку только по явному решению рекрутёра. По умолчанию false; отсутствие поля не включает отправку.\n\nАтомарно поставить приглашение в выбранную очередь при создании. Без признака приглашение создаётся без отправки; Telegram route проверяется в обоих случаях."
          },
          "deliveryChannel": {
            "type": "string",
            "enum": [
              "telegram"
            ],
            "description": "Подтверждённый исходный private чат нового отклика; отсутствие поля сохраняет прежний контактный путь."
          },
          "email": {
            "$ref": "#/components/schemas/CandidateB24EmailDecision",
            "description": "Optional outbound email decision; the server uses saved when omitted."
          }
        },
        "description": "Telegram требует applicationId и отсутствие или пустые candidateName/candidateContact/contactKind (422 invalid_value, details.field). Без deliveryChannel действует прежний договор: candidateContact обязателен; свободное имя нужно без applicationId. Даже sendInvite=false Telegram проверяет живой подтверждённый маршрут под замком отклика."
      },
      "Interview": {
        "type": "object",
        "description": "Строка списка приглашений. Собеседующие и предложенные времена сюда не входят: список читает много строк разом, и запрос их на каждую строку завёл бы N+1 (см. InterviewCard — там они есть, но на ОДНУ карточку).",
        "required": [
          "id",
          "application",
          "candidateName",
          "candidateContact",
          "contactKind",
          "durationMin",
          "tz",
          "status",
          "leadB24UserId",
          "b24EventId",
          "bookedAt",
          "expiresAt",
          "link",
          "delivery",
          "calendarOperation",
          "calendarRemoval",
          "telegramRecipientRetired"
        ],
        "properties": {
          "sourceChat": {
            "type": "boolean",
            "description": "The invitation can only be sent in its originating application chat."
          },
          "id": {
            "type": "string",
            "description": "public_id приглашения."
          },
          "application": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewApplication"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отклик, из которого позвали на собеседование, ссылкой; null — приглашение ни к чему не привязано, как у человека вне базы. Открыть отклик — GET /api/v1/applications/{id}, под своим уровнем: ссылка отклик только называет."
          },
          "candidateName": {
            "type": "string"
          },
          "candidateContact": {
            "type": "string"
          },
          "contactKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "phone",
                  "email",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид контакта кандидата; null — вид неизвестен: приглашение заведено до появления этого поля, вызывающий его не назвал, либо назвал, но он не сошёлся со значением (см. InterviewCreateRequest.contactKind)."
          },
          "durationMin": {
            "type": "integer"
          },
          "tz": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "booked",
              "cancelled",
              "expired"
            ]
          },
          "leadB24UserId": {
            "type": "integer",
            "format": "int64"
          },
          "b24EventId": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Встреча Б24. Заполняется бронированием кандидата (публичный контур)."
          },
          "bookedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "link": {
            "type": "string",
            "description": "Ссылка для кандидата в чтении: у приглашения из отклика без токена — страница кабинета кандидата /join/vacancies/<id вакансии>, открывается после входа тем контактом, что в отклике; у токенного — пустая строка: секрет показывается только в ответе на создание."
          },
          "delivery": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewDelivery"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя отправка приглашения. null — не отправляли ни разу. Считается одним запросом на всю страницу списка, а не на строку."
          },
          "deliveryChannel": {
            "type": "string",
            "enum": [
              "telegram"
            ],
            "description": "Подтверждённый исходный private чат нового отклика; отсутствие поля сохраняет прежний контактный путь."
          },
          "calendarOperation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewCalendarOperation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя операция календаря (перенос или запись встречи бронью). null — операций не было."
          },
          "calendarRemoval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewCalendarRemoval"
              },
              {
                "type": "null"
              }
            ],
            "description": "Намерение удалить встречу, отменённую закрытием вакансии; null — намерения нет. Считается одним запросом на всю страницу списка."
          },
          "telegramRecipientRetired": {
            "type": "boolean",
            "description": "Получатель Telegram принадлежит завершённому подключению: повторная отправка недоступна. Не меняет фактический исход последней доставки."
          }
        }
      },
      "InterviewListResponse": {
        "type": "object",
        "required": [
          "interviews"
        ],
        "properties": {
          "interviews": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interview"
            }
          }
        }
      },
      "InterviewApplication": {
        "type": "object",
        "description": "Отклик приглашения ссылкой, как вакансия у отклика. Остальное об отклике отдаёт GET /api/v1/applications/{id}.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id отклика."
          }
        }
      },
      "InterviewCard": {
        "type": "object",
        "description": "Карточка приглашения: список плюс то, что нужно только на ОДНУ строку — собеседующие, предложенные времена, выбранное. Поля Interview повторены здесь плоско, а не вынесены общей схемой: это тело успеха создания, карточки и отмены сразу, и три обёртки ссылкой усложнили бы контракт больше, чем экономят.",
        "required": [
          "id",
          "application",
          "candidateName",
          "candidateContact",
          "contactKind",
          "durationMin",
          "tz",
          "status",
          "leadB24UserId",
          "b24EventId",
          "bookedAt",
          "expiresAt",
          "attendees",
          "slots",
          "chosenSlot",
          "link",
          "b24EventRemoved",
          "delivery",
          "calendarOperation",
          "calendarRemoval",
          "telegramRecipientRetired"
        ],
        "properties": {
          "sourceChat": {
            "type": "boolean",
            "description": "The invitation can only be sent in its originating application chat."
          },
          "id": {
            "type": "string",
            "description": "public_id приглашения."
          },
          "application": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewApplication"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отклик, из которого позвали на собеседование, ссылкой; null — приглашение ни к чему не привязано, как у человека вне базы. Открыть отклик — GET /api/v1/applications/{id}, под своим уровнем: ссылка отклик только называет."
          },
          "candidateName": {
            "type": "string"
          },
          "candidateContact": {
            "type": "string"
          },
          "contactKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "phone",
                  "email",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид контакта кандидата; null — вид неизвестен: приглашение заведено до появления этого поля, вызывающий его не назвал, либо назвал, но он не сошёлся со значением (см. InterviewCreateRequest.contactKind)."
          },
          "durationMin": {
            "type": "integer"
          },
          "tz": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "booked",
              "cancelled",
              "expired"
            ]
          },
          "leadB24UserId": {
            "type": "integer",
            "format": "int64"
          },
          "b24EventId": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64"
              },
              {
                "type": "null"
              }
            ],
            "description": "Встреча Б24. Заполняется бронированием кандидата (публичный контур)."
          },
          "bookedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "attendees": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "b24_user_id собеседующих."
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Interval"
            }
          },
          "chosenSlot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Interval"
              },
              {
                "type": "null"
              }
            ]
          },
          "link": {
            "type": "string",
            "description": "Ссылка для кандидата. У приглашения из отклика без токена — адрес его страницы в кабинете кандидата /join/vacancies/<id вакансии>: она есть всегда, секрета не несёт и открывается только после входа тем телефоном или почтой, что указаны в отклике, — сама по себе она не допуск. У токенного приглашения (без отклика или из отклика, когда кабинет не доводит кандидата: у него нет телефона и почты или вход в кабинет недоступен) — секретная ссылка, непустая ОДИН РАЗ, в ответе на создание; в прочих ответах — пустая строка."
          },
          "b24EventRemoved": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Итог попытки снять встречу в Б24 при отмене приглашения. Заполняется ТОЛЬКО ответом ОТМЕНЫ, тем же приёмом, что и link: во всех прочих ответах (создание, карточка) — всегда null. null у самой отмены значит «приглашение не было забронировано, снимать нечего»; true — встреча снята; false — попытка не удалась, снимите её в Битрикс24 сами. Отказ портала на снятии не превращает отмену в отказ ручки — он только меняет это поле."
          },
          "delivery": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewDelivery"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя отправка приглашения. null — не отправляли ни разу."
          },
          "deliveryChannel": {
            "type": "string",
            "enum": [
              "telegram"
            ],
            "description": "Подтверждённый исходный private чат нового отклика; отсутствие поля сохраняет прежний контактный путь."
          },
          "calendarOperation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewCalendarOperation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя операция календаря (перенос или запись встречи бронью). null — операций не было."
          },
          "calendarRemoval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewCalendarRemoval"
              },
              {
                "type": "null"
              }
            ],
            "description": "Намерение удалить встречу, отменённую закрытием вакансии; null — намерения нет. Считается одним запросом на всю страницу списка."
          },
          "telegramRecipientRetired": {
            "type": "boolean",
            "description": "Получатель Telegram принадлежит завершённому подключению: повторная отправка недоступна. Не меняет фактический исход последней доставки."
          },
          "b24": {
            "$ref": "#/components/schemas/CandidateB24OutboundReceipt"
          },
          "b24Action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppChatIntent"
              },
              {
                "type": "null"
              }
            ]
          },
          "b24Replay": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InterviewRescheduleReplay"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "InterviewReadiness": {
        "type": "object",
        "description": "Готов ли раздел к работе. Проверяется при открытии раздела (а не в момент, когда кандидат выбирает время): скоуп calendar приезжает человеку только со следующим его входом, и об этом должен узнать рекрутёр, который может что-то предпринять.",
        "required": [
          "ready",
          "reason",
          "delivery",
          "resendMax",
          "resendPauseSec"
        ],
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "resendMax": {
            "type": "integer",
            "description": "Потолок отправок письма на одно приглашение. Число приходит ответом, а не подразумевается: клиент показывает человеку тот же предел, который применяет сервер."
          },
          "resendPauseSec": {
            "type": "integer",
            "description": "Пауза между отправками ОДНОГО приглашения, в секундах. Применяется к InterviewDelivery.queuedAt: пока она не вышла, сервер отвечает 429 resend_too_soon, и клиент, знающий оба числа, не предлагает кнопку, которой будет отказано. Тем же приёмом, что resendMax: число решает сервер."
          },
          "reason": {
            "type": "string",
            "enum": [
              "ok",
              "scope_missing",
              "webhook_dead",
              "box_portal"
            ],
            "description": "ok — всё готово. scope_missing — вебхук жив, но выпущен до расширения набора: нужно зайти в сервис заново. webhook_dead — вебхук не отвечает или отвечает не тем владельцем. box_portal — устаревшее значение, сохранённое для совместимости; текущий сервер его не возвращает."
          },
          "delivery": {
            "type": "string",
            "enum": [
              "ok",
              "not_configured"
            ],
            "description": "Готова ли отправка приглашений почтой. Отдельное поле, а не значение reason: календарь и почта отказывают независимо, и слить их в одно перечисление значит заставить экран умолчать об одном из двух."
          },
          "telegramDelivery": {
            "type": "string",
            "enum": [
              "ok",
              "not_configured"
            ],
            "description": "Готовность Telegram не зависит от SMTP; календарная ready остаётся обязательной."
          },
          "deliveryByContact": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "ok",
                "not_configured",
                "limit"
              ]
            }
          },
          "cancelDeliveryByContact": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "ok",
                "not_configured",
                "limit"
              ]
            }
          },
          "companyContact": {
            "$ref": "#/components/schemas/InterviewCompanyContact",
            "description": "Только при параметре application: готовность публичного контакта компании вакансии отклика. Поля нет — запрос без application."
          }
        }
      },
      "OfferState": {
        "type": "string",
        "description": "Состояние оффера: sent — отправлен и ждёт ответа кандидата; accepted — принят; declined — отклонён кандидатом; withdrawn — отозван рекрутером; expired — срок ответа вышел; no_show — принят, но кандидат не вышел на работу. Отправленный с вышедшим сроком приходит как expired сразу, даже если его ещё не открывали.",
        "enum": [
          "sent",
          "accepted",
          "declined",
          "withdrawn",
          "expired",
          "no_show"
        ]
      },
      "ApplicationOffer": {
        "type": "object",
        "description": "Оффер отклика. Вилка и валюта — снимок вакансии в момент отправки: «вне вилки» судится по той вилке, что действовала тогда, а не по сегодняшней.",
        "required": [
          "id",
          "link",
          "amount",
          "currency",
          "forkMin",
          "forkMax",
          "salaryHidden",
          "salaryMasked",
          "outOfFork",
          "overForkReason",
          "startDate",
          "conditions",
          "state",
          "respondBy",
          "expiresAt",
          "tz",
          "sentAt",
          "respondedAt",
          "declineReason",
          "delivery",
          "approval"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id оффера."
          },
          "link": {
            "type": "string",
            "description": "Адрес страницы оффера в кабинете кандидата; открывается после входа кандидата тем контактом, что в отклике. Постоянный: секрета в адресе нет, и его можно отдать кандидату в любой момент.",
            "example": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37"
          },
          "amount": {
            "type": "string",
            "description": "Сумма строкой, как вилка вакансии: DECIMAL(14,2) не помещается в число с плавающей точкой без потерь."
          },
          "currency": {
            "type": "string",
            "description": "Валюта вакансии на момент отправки, ISO 4217."
          },
          "forkMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница вилки на момент отправки; null — не ограничивала или скрыта от смотрящего (salaryMasked)."
          },
          "forkMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница вилки на момент отправки; null — не ограничивала или скрыта от смотрящего (salaryMasked)."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Вилка вакансии отклика скрыта от автора заявки (снимок salary_hidden вакансии). Приходит всегда, false — у открытой. При true автору вакансии ниже правки вакансий на уровне all forkMin и forkMax приходят null. Скрыта ли она от смотрящего, говорит salaryMasked, а не null: вилка hidden бывает и без границ. Остальным вилка видна, и признак приходит им тоже."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Снимок вилки скрыт ОТ ЭТОГО смотрящего: salaryHidden = true, смотрящий — автор вакансии отклика, правка вакансий ниже all. Приходит всегда; только этот признак отличает скрытую вилку от незаданной."
          },
          "outOfFork": {
            "type": "boolean",
            "description": "Сумма вне вилки на момент отправки. Считает сервер — сравнение денег строкой повторять у себя не нужно. Не маскируется и при скрытой вилке: вместе с суммой выдаёт о ней один бит, и это принято."
          },
          "overForkReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему сумма вне вилки; есть только у суммы вне вилки."
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Плановая дата выхода."
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия оффера; null — не заданы."
          },
          "state": {
            "$ref": "#/components/schemas/OfferState"
          },
          "respondBy": {
            "type": "string",
            "format": "date",
            "description": "Последний день ответа кандидата в зоне tz."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Момент истечения срока ответа, UTC: первый момент дня после respondBy в зоне tz."
          },
          "tz": {
            "type": "string",
            "description": "Зона рекрутера (IANA), в которой назван срок ответа."
          },
          "sentAt": {
            "type": "string",
            "format": "date-time",
            "description": "Момент отправки, UTC."
          },
          "respondedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент ответа кандидата, UTC; null — ответа не было."
          },
          "declineReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина отказа кандидата; null — не отказывался или причину не назвал."
          },
          "delivery": {
            "$ref": "#/components/schemas/LinkDeliverySummary"
          },
          "approval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferApprovalOutcome"
              },
              {
                "type": "null"
              }
            ],
            "description": "Исход согласования оффера, отправленного из подготовленного (вакансия с согласованием оффера); null — оффер отправлен сразу, без согласования."
          }
        }
      },
      "ApplicationOffersResponse": {
        "type": "object",
        "required": [
          "offers",
          "approvalRequired",
          "prepared",
          "defaultApprover"
        ],
        "properties": {
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationOffer"
            }
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "У вакансии отклика согласование оффера: оффер готовится (POST /api/v1/applications/{id}/offer-drafts) и уходит кандидату после решения согласующего оффера или без согласования с причиной; прямая отправка отвечает 409 offer_approval_required."
          },
          "prepared": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferDraft"
              },
              {
                "type": "null"
              }
            ],
            "description": "Подготовленный оффер отклика, ещё не отправленный кандидату, с текущим запросом согласующему и доступными действиями; null — подготовленного нет."
          },
          "defaultApprover": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferApprover"
              },
              {
                "type": "null"
              }
            ],
            "description": "Согласующий оффера по умолчанию сейчас: заказчик вакансии, иначе её автор; его показывает окно оффера до выбора. null — у вакансии нет согласования оффера."
          }
        }
      },
      "ApplicationOfferSent": {
        "type": "object",
        "description": "Отправленный оффер и ссылка кандидату — тот же адрес, что offer.link.",
        "required": [
          "offer",
          "link"
        ],
        "properties": {
          "offer": {
            "$ref": "#/components/schemas/ApplicationOffer"
          },
          "link": {
            "type": "string",
            "description": "Адрес страницы оффера в кабинете кандидата; открывается после входа кандидата тем контактом, что в отклике.",
            "example": "https://hrm.example.ru/join/offer/7a3e9c10-5b2d-4f81-9e64-2c8d1b0f5a37"
          }
        }
      },
      "OfferCreateRequest": {
        "type": "object",
        "required": [
          "amount",
          "startDate",
          "respondBy",
          "tz"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Сумма: цифры и точка, больше нуля, не больше двенадцати знаков целой части и двух дробной."
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Плановая дата выхода, 2006-01-02."
          },
          "respondBy": {
            "type": "string",
            "format": "date",
            "description": "Последний день ответа кандидата, 2006-01-02: не раньше завтра и не позже тридцати дней от сегодня в зоне tz."
          },
          "tz": {
            "type": "string",
            "description": "Зона рекрутера, IANA: в ней считаются «сегодня» и конец срока ответа. Пустая строка и Local не принимаются."
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия оффера, не длиннее 4000 знаков; пустое — «нет»."
          },
          "overForkReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему сумма вне вилки вакансии. Обязательна у суммы вне вилки; у суммы в вилке не хранится. Не длиннее 4000 знаков."
          }
        }
      },
      "OfferWithdrawRequest": {
        "type": "object",
        "required": [
          "fromState"
        ],
        "properties": {
          "fromState": {
            "type": "string",
            "enum": [
              "sent",
              "accepted"
            ],
            "description": "Состояние оффера, которое видел вызывающий. Расходится с настоящим — отзыва нет, ответ offer_state_changed: иначе отзыв по устаревшей странице молча снял бы принятый оффер."
          }
        }
      },
      "OfferDraft": {
        "type": "object",
        "description": "Подготовленный оффер отклика у вакансии с признаком согласования оффера. Кандидат его не видит, пока рекрутер не отправит его кандидату. Вилка и валюта — снимок вакансии при подготовке или при последней новой версии условий.",
        "required": [
          "id",
          "amount",
          "currency",
          "forkMin",
          "forkMax",
          "salaryHidden",
          "salaryMasked",
          "outOfFork",
          "overForkReason",
          "startDate",
          "conditions",
          "respondBy",
          "tz",
          "version",
          "revision",
          "approval",
          "bypassClosed",
          "bypass",
          "can",
          "approver"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id подготовленного оффера. Отправленный кандидату оффер получает тот же id."
          },
          "amount": {
            "type": "string",
            "description": "Сумма строкой, как вилка вакансии."
          },
          "currency": {
            "type": "string",
            "description": "Валюта вакансии на момент подготовки или последней новой версии, ISO 4217."
          },
          "forkMin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Нижняя граница снимка вилки; null — не ограничивала или скрыта от смотрящего (salaryMasked)."
          },
          "forkMax": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Верхняя граница снимка вилки; null — не ограничивала или скрыта от смотрящего (salaryMasked)."
          },
          "salaryHidden": {
            "type": "boolean",
            "description": "Вилка вакансии отклика скрыта от автора заявки — то же правило, что у оффера отклика."
          },
          "salaryMasked": {
            "type": "boolean",
            "description": "Снимок вилки скрыт ОТ ЭТОГО смотрящего; только этот признак отличает скрытую вилку от незаданной."
          },
          "outOfFork": {
            "type": "boolean",
            "description": "Сумма вне снимка вилки. Считает сервер; не маскируется."
          },
          "overForkReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему сумма вне вилки; есть только у суммы вне вилки."
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Плановая дата выхода."
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия оффера; null — не заданы."
          },
          "respondBy": {
            "type": "string",
            "format": "date",
            "description": "Последний день ответа кандидата в зоне tz; проверяется ещё раз при отправке кандидату."
          },
          "tz": {
            "type": "string",
            "description": "Зона рекрутера (IANA), в которой назван срок ответа."
          },
          "version": {
            "type": "integer",
            "description": "Версия условий: растёт, только когда меняются сумма, валюта, дата выхода, условия или причина вне вилки. Новая версия снимает согласование и гасит ожидающий запрос."
          },
          "revision": {
            "type": "integer",
            "description": "Ревизия: растёт с любой переменой, в том числе с решением согласующего. Правка, удаление, запрос согласования и отправка кандидату несут ревизию, которую видел вызывающий."
          },
          "approval": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferDraftApproval"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текущий запрос согласующему — последний запрос этой версии условий, не погашенный; null — запроса по этой версии нет."
          },
          "bypassClosed": {
            "type": "boolean",
            "description": "Отправить кандидату без согласования нельзя: согласующий отклонил оффер этого отклика после последней отправки. Нужна согласованная версия."
          },
          "bypass": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferDraftBypass"
              },
              {
                "type": "null"
              }
            ],
            "description": "Отправка кандидату без согласования: когда, кто и почему; null — не было."
          },
          "can": {
            "$ref": "#/components/schemas/OfferDraftCan"
          },
          "approver": {
            "$ref": "#/components/schemas/OfferApprover",
            "description": "Согласующий оффера: решающий ожидающего запроса; без него — выбранный у оффера, иначе заказчик вакансии, иначе её автор — тот, кому уйдёт следующий запрос."
          }
        }
      },
      "OfferDraftApproval": {
        "type": "object",
        "description": "Запрос согласования подготовленного оффера согласующему: выбранному у оффера, иначе заказчику вакансии, иначе её автору — на момент запроса.",
        "required": [
          "state",
          "delivery",
          "deliveryFailure",
          "deliveryAttempt",
          "approver",
          "requestedAt",
          "decidedAt",
          "rejectReason",
          "remindedAt",
          "remindAfter",
          "selfApproved"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "description": "pending — ждёт решения, approved — согласован, rejected — отклонён."
          },
          "delivery": {
            "type": "string",
            "enum": [
              "queued",
              "delivered",
              "failed"
            ],
            "description": "Доставка текущей попытки сообщения согласующему: queued — отправляется, delivered — доставлено, failed — не доставлено (в том числе если попытка слишком долго в очереди)."
          },
          "deliveryFailure": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "bot_disabled",
                  "recipient_unreachable",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему сообщение не доставлено; есть только при delivery = failed. bot_disabled — бот HR AI не работает на портале или в контуре; recipient_unreachable — согласующий не действует или без учётки Битрикс24; other — прочее, в том числе слишком долго в очереди."
          },
          "deliveryAttempt": {
            "type": "integer",
            "description": "Номер текущей попытки доставки: запрос — первая, каждое «Напомнить» и «Отправить повторно» — следующая; ревизия при этом не меняется."
          },
          "approver": {
            "$ref": "#/components/schemas/AppPerson",
            "description": "Решающий — согласующий оффера: выбранный у оффера, иначе заказчик вакансии, иначе её автор, на момент запроса."
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Момент запроса, UTC."
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент решения, UTC; null — решения нет."
          },
          "rejectReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина отказа согласующего; есть только у rejected."
          },
          "remindedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент последнего напоминания, UTC; null — не напоминали."
          },
          "remindAfter": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "С какого момента можно напомнить, UTC; есть только у pending."
          },
          "selfApproved": {
            "type": "boolean",
            "description": "Согласовал автор запроса: решающий (согласующий оффера на момент запроса) — тот же человек, что запросил согласование. true только у approved; самосогласование допустимо, но видно."
          }
        }
      },
      "OfferDraftBypass": {
        "type": "object",
        "description": "Отправка оффера кандидату без согласования.",
        "required": [
          "at",
          "by",
          "reason"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "Момент отправки, UTC."
          },
          "by": {
            "$ref": "#/components/schemas/AppPerson",
            "description": "Кто отправил."
          },
          "reason": {
            "type": "string",
            "description": "Причина отправки без согласования."
          }
        }
      },
      "OfferDraftCan": {
        "type": "object",
        "description": "Действия над подготовленным оффером, доступные сейчас: те же правила, что у операций. Правка и удаление доступны всегда, пока оффер подготовлен.",
        "required": [
          "request",
          "remind",
          "resend",
          "sendApproved",
          "bypass"
        ],
        "properties": {
          "request": {
            "type": "boolean",
            "description": "Можно попросить согласующего согласовать: нет ожидающего запроса, версия не согласована и такие условия в этом отклике не отклоняли."
          },
          "remind": {
            "type": "boolean",
            "description": "Можно напомнить: запрос ждёт решения, сообщение доставлено и с запроса или прошлого напоминания прошёл час."
          },
          "resend": {
            "type": "boolean",
            "description": "Можно отправить запрос повторно: сообщение согласующему не доставлено."
          },
          "sendApproved": {
            "type": "boolean",
            "description": "Можно отправить кандидату: текущая версия согласована."
          },
          "bypass": {
            "type": "boolean",
            "description": "Можно отправить кандидату без согласования с причиной."
          }
        }
      },
      "OfferApprover": {
        "type": "object",
        "description": "Согласующий оффера: кому уходит запрос согласования и кто решает. Номер Битрикс24 — тот же, что принимает approverB24UserId и отдаёт справочник GET /api/v1/applications/directory/people. Имя — из профиля HR AI, у не входившего в HR AI — из Битрикс24; фото — только у входившего.",
        "required": [
          "b24UserId",
          "name",
          "avatarUrl"
        ],
        "properties": {
          "b24UserId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер Битрикс24 согласующего; null — у человека HR AI нет учётки Битрикс24."
          },
          "name": {
            "type": "string",
            "description": "ФИО согласующего."
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес фото; null — фото нет."
          }
        }
      },
      "OfferDraftWrite": {
        "type": "object",
        "description": "Правка подготовленного оффера: форма оффера целиком и ревизия, которую видел вызывающий. Ключа approverB24UserId нет — согласующий не меняется; null — согласующий по умолчанию (заказчик вакансии, иначе автор); число — выбранный.",
        "required": [
          "revision",
          "amount",
          "startDate",
          "respondBy",
          "tz"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Ревизия подготовленного оффера, которую видел вызывающий."
          },
          "amount": {
            "type": "string",
            "description": "Сумма: цифры и точка, больше нуля, не больше двенадцати знаков целой части и двух дробной."
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Плановая дата выхода, 2006-01-02."
          },
          "respondBy": {
            "type": "string",
            "format": "date",
            "description": "Последний день ответа кандидата, 2006-01-02: не раньше завтра и не позже тридцати дней от сегодня в зоне tz."
          },
          "tz": {
            "type": "string",
            "description": "Зона рекрутера, IANA: в ней считаются «сегодня» и конец срока ответа. Пустая строка и Local не принимаются."
          },
          "conditions": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Условия оффера, не длиннее 4000 знаков; пустое — «нет»."
          },
          "overForkReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему сумма вне вилки вакансии. Обязательна у суммы вне вилки; у суммы в вилке не хранится. Не длиннее 4000 знаков."
          },
          "approverB24UserId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Согласующий оффера — номер Битрикс24 человека портала (как id справочника GET /api/v1/applications/directory/people). Годится живой человек снимка Битрикс24 этого портала или действующий человек сервиса с этим номером; иначе (чужой портал, уволен, пропал, не больше нуля) — 400 invalid_value, details.field = approverB24UserId. Только из кабинета: запрос по ключу API с этим ключом (число или null) получает 403 forbidden. Смена при ожидающем запросе, если новый согласующий — другой человек, гасит запрос; новый отправляется кнопкой. Версию оффера выбор не меняет."
          }
        }
      },
      "OfferDraftCreate": {
        "description": "Подготовка оффера: форма оффера (как у прямой отправки) и согласующий. Ключа approverB24UserId нет или null — согласующий по умолчанию: заказчик вакансии, иначе её автор, на момент запроса.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OfferCreateRequest"
          },
          {
            "type": "object",
            "properties": {
              "approverB24UserId": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 1
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Согласующий оффера — номер Битрикс24 человека портала (как id справочника GET /api/v1/applications/directory/people). Годится живой человек снимка Битрикс24 этого портала или действующий человек сервиса с этим номером; иначе (чужой портал, уволен, пропал, не больше нуля) — 400 invalid_value, details.field = approverB24UserId. Только из кабинета: запрос по ключу API с этим ключом (число или null) получает 403 forbidden."
              }
            }
          }
        ]
      },
      "OfferDraftRevision": {
        "type": "object",
        "description": "Ревизия подготовленного оффера, которую видел вызывающий.",
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Ревизия подготовленного оффера."
          }
        }
      },
      "OfferDraftSend": {
        "type": "object",
        "description": "Отправка подготовленного оффера кандидату.",
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Ревизия подготовленного оффера, которую видел вызывающий."
          },
          "bypassReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина отправки без согласования. Нужна, только если текущая версия не согласована; к согласованной не присылается."
          }
        }
      },
      "ApplicationHireRequest": {
        "type": "object",
        "required": [
          "hiredOn",
          "tz"
        ],
        "properties": {
          "hiredOn": {
            "type": "string",
            "format": "date",
            "description": "День выхода на работу, 2006-01-02. Не позже сегодняшнего дня в зоне tz; прошедший день законен."
          },
          "tz": {
            "type": "string",
            "description": "Зона вызывающего, IANA, например Europe/Moscow: в ней считается «сегодня». Пустая строка и Local — отказ поля."
          }
        }
      },
      "ApplicationHired": {
        "type": "object",
        "required": [
          "application",
          "vacancyFilled",
          "closeReason"
        ],
        "properties": {
          "application": {
            "$ref": "#/components/schemas/Application"
          },
          "vacancyFilled": {
            "type": "boolean",
            "description": "Выход закрыл последнюю единицу, и вакансию можно завершить: интерфейс предлагает завершить её, а не завершает молча."
          },
          "closeReason": {
            "type": "string",
            "description": "Причина «наняли» из заготовок сервера на базовом языке установки — для предложения завершить вакансию. Пустая, пока vacancyFilled false."
          }
        }
      },
      "ApplicationNoShow": {
        "type": "object",
        "required": [
          "application",
          "offer"
        ],
        "properties": {
          "application": {
            "$ref": "#/components/schemas/Application"
          },
          "offer": {
            "$ref": "#/components/schemas/ApplicationOffer"
          }
        }
      },
      "VacancyUnits": {
        "type": "object",
        "required": [
          "headcount",
          "hired",
          "offerAccepted",
          "offerSent",
          "free",
          "vacancyFilled",
          "closeReason"
        ],
        "properties": {
          "headcount": {
            "type": "integer",
            "minimum": 0,
            "description": "Единиц у вакансии."
          },
          "hired": {
            "type": "integer",
            "minimum": 0,
            "description": "Вышли на работу: отклики вакансии в hired. На старых данных бывает больше headcount."
          },
          "offerAccepted": {
            "type": "integer",
            "minimum": 0,
            "description": "Оформление: принятые офферы откликов на этапе offer."
          },
          "offerSent": {
            "type": "integer",
            "minimum": 0,
            "description": "Оффер отправлен: отправленные офферы с неистёкшим сроком у откликов на этапе offer."
          },
          "free": {
            "type": "integer",
            "minimum": 0,
            "description": "Свободны: headcount минус три тона выше, не меньше нуля."
          },
          "vacancyFilled": {
            "type": "boolean",
            "description": "Вакансия заполнена и её можно завершить — то же условие, что у ответа отметки выхода."
          },
          "closeReason": {
            "type": "string",
            "description": "Причина «наняли» на базовом языке установки. Пустая, пока vacancyFilled false."
          }
        }
      },
      "ReviewStatus": {
        "type": "string",
        "enum": [
          "new",
          "unreviewed",
          "fit",
          "unfit"
        ],
        "description": "Статус разбора пары «отклик + стадия»: new — стадия ждёт данных (решённого круга собеседования или ответа кандидата на текущий оффер), и руками отклик не раскладывается; unreviewed — данные есть или не нужны, решения нет; fit — подходит; unfit — не подходит."
      },
      "ReviewStageCounts": {
        "type": "object",
        "required": [
          "new",
          "unreviewed",
          "fit",
          "unfit"
        ],
        "description": "Сколько откликов стадии в каждом статусе. Сужается уровнем application · view.",
        "properties": {
          "new": {
            "type": "integer"
          },
          "unreviewed": {
            "type": "integer"
          },
          "fit": {
            "type": "integer"
          },
          "unfit": {
            "type": "integer"
          }
        }
      },
      "ReviewFixCounts": {
        "type": "object",
        "required": [
          "fit",
          "unfit"
        ],
        "description": "Сколько откликов в «Подходит» и «Не подходит».",
        "properties": {
          "fit": {
            "type": "integer",
            "minimum": 0
          },
          "unfit": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ReviewRun": {
        "type": "object",
        "required": [
          "state",
          "total",
          "processed",
          "failed",
          "reason",
          "finishedAt",
          "reasonCounts"
        ],
        "description": "Запуск ИИ-разбора стадии — по цели вакансии или по выбранным откликам (POST /api/v1/applications/review-runs). state и reason видны всем; числа запуска уровнем не сужаются — бот идёт по всей стадии, — поэтому приходят только при уровне «все» у application · edit, иначе null.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "idle",
              "running",
              "done",
              "failed"
            ],
            "description": "idle — запуска не было; running — в очереди или идёт; done — закончен; failed — отказ, причина в reason."
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько откликов возьмёт запуск. Только при уровне «все» у application · edit, иначе null."
          },
          "processed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько уже пройдено. Только при уровне «все» у application · edit, иначе null."
          },
          "failed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько шагов закончилось отказом. Только при уровне «все» у application · edit, иначе null."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "ai_not_connected",
                  "ai_key_dead",
                  "ai_scope_missing",
                  "ai_quota",
                  "ai_unavailable",
                  "timeout",
                  "internal",
                  "reply_invalid",
                  "portrait_changed",
                  "left_stage",
                  "doc_unreadable"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина отказа запуска; null — отказа нет. Неизвестный код показывается как есть. reply_invalid, portrait_changed, left_stage и doc_unreadable — причины прогона одного отклика, у запуска стадии их не бывает."
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда запуск закончился, UTC; null — не закончен."
          },
          "reasonCounts": {
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "enum": [
                    "ai_not_connected",
                    "ai_key_dead",
                    "ai_scope_missing",
                    "ai_quota",
                    "ai_unavailable",
                    "timeout",
                    "internal",
                    "reply_invalid",
                    "portrait_changed",
                    "left_stage",
                    "doc_unreadable",
                    "resume_url_rejected",
                    "resume_route_unsupported",
                    "resume_access_required",
                    "resume_access_denied",
                    "resume_unavailable",
                    "resume_format_unsupported",
                    "resume_unreadable",
                    "resume_resource_limit",
                    "resume_input_too_large",
                    "resume_unsafe_content",
                    "resume_source_changed"
                  ]
                },
                "maxProperties": 22,
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Persisted summary of this bulk run generation, updated atomically with item progress. Only full application edit sees it; all narrower views and unavailable legacy summaries return null. Keys are the closed item-code whitelist, values are integers >=0 and their sum is <= failed (enforced by the repository, not by JSON Schema alone). Never reconstructed from latest attempts; later single or bulk attempts cannot rewrite this generation summary."
          }
        }
      },
      "ReviewRunStatus": {
        "type": "object",
        "required": [
          "state",
          "vacancy",
          "total",
          "processed",
          "failed"
        ],
        "description": "Ход ИИ-разбора портала. Разбор на портале одновременно один; вакансию и ход ответ отдаёт по праву вызывающего.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "idle",
              "running"
            ],
            "description": "idle — разбор не идёт; running — в очереди или идёт."
          },
          "vacancy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReviewRunVacancy"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вакансия идущего разбора. null — разбор не идёт или идёт по вакансии, которой вызывающий не видит по праву vacancy · view («идёт другой разбор»): такую вакансию ответ не называет ни названием, ни id."
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько откликов возьмёт разбор названной вакансии. Только при уровне «все» у application · edit и только когда vacancy не null, иначе null."
          },
          "processed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько уже пройдено. Только при уровне «все» у application · edit и только когда vacancy не null, иначе null."
          },
          "failed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько шагов закончилось отказом. Только при уровне «все» у application · edit и только когда vacancy не null, иначе null."
          }
        }
      },
      "ReviewRunVacancy": {
        "type": "object",
        "required": [
          "id",
          "position"
        ],
        "description": "Вакансия ИИ-разбора ссылкой. Остальное о вакансии отдаёт GET /api/v1/vacancies/{id}.",
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id вакансии."
          },
          "position": {
            "type": "string",
            "description": "Название должности."
          }
        }
      },
      "ReviewStage": {
        "type": "object",
        "required": [
          "stage",
          "closed",
          "counts",
          "fixable",
          "botTargets",
          "run"
        ],
        "description": "Стадия ленты разбора.",
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "closed": {
            "type": "boolean",
            "description": "Разбор стадии закрыт: писать его нельзя (спека «Отклики — путь рекрутера» § 15.5). Числа колонок у закрытой стадии отдаются, botTargets — null."
          },
          "counts": {
            "$ref": "#/components/schemas/ReviewStageCounts"
          },
          "fixable": {
            "$ref": "#/components/schemas/ReviewFixCounts",
            "description": "Из «Подходит» и «Не подходит» — те, что возьмёт фиксация: под уровнями application · view и application · edit сразу. Их экран шлёт фиксации как expected. У закрытой стадии (closed = true) фиксация не проводится — POST /api/v1/applications/review-fix отвечает 409 review_stage_closed, а числа переходные: по прежнему статусу строк."
          },
          "botTargets": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько откликов возьмёт прогон вакансии: отклики «Разбора» — у вакансии сценария regular шага «Разбор», у mass её отклики на этапе new без живого приглашения (liveInvite), — без анализа и с устаревшим анализом, без ручной отметки «Подходит» или «Не подходит». Только при уровне «все» у application · edit, иначе null. У закрытой стадии (closed = true) — всегда null."
          },
          "run": {
            "$ref": "#/components/schemas/ReviewRun"
          }
        }
      },
      "ApplicationReviewStages": {
        "type": "object",
        "required": [
          "stages"
        ],
        "description": "Лента стадий разбора вакансии в порядке воронки.",
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewStage"
            }
          }
        }
      },
      "ApplicationReviewRequest": {
        "type": "object",
        "required": [
          "stage",
          "from",
          "to"
        ],
        "description": "Решение человека по стадии. stage и from — стадия и статус, которые вызывающий ВИДЕЛ: расходятся с настоящими — решения нет, ответ review_forbidden. В new не кладут. to = from — только с note или score: пишутся они, статус не меняется.",
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "from": {
            "$ref": "#/components/schemas/ReviewStatus"
          },
          "to": {
            "$ref": "#/components/schemas/ReviewStatus"
          },
          "note": {
            "type": "string",
            "description": "Обоснование: до 2000 символов Unicode после обрезки пробелов по краям, длиннее — invalid_value. Пустая строка стирает обоснование; поля нет — обоснование не трогается. Автор и момент пишутся при каждой записи."
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Ручная оценка 0–100: число пишет её, null стирает (действующей снова становится оценка бота), поля нет — оценка не трогается. Вне диапазона или не целое — invalid_value."
          },
          "portraitVersion": {
            "type": "string",
            "format": "uuid",
            "description": "Версия портрета, которую видел человек (mainVersionId портрета вакансии). Разошлась с основной — ничего не записано, ответ portrait_changed. Поля нет — версия не сверяется."
          }
        }
      },
      "ApplicationReviewScoreRequest": {
        "type": "object",
        "description": "Ручная оценка «Разбора» без ручной отметки. Нужно хотя бы одно из полей score и note.",
        "properties": {
          "note": {
            "type": "string",
            "description": "Обоснование: до 2000 символов Unicode после обрезки пробелов по краям, длиннее — invalid_value. Пустая строка стирает обоснование; поля нет — обоснование не трогается. Автор и момент пишутся при каждой записи."
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Ручная оценка 0–100: число пишет её, null стирает (действующей снова становится оценка бота), поля нет — оценка не трогается. Вне диапазона или не целое — invalid_value."
          },
          "portraitVersion": {
            "type": "string",
            "format": "uuid",
            "description": "Версия портрета, которую видел человек (mainVersionId портрета вакансии). Разошлась с основной — ничего не записано, ответ portrait_changed. Поля нет — версия не сверяется."
          }
        }
      },
      "ReviewFixRequest": {
        "type": "object",
        "required": [
          "vacancy",
          "stage",
          "expected"
        ],
        "description": "Фиксация стадии вакансии.",
        "properties": {
          "vacancy": {
            "type": "string",
            "description": "public_id вакансии."
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "expected": {
            "$ref": "#/components/schemas/ReviewFixCounts",
            "description": "Числа fixable, которые видел экран: разошлись с настоящими — фиксации нет, ответ review_changed."
          },
          "rejection": {
            "$ref": "#/components/schemas/RejectionDescriptor",
            "description": "Обязателен при unfit строках; без него 409 stage_requires_form до любых переходов. Fit-only совместим."
          }
        }
      },
      "ReviewFixResult": {
        "type": "object",
        "required": [
          "advanced",
          "rejected",
          "awaitingForm",
          "to"
        ],
        "description": "Итог фиксации стадии.",
        "properties": {
          "advanced": {
            "type": "integer",
            "description": "Сколько «Подходит» ушло на следующую стадию."
          },
          "rejected": {
            "type": "integer",
            "description": "Сколько «Не подходит» ушло в Отказ."
          },
          "awaitingForm": {
            "type": "integer",
            "description": "Всегда 0: фиксируется только «Новый», и «Подходит» уходят на Собеседование сменой этапа. Поле осталось от фиксации «Собеседования» и «Оффера», из которых в Оффер и Выход вела форма."
          },
          "to": {
            "$ref": "#/components/schemas/ApplicationStage",
            "description": "Стадия, на которую уходят «Подходит», — всегда interview: фиксируется только «Новый»."
          }
        }
      },
      "ReviewRunRequest": {
        "type": "object",
        "required": [
          "vacancy",
          "stage"
        ],
        "description": "Запуск ИИ-разбора стадии вакансии: по цели вакансии или, с applications, по выбранным откликам.",
        "properties": {
          "vacancy": {
            "type": "string",
            "description": "public_id вакансии."
          },
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "applications": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Прогон по выбранным: public_id откликов «Разбора» этой вакансии — у вакансии сценария regular тех же, что отдаёт список откликов с step=review, у mass — её откликов на этапе new без живого приглашения (liveInvite); не больше 200, повторы схлопываются. Разбираются ровно они — в том числе с анализом ИИ и с ручной отметкой, которых прогон вакансии не берёт. Нет поля — прогон по цели вакансии. Пустой список, больше 200 адресов или адрес не той формы — 400 invalid_value с details.field = applications. Неизвестный отклик, отклик другой вакансии или не из «Разбора» — тот же отказ, пока разбор этой вакансии не идёт: при идущем повтор отвечает 202 без сверки выбора. При отказе разбор не поставлен."
          }
        }
      },
      "StageReviewNote": {
        "type": "object",
        "required": [
          "text",
          "author"
        ],
        "description": "Обоснование прошлой стадии. Автор — тот, кто его написал, а не тот, кто увёл отклик со стадии (actor).",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 2000
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто написал обоснование; null — автор неизвестен."
          }
        }
      },
      "StageReview": {
        "type": "object",
        "required": [
          "stage",
          "status",
          "leftTo",
          "via",
          "score",
          "scoreSource",
          "byHuman",
          "note",
          "actor",
          "leftAt",
          "provenance"
        ],
        "description": "Разбор прошлой стадии отклика: строка истории, которую оставил уход со стадии.",
        "properties": {
          "stage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "status": {
            "$ref": "#/components/schemas/ReviewStatus",
            "description": "Статус стадии в момент ухода."
          },
          "leftTo": {
            "$ref": "#/components/schemas/ApplicationStage",
            "description": "Куда ушёл отклик; равен stage у нового круга оффера."
          },
          "via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Путь ухода; null — пункт меню этапа. Известные коды: review_fix — фиксация стадии, review_commit — пакетная фиксация решений, interview_booking — бронь собеседования, interview_invite — создание приглашения на собеседование, customer_decision — решение заказчика, offer_resend — новый круг оффера, hire — выход на работу, migration — оценка до данных стадии, перенесённая в историю при переходе на разбор по стадиям. Строка исторического ввода (historical_entry) в истории не показывается: это запись прошлого отказа, а не пройденная стадия. Прочие процессные коды приходят как есть, строкой."
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Действующая оценка стадии в момент ухода: ручная, если человек её поставил, иначе бота; null — оценки не было."
          },
          "scoreSource": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScoreSource"
              },
              {
                "type": "null"
              }
            ],
            "description": "Чья оценка в score: ai — бота, human — человека. null вместе со score."
          },
          "byHuman": {
            "type": "boolean",
            "description": "Статус поставил человек, а не бот. Системный maybe при возврате отклика на «Новый» даёт true так же: от решения человека его не отличить."
          },
          "note": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StageReviewNote"
              },
              {
                "type": "null"
              }
            ],
            "description": "Обоснование решения по стадии; null — его не было."
          },
          "actor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто увёл отклик со стадии; null — система."
          },
          "leftAt": {
            "type": "string",
            "format": "date-time"
          },
          "provenance": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScoreProvenance"
              },
              {
                "type": "null"
              }
            ],
            "description": "Происхождение действующей оценки стадии в момент ухода; stale — против текущего портрета вакансии. null — неизвестно или оценки не было."
          }
        }
      },
      "VacationCollectionDepartment": {
        "type": "object",
        "required": [
          "id",
          "name",
          "people"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "people": {
            "type": "integer"
          }
        }
      },
      "VacationCollectionOptions": {
        "type": "object",
        "required": [
          "departments",
          "savedScope",
          "unavailableScope",
          "previewScope",
          "allPeople",
          "scopePeople"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationCollectionDepartment"
            }
          },
          "savedScope": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "unavailableScope": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "previewScope": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "allPeople": {
            "type": "integer"
          },
          "scopePeople": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Число людей в выбранном охвате; null, если сохранённый охват нужно исправить."
          }
        }
      },
      "VacationCollectionPreview": {
        "type": "object",
        "required": [
          "previewScope",
          "scopePeople"
        ],
        "properties": {
          "previewScope": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "scopePeople": {
            "type": "integer"
          }
        }
      },
      "VacationSchedule": {
        "type": "object",
        "required": [
          "id",
          "year",
          "status",
          "collectUntil",
          "approvedAt",
          "approvedBy",
          "entries",
          "people",
          "approveBy",
          "viewerInEntity",
          "t7Number",
          "unionOpinionOn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id графика."
          },
          "year": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "collecting",
              "review",
              "approved"
            ],
            "description": "Черновик → сбор → согласование → утверждён. Вперёд и по одному; назад разрешён единственный возврат из согласования в сбор."
          },
          "collectUntil": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "До какого числа ждут даты, YYYY-MM-DD. Ничего не переключает: состояние двигает человек."
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Когда утверждён, RFC 3339."
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто утвердил. Документа за отметкой нет: приказ появится вместе с вертикалью приказов."
          },
          "entries": {
            "type": "integer",
            "description": "Сколько периодов внесено в документ целиком, а не в видимую часть."
          },
          "people": {
            "type": "integer",
            "description": "Сколько человек внесли даты."
          },
          "approveBy": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "До какого числа обязаны утвердить (ст. 123)."
          },
          "viewerInEntity": {
            "type": "boolean",
            "description": "Состоит ли смотрящий в юрлице графика. Нет — даты ему в этом графике не внесут (409 not_in_entity), и экран говорит это заранее. У графика до оси юрлиц всегда true."
          },
          "viewerExcluded": {
            "type": "boolean",
            "description": "У смотрящего в этом графике стоит отметка «Не планировать в этом году»: утверждённый график без его частей отличает отмеченного от человека, чьих дат в графике нет. Чужие отметки не видны. Отсутствует — false."
          },
          "t7Number": {
            "type": "string",
            "nullable": true,
            "maxLength": 32,
            "description": "«Номер документа» шапки Т-7 — номер самого графика; не задан — null. Пишется при утверждении и правится PATCH утверждённого графика."
          },
          "unionOpinionOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Дата учёта мнения выборного профсоюзного органа в шапке Т-7; не задана — null, и бланк печатает строку под заполнение от руки."
          }
        }
      },
      "VacationSchedulesResponse": {
        "type": "object",
        "required": [
          "schedules"
        ],
        "properties": {
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationSchedule"
            },
            "description": "Ближайший год сверху. Прошлые годы остаются: график отпусков — кадровый документ со сроком хранения."
          }
        }
      },
      "VacationScheduleCreateRequest": {
        "type": "object",
        "required": [
          "year"
        ],
        "properties": {
          "year": {
            "type": "integer",
            "description": "Календарный год. Второй график на тот же год завести нельзя."
          },
          "collectUntil": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacationSchedulePatchRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "status": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "draft",
                  "collecting",
                  "review",
                  "approved"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Целевое состояние. Утверждение требует производственного календаря и до него отвечает отказом."
          },
          "collectUntil": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок сбора. При входе в сбор обязателен вместе с approveBy; в черновике неполная пара допустима. Новый срок не раньше «сегодня» юрлица."
          },
          "approveBy": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Плановый срок утверждения. При входе в сбор обязателен вместе с collectUntil и не раньше него. Новый срок не раньше «сегодня» юрлица."
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Охват сбора: с каких подразделений собирают. Пустой список — «всё юрлицо», отсутствие поля — «охват не трогай»."
          },
          "t7Number": {
            "type": "string",
            "nullable": true,
            "maxLength": 32,
            "description": "«Номер документа» шапки Т-7 — номер самого графика, до 32 символов. Пустая строка стирает, отсутствие поля — не трогает."
          },
          "unionOpinionOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Дата учёта мнения выборного профсоюзного органа для шапки Т-7. Пустая строка стирает, отсутствие поля — не трогает."
          },
          "expectedRecipients": {
            "type": "integer",
            "minimum": 0,
            "description": "Число адресатов рассылки о сборе, подтверждённое по GET /api/v1/vacation-schedules/{id}/recipients. Только вместе со status: \"collecting\", иначе 422 invalid_value с details.field = expectedRecipients. Разошлось с пересчётом — 409 vacation_recipients_changed с details.recipients; без поля — без сверки."
          }
        }
      },
      "VacationEntry": {
        "type": "object",
        "required": [
          "id",
          "user",
          "userName",
          "author",
          "authorName",
          "startsOn",
          "endsOn",
          "days",
          "vacationDays",
          "status",
          "actualStartsOn",
          "actualEndsOn",
          "actualVacationDays",
          "movedBasis",
          "movedTo",
          "note",
          "department",
          "reviewReason",
          "reviewedByName",
          "reviewedAt",
          "mayReview"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id строки."
          },
          "user": {
            "type": "string",
            "description": "public_id человека, ЧЕЙ это отпуск."
          },
          "userName": {
            "type": "string",
            "description": "ФИО одной строкой, собранное сервером: сетка подписывает строки именами, а не адресами."
          },
          "author": {
            "type": "string",
            "description": "public_id того, кто внёс период первым. По нему видно, внёс человек даты сам или за него внёс руководитель. Правка дат другим человеком внёсшего не меняет; у периода, внесённого до записи происхождения, — автор последней замены набора."
          },
          "authorName": {
            "type": "string",
            "description": "Имя автора (author) одной строкой: раскрытая ячейка отвечает на «сам внёс или за него», а адресом на это не ответишь."
          },
          "startsOn": {
            "type": "string"
          },
          "endsOn": {
            "type": "string",
            "description": "Последний день отпуска включительно."
          },
          "days": {
            "type": "integer",
            "description": "ДЛИНА ПЕРИОДА в сутках."
          },
          "vacationDays": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сколько дней отпуска период списывает: длина минус нерабочие праздничные (ст. 120 ТК). После утверждения — замороженное число, до утверждения — то же число, посчитанное тем же календарём. Пусто, пока год производственного календаря не загружен: догадку вместо числа вертикаль не показывает."
          },
          "status": {
            "type": "string",
            "enum": [
              "planned",
              "agreed",
              "returned"
            ],
            "description": "Ждёт согласования, согласован или возвращён на правку."
          },
          "actualStartsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 7 формы Т-7: с какого числа человек ушёл НА САМОМ ДЕЛЕ. Пусто — ещё не уходил, и это не то же самое, что «совпало с планом»."
          },
          "actualEndsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 7: по какое число включительно."
          },
          "actualVacationDays": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Дни отпуска по ФАКТИЧЕСКОМУ отрезку (графа 7): длина минус нерабочие праздничные, тем же календарём, которым Т-6 печатает дни у фактических дат. Пусто — факт не отмечен или год календаря не загружен: догадку вместо числа вертикаль не показывает."
          },
          "daysFallback": {
            "type": "boolean",
            "description": "vacationDays до утверждения посчитаны по базовому календарю: у регионального календаря человека года нет, дни — без региональных праздников. Замороженных дней не касается. Отсутствует — false."
          },
          "actualDaysFallback": {
            "type": "boolean",
            "description": "То же для actualVacationDays. Отсутствует — false."
          },
          "agreedOnApproval": {
            "type": "boolean",
            "description": "Часть согласована утверждением графика, а не решением согласующего: при утверждении все ждущие и возвращённые части становятся согласованными, reviewedByName у такой строки — утвердивший график. Возврат графика в сбор возвращает части прежние статусы и причины, если решение по части с тех пор не менялось. Отсутствует — false."
          },
          "movedBasis": {
            "type": "string",
            "nullable": true,
            "description": "Графа 8: чем перенос оформлен. Свободный текст: виден своей строке и при просмотре или правке строк уровня all, иначе null — основание переноса по ст. 124 ТК чаще всего листок нетрудоспособности."
          },
          "movedTo": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 9: на когда перенесён отпуск."
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Графа 10: примечание. Свободный текст — то же правило, что у movedBasis."
          },
          "department": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PersonDepartment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Первый отдел человека — минимальный путь среди непропавших отделов снимка. null — человека нет в снимке оргструктуры или все его отделы пропали. От фильтра department не зависит."
          },
          "reviewReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина возврата. Видна владельцу, фактическому согласующему и при просмотре или правке всех строк; остальным null."
          },
          "reviewedByName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Имя принявшего решение или null."
          },
          "reviewedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Момент решения в UTC или null."
          },
          "mayReview": {
            "type": "boolean",
            "description": "Смотрящий вправе принимать решение по периоду как фактический согласующий или кадровик; себе — никогда."
          },
          "clashing": {
            "type": "boolean",
            "description": "Есть ли у строки видимая смотрящему пара пересечения — по всем парам, а не только по первым 5000 из conflicts. Только в странице строк (VacationEntriesPage.entries); в ответах PUT и PATCH нет. Ниже уровня «отдел» — false."
          }
        }
      },
      "VacationEntriesResponse": {
        "type": "object",
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationEntry"
            }
          }
        }
      },
      "PersonDepartment": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор подразделения в Битрикс24 — им сужается выдача (параметр department)."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DepartmentNode": {
        "type": "object",
        "required": [
          "id",
          "parent",
          "path",
          "name",
          "people"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор подразделения в Битрикс24."
          },
          "parent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ближайший предок по пути, сам входящий в дерево; null — корень видимого дерева."
          },
          "path": {
            "type": "string",
            "description": "Материализованный путь снимка оргструктуры вида /1/12/45/."
          },
          "name": {
            "type": "string"
          },
          "people": {
            "type": "integer",
            "description": "Людей области в поддереве узла; человек из двух отделов поддерева — один раз."
          }
        }
      },
      "VacationPersonMatch": {
        "type": "object",
        "required": [
          "user",
          "b24User",
          "name"
        ],
        "properties": {
          "user": {
            "type": "string",
            "nullable": true,
            "description": "public_id человека — значение параметра user ручки entries; null — участник сбора без дат, не входивший в сервис. Ломающее изменение (ADR-vacation-hr-cycle): раньше поле было строкой всегда."
          },
          "b24User": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Номер человека в Битрикс24; null — учётки Битрикс24 нет."
          },
          "name": {
            "type": "string",
            "description": "Фамилия и имя одной строкой."
          }
        }
      },
      "VacationPeopleResponse": {
        "type": "object",
        "required": [
          "people"
        ],
        "properties": {
          "people": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/VacationPersonMatch"
            },
            "description": "Не больше 20 человек, по фамилии, имени и адресу."
          }
        }
      },
      "DepartmentTree": {
        "type": "object",
        "required": [
          "departments",
          "noDepartment"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepartmentNode"
            },
            "description": "Отделы людей области в порядке пути."
          },
          "noDepartment": {
            "type": "integer",
            "description": "Людей области без единого непропавшего отдела — узел «Без подразделения», фильтр department=none."
          }
        }
      },
      "VacationEntriesPage": {
        "type": "object",
        "required": [
          "entries",
          "nextCursor",
          "people",
          "conflicts",
          "conflictsTotal",
          "conflictsTruncated",
          "longPart",
          "shortParts",
          "awaitingEntries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationEntry"
            },
            "description": "Все строки людей страницы: люди в порядке первого отдела, фамилии и имени, внутри человека — по началу."
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы людей; null — страница последняя."
          },
          "people": {
            "type": "integer",
            "description": "Людей в области запроса (с фильтрами department и user)."
          },
          "norms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationNorm"
            },
            "description": "Нормы людей страницы, видимые смотрящему; кому норму не ставили — строки нет. Поля нет без права просмотра норм."
          },
          "normDefault": {
            "type": "integer",
            "description": "Норма по умолчанию — у кого строки нормы нет. Поля нет без права просмотра норм."
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationConflict"
            },
            "description": "Пары пересечений, где хотя бы один человек этой страницы, — первые 5000 по дате начала общих дней. Пара людей двух загруженных страниц приходит в ответе обеих. Пусто ниже уровня «отдел»."
          },
          "conflictsTotal": {
            "type": "integer",
            "description": "Пар всего у людей этой страницы. Суммы разных страниц не складываются: пары между страницами посчитаны в обеих."
          },
          "conflictsTruncated": {
            "type": "boolean",
            "description": "Пар больше 5000 — в conflicts первые."
          },
          "longPart": {
            "type": "integer"
          },
          "shortParts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "awaitingEntries": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "person": {
            "$ref": "#/components/schemas/VacationPersonCard",
            "description": "Человек фильтра user — только при этом фильтре и только если человек в области просмотра строк смотрящего (all — любой участник графика, dept — отдел снимка в поддереве, own — только сам смотрящий); есть и без строк графика. Человек вне области по public_id — поля нет, ответ тот же, что без него."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationChangeMark"
            },
            "description": "Отметки чужих правок своих периодов — только когда фильтр user — сам смотрящий, и только сессии кабинета; ключу API и в остальных случаях поля нет. Строки и отметки — из одного снимка. Убранный период отметку несёт, а строки у него нет."
          }
        }
      },
      "VacationPersonCard": {
        "type": "object",
        "description": "Человек фильтра user страницы строк: шапка шторки называет его и отдел и без строк графика.",
        "required": [
          "user",
          "b24User",
          "userName",
          "department"
        ],
        "properties": {
          "user": {
            "type": "string",
            "nullable": true,
            "description": "public_id человека; null — не входил в сервис (фильтр по ссылке b24-)."
          },
          "b24User": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Номер человека в Битрикс24; null — учётки Битрикс24 нет."
          },
          "userName": {
            "type": "string",
            "description": "Фамилия и имя одной строкой."
          },
          "department": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PersonDepartment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Первый непропавший отдел снимка оргструктуры (минимальный путь — то же правило, что у отдела строки); null — отделов в снимке нет."
          }
        }
      },
      "VacationPeriod": {
        "type": "object",
        "required": [
          "startsOn",
          "endsOn"
        ],
        "properties": {
          "startsOn": {
            "type": "string"
          },
          "endsOn": {
            "type": "string"
          },
          "agree": {
            "type": "boolean",
            "description": "Согласовать этот период в той же транзакции. Требует права фактического согласующего; себе нельзя."
          }
        }
      },
      "VacationEntriesReplaceRequest": {
        "type": "object",
        "required": [
          "periods"
        ],
        "properties": {
          "periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationPeriod"
            },
            "description": "Весь набор периодов ОДНОГО человека целиком: что осталось — остаётся, что ушло — удаляется. Пустой список убирает все его периоды."
          },
          "confirmUnagree": {
            "type": "boolean",
            "description": "Подтверждение снятия согласования при изменении или удалении владельцем согласованного периода."
          }
        }
      },
      "VacationEntryPatchRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "planned",
              "agreed",
              "returned"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "description": "Причина возврата; обязательна при status=returned, от 1 до 500 символов после обрезки пробелов."
          }
        }
      },
      "VacationNorm": {
        "type": "object",
        "required": [
          "user",
          "days",
          "note"
        ],
        "properties": {
          "user": {
            "type": "string",
            "description": "public_id человека."
          },
          "days": {
            "type": "integer"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему норма не обычная: вредность, ненормированный день, донорские дни, приём в середине года. Свободный текст: виден своей норме и при просмотре или правке норм уровня all, иначе null."
          }
        }
      },
      "VacationNormsResponse": {
        "type": "object",
        "required": [
          "norms",
          "default"
        ],
        "properties": {
          "norms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationNorm"
            },
            "description": "Только ЗАДАННЫЕ нормы: кому норму не ставили, у того строки нет."
          },
          "default": {
            "type": "integer",
            "description": "Умолчание портала, которое действует у всех остальных."
          }
        }
      },
      "VacationNormPutRequest": {
        "type": "object",
        "required": [
          "days"
        ],
        "properties": {
          "days": {
            "type": "integer",
            "description": "Сколько дней отпуска положено человеку за год."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VacationConflictSide": {
        "type": "object",
        "required": [
          "entry",
          "user",
          "userName",
          "startsOn",
          "endsOn"
        ],
        "properties": {
          "entry": {
            "type": "string",
            "description": "public_id строки графика."
          },
          "user": {
            "type": "string",
            "description": "public_id человека."
          },
          "userName": {
            "type": "string",
            "description": "ФИО одной строкой: пересечение читает руководитель, и «кто с кем» по двум адресам он не прочитает."
          },
          "startsOn": {
            "type": "string",
            "format": "date",
            "description": "Плановое начало строки этой стороны — её даты целиком, а не общие дни: шторка показывает отпуск коллеги, которого нет на загруженных страницах."
          },
          "endsOn": {
            "type": "string",
            "format": "date",
            "description": "Плановое окончание строки этой стороны."
          }
        }
      },
      "VacationConflict": {
        "type": "object",
        "required": [
          "department",
          "first",
          "second",
          "from",
          "to",
          "days"
        ],
        "properties": {
          "department": {
            "type": "integer",
            "description": "Подразделение Битрикс24, в котором люди совпали. Первый общий непропавший отдел двух людей (минимальный путь)."
          },
          "first": {
            "$ref": "#/components/schemas/VacationConflictSide"
          },
          "second": {
            "$ref": "#/components/schemas/VacationConflictSide"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "days": {
            "type": "integer",
            "description": "Сколько дней у них общие."
          }
        }
      },
      "WorkCalendar": {
        "type": "object",
        "required": [
          "id",
          "name",
          "isDefault",
          "years",
          "departmentCount",
          "driftYears",
          "proposalYears"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id календаря."
          },
          "name": {
            "type": "string",
            "description": "Название региона: «Российская Федерация», «Республика Татарстан»."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Базовый календарь портала. Его наследуют подразделения без своей привязки."
          },
          "years": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Загруженные годы, свежие сверху. Года нет в списке — планировать на него нельзя."
          },
          "departmentCount": {
            "type": "integer",
            "description": "Сколько подразделений привязано к календарю напрямую, включая подразделения, пропавшие из Битрикс24. Дочерние подразделения, получающие календарь от привязанного предка, сюда не входят."
          },
          "driftYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы с расхождением справочника, ждущим решения, по возрастанию."
          },
          "proposalYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы с предложением применить изменение базового, ждущим решения, по возрастанию."
          }
        }
      },
      "WorkCalendarsResponse": {
        "type": "object",
        "required": [
          "calendars",
          "referenceYears"
        ],
        "properties": {
          "calendars": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendar"
            }
          },
          "referenceYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы справочника HR AI текущего релиза по возрастанию, у всех порталов одни. Справочник меняется только с релизом сервиса. Для других лет `refresh` отвечает 422 `source_unreadable` — такой год загружают файлом. К региональному календарю поле не относится: обходом сервис берёт из справочника только базовый, а регион живёт своими годами."
          }
        }
      },
      "WorkCalendarCreateRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "description": "Название. Пустое, с пробелом по краю или двойным внутри не принимается."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Сделать базовым. Прежний базовый перестаёт им быть в той же транзакции."
          },
          "copyFrom": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "public_id календаря-образца: региональный заводится копией федерального. Копируются годы и дни, привязки подразделений — нет."
          }
        }
      },
      "WorkCalendarUpdateRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "isDefault": {
            "type": "boolean",
            "description": "Сделать базовым. Снять пометку, не назначив другой календарь, нельзя."
          }
        }
      },
      "WorkCalendarDay": {
        "type": "object",
        "required": [
          "date",
          "kind",
          "title"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "Календарный день, YYYY-MM-DD."
          },
          "kind": {
            "type": "string",
            "enum": [
              "holiday",
              "rest",
              "work",
              "short"
            ],
            "description": "holiday — нерабочий праздничный, rest — перенесённый выходной, work — рабочий день на выходном, short — сокращённый предпраздничный."
          },
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Название дня, если оно есть: «День России». У перенесённого выходного имени нет."
          }
        }
      },
      "WorkCalendarDepartmentsResponse": {
        "type": "object",
        "required": [
          "departments"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "WorkCalendarYearRequest": {
        "type": "object",
        "required": [
          "source",
          "days"
        ],
        "properties": {
          "source": {
            "type": "string",
            "maxLength": 255,
            "description": "Откуда приехали дни. Через год это единственный способ отличить загруженный справочник от ручной правки. Имя справочника reference и прежние служебные метки заняты сервисом (код reserved_source)."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия справочника у источника. У ручной загрузки её нет."
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarDay"
            },
            "description": "Дни-исключения года ЦЕЛИКОМ: прежние заменяются, а не дополняются."
          },
          "expect": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сверка редакции года: version из ответа года, который клиент показывал, или null — «года не было». Есть поле — запись идёт, только если год с тех пор не записывали (иначе 409 year_changed) и у года не ждёт решения расхождение справочника (иначе 409 drift_pending); в обоих случаях ничего не пишется. Нет поля — запись безусловная, ждущее расхождение отклоняется именем автора. Значение, которое не разбирается как version, — 422 bad_expect."
          }
        }
      },
      "WorkCalendarMonth": {
        "type": "object",
        "required": [
          "month",
          "workingDays",
          "hours"
        ],
        "properties": {
          "month": {
            "type": "integer",
            "description": "Номер месяца, 1—12."
          },
          "workingDays": {
            "type": "integer"
          },
          "hours": {
            "type": "integer",
            "description": "Норма рабочего времени месяца при сорокачасовой неделе."
          }
        }
      },
      "WorkCalendarYearResponse": {
        "type": "object",
        "required": [
          "year",
          "source",
          "sourceVersion",
          "loadedAt",
          "version",
          "days",
          "months",
          "drift",
          "proposal"
        ],
        "properties": {
          "year": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "description": "Откуда приехали дни. У года из справочника HR AI здесь reference; у года, загруженного файлом, — пометка из файла."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "loadedAt": {
            "type": "string",
            "description": "Когда год загружали, RFC 3339."
          },
          "version": {
            "type": "string",
            "description": "Токен редакции года: новый на каждой записи, в том числе в одну секунду. Его клиент отдаёт в expect при записи года, чтобы не затереть чужую запись."
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarDay"
            }
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarMonth"
            },
            "description": "Норма по месяцам. Считается из тех же дней, а не хранится рядом с ними."
          },
          "drift": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarDrift"
              },
              {
                "type": "null"
              }
            ],
            "description": "Расхождение, ждущее решения, или null. Едет вместе с годом, а не отдельной ручкой: расхождение — свойство года, и спрашивать о нём вторым запросом значит позволить экрану показать год без него."
          },
          "proposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarProposal"
              },
              {
                "type": "null"
              }
            ],
            "description": "Предложение региону применить изменение базового или null. У базового календаря всегда null."
          }
        }
      },
      "WorkCalendarDepartmentsRequest": {
        "type": "object",
        "required": [
          "departments"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "maxItems": 1000,
            "description": "Подразделения Битрикс24 ЦЕЛИКОМ: прежний список заменяется. Не больше 1000 (workcalendar.MaxCalendarDepartments); каждое обязано быть в оргструктуре портала."
          }
        }
      },
      "WorkCalendarDayState": {
        "type": "object",
        "required": [
          "date",
          "working",
          "short",
          "kind",
          "title"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "working": {
            "type": "boolean",
            "description": "Рабочий ли день: понедельник—пятница без праздника и переноса, либо любой день с исключением work."
          },
          "short": {
            "type": "boolean",
            "description": "Сокращённый предпраздничный: рабочий день на час короче."
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид исключения или null, если день ведёт себя по правилу недели."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "WorkCalendarResolveResponse": {
        "type": "object",
        "required": [
          "calendar",
          "from",
          "to",
          "calendarDays",
          "workingDays",
          "holidayDays",
          "shortDays",
          "hours",
          "nonWorking",
          "day",
          "fallbackYears",
          "fallbackCalendar"
        ],
        "properties": {
          "calendar": {
            "$ref": "#/components/schemas/WorkCalendar"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "calendarDays": {
            "type": "integer",
            "description": "Длина периода в сутках."
          },
          "workingDays": {
            "type": "integer"
          },
          "holidayDays": {
            "type": "integer",
            "description": "Нерабочие праздничные ОТДЕЛЬНО от выходных: отпуск вычитает их и не вычитает выходные (ст. 120 ТК). Период с 1 по 14 января — четырнадцать календарных дней и восемь праздничных, то есть шесть дней отпуска."
          },
          "shortDays": {
            "type": "integer"
          },
          "hours": {
            "type": "integer"
          },
          "nonWorking": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarDayState"
            }
          },
          "day": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarDayState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заполнен, только если спрашивали про один день: у периода свойства «рабочий ли» нет."
          },
          "fallbackYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы периода, посчитанные по базовому календарю: у календаря (регионального) их нет, а в базовом есть. По возрастанию; пусто — подмены не было."
          },
          "fallbackCalendar": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarRef"
              },
              {
                "type": "null"
              }
            ],
            "description": "Базовый календарь, по которому посчитаны fallbackYears; null — подмены не было."
          }
        }
      },
      "WorkCalendarRef": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "description": "Календарь адресом и названием."
      },
      "VacationShortPart": {
        "type": "object",
        "required": [
          "user",
          "userName",
          "longest"
        ],
        "properties": {
          "user": {
            "type": "string"
          },
          "userName": {
            "type": "string",
            "description": "ФИО одной строкой: кадровику нужно знать, к кому идти, а список адресов на этот вопрос не отвечает."
          },
          "longest": {
            "type": "integer",
            "description": "Самая длинная его часть В ДНЯХ ОТПУСКА, а не в длине периода."
          }
        }
      },
      "VacationNormDeviation": {
        "type": "object",
        "required": [
          "user",
          "userName",
          "norm",
          "planned"
        ],
        "properties": {
          "user": {
            "type": "string"
          },
          "userName": {
            "type": "string",
            "description": "ФИО одной строкой."
          },
          "norm": {
            "type": "integer"
          },
          "planned": {
            "type": "integer"
          }
        }
      },
      "VacationReadiness": {
        "type": "object",
        "required": [
          "entries",
          "people",
          "withoutDates",
          "conflicts",
          "threshold",
          "shortPartsCount",
          "normDeviationsCount",
          "shortParts",
          "normDeviations",
          "nobody",
          "participants",
          "excluded",
          "pendingParts",
          "pendingPeople",
          "entered",
          "partial",
          "waitingParts",
          "waitingPeople",
          "returnedParts",
          "returnedPeople"
        ],
        "properties": {
          "entries": {
            "type": "integer"
          },
          "threshold": {
            "type": "integer",
            "description": "Порог статьи 125 в днях отпуска, по которому посчитан ЭТОТ отчёт. Уезжает наружу затем, чтобы экран не держал у себя второй экземпляр правила: своё число разошлось бы с серверным в день, когда порог станет настройкой портала."
          },
          "people": {
            "type": "integer",
            "description": "Сколько участников из participants внесли даты."
          },
          "entered": {
            "type": "integer",
            "description": "Сколько из participants внесли по норме — тем же правилом, что ход сбора."
          },
          "partial": {
            "type": "integer",
            "description": "Сколько из participants внесли не всё: дней отпуска меньше нормы."
          },
          "participants": {
            "type": "integer",
            "description": "N — участники сбора без отмеченных «Не планировать в этом году»: тот же состав, что у хода сбора и поимённого списка participants."
          },
          "excluded": {
            "type": "integer",
            "description": "Отмеченные «Не планировать в этом году»: в составе, но вне N, вне people и вне withoutDates."
          },
          "pendingParts": {
            "type": "integer",
            "description": "Несогласованные части участников: сумма ждущих (waitingParts) и возвращённых (returnedParts) частей."
          },
          "pendingPeople": {
            "type": "integer",
            "description": "Люди хотя бы с одной несогласованной частью, каждый один раз: человек с ждущей и возвращённой частью есть и в waitingPeople, и в returnedPeople, а здесь считается однажды."
          },
          "waitingParts": {
            "type": "integer",
            "description": "Части участников, которые ждут согласования (status planned)."
          },
          "waitingPeople": {
            "type": "integer",
            "description": "У скольких участников есть хотя бы одна часть, ждущая согласования."
          },
          "returnedParts": {
            "type": "integer",
            "description": "Части участников, возвращённые на правку (status returned)."
          },
          "returnedPeople": {
            "type": "integer",
            "description": "У скольких участников есть хотя бы одна возвращённая часть."
          },
          "withoutDates": {
            "type": "integer",
            "description": "Сколько участников N не внесли ни одной даты и не отмечены «Не планировать». Больше нуля — утверждение заперто (422 without_dates); закрытию сбора не мешает. Полное число: список nobody — первые 100 (второй год подряд — первыми)."
          },
          "conflicts": {
            "type": "integer",
            "description": "Сколько пересечений внутри подразделений. Сигнал, а не запрет."
          },
          "calendarFallback": {
            "type": "boolean",
            "description": "Дни хоть одной строки посчитаны по базовому календарю: у регионального календаря человека года нет. Отсутствует — false."
          },
          "shortPartsCount": {
            "type": "integer",
            "description": "У скольких людей нет ни одной части не меньше порога. Больше нуля — утверждение заперто. Приходит всем, кому открыт график, даже когда список shortParts пуст из-за прав: «мешает» обязан видеть каждый, имена — только уровень «весь портал»."
          },
          "shortParts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationShortPart"
            },
            "description": "ЕДИНСТВЕННОЕ, что мешает утвердить график: статья 125 требует хотя бы одну часть не меньше порога. Поимённо — только уровню «весь портал»; число для всех — shortPartsCount. Первые 100: самая короткая длинная часть — первой."
          },
          "normDeviations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationNormDeviation"
            },
            "description": "У кого распланировано не столько, сколько положено. Сведение, а не запрет. Поимённо — только уровню «весь портал»; число для всех — normDeviationsCount. Первые 100: самое большое расхождение — первым."
          },
          "normDeviationsCount": {
            "type": "integer",
            "description": "Сколько расхождений с нормой всего. normDeviations — первые 100 по величине расхождения; число приходит каждому, имена — только уровню «весь портал»."
          },
          "nobody": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationPerson"
            },
            "description": "Кто не внёс ни одного дня. Статья 124 запрещает не давать отпуск два года подряд, и разговор об этом начинается с имени, а не с числа. Поимённо — только уровню «весь портал»; число для всех — withoutDates. Первые 100: второй год подряд — первыми."
          }
        }
      },
      "WorkCalendarPortalDepartment": {
        "type": "object",
        "required": [
          "id",
          "name",
          "path",
          "calendar",
          "calendarName"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string",
            "description": "Материализованный путь из снимка Б24: экран показывает дерево в том же порядке, в каком его видит портал."
          },
          "calendar": {
            "type": "string",
            "description": "public_id календаря, к которому подразделение уже привязано. Пусто — не привязано никуда."
          },
          "calendarName": {
            "type": "string",
            "description": "Название того календаря, чтобы занятость читалась словами, а не адресом."
          }
        }
      },
      "WorkCalendarPortalDepartmentsResponse": {
        "type": "object",
        "required": [
          "departments"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarPortalDepartment"
            },
            "description": "Подразделения портала в порядке пути, то есть уже деревом."
          }
        }
      },
      "WorkCalendarDayChange": {
        "type": "object",
        "required": [
          "date",
          "was",
          "becomes"
        ],
        "description": "Одна дата, на которой пришедший год и загруженный говорят разное.",
        "properties": {
          "date": {
            "type": "string",
            "description": "Дата, YYYY-MM-DD."
          },
          "was": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в загруженном году: holiday, rest, work или short. null — исключения на эту дату не было, день шёл по правилу недели."
          },
          "becomes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в пришедшем году. null — исключение исчезает."
          }
        }
      },
      "WorkCalendarDrift": {
        "type": "object",
        "required": [
          "driftDays",
          "source",
          "sourceVersion",
          "detectedAt",
          "changes"
        ],
        "description": "Год, который справочник принёс, а проверка приёма не пропустила: расходится с загруженным больше допустимого. Ждёт решения человека и сам не применяется.",
        "properties": {
          "driftDays": {
            "type": "integer",
            "description": "На скольких датах год разошёлся с загруженным в момент отказа."
          },
          "source": {
            "type": "string",
            "description": "Откуда приехал не принятый год."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия справочника у пришедшего года: отпечаток состава дней. Та же версия или те же дни, что у отклонённого выпуска, — вопрос заново не задаётся."
          },
          "detectedAt": {
            "type": "string",
            "description": "Когда расхождение обнаружено, RFC 3339."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarDayChange"
            },
            "description": "Что именно разошлось, по датам. Решение принимается по составу дней, а не по их числу."
          }
        }
      },
      "WorkCalendarDriftDecisionRequest": {
        "type": "object",
        "required": [
          "decision"
        ],
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "accept",
              "reject"
            ],
            "description": "accept — принять пришедший год, reject — оставить свой."
          }
        }
      },
      "WorkCalendarProposal": {
        "type": "object",
        "required": [
          "revision",
          "source",
          "sourceVersion",
          "createdAt",
          "changes",
          "kept"
        ],
        "description": "Предложение региону применить изменение базового календаря. Появляется, когда год базового записали с другим видом хотя бы одной даты, а регион на этой дате совпадал с базовым. Повторное изменение того же года сливается с ждущим предложением.",
        "properties": {
          "revision": {
            "type": "string",
            "description": "Редакция предложения: новая на создании и каждом слиянии. Решение отдаёт её обратно, чтобы не применить непоказанные даты."
          },
          "source": {
            "type": "string",
            "description": "Источник года базового после последнего изменения."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия справочника у года базового или null."
          },
          "createdAt": {
            "type": "string",
            "description": "Когда предложение появилось, RFC 3339."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarProposalChange"
            },
            "description": "Что применится, по датам."
          },
          "kept": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarProposalKept"
            },
            "description": "Свои даты региона, которые изменение не трогает."
          }
        }
      },
      "WorkCalendarProposalChange": {
        "type": "object",
        "required": [
          "date",
          "was",
          "becomes",
          "title"
        ],
        "description": "Дата, которая применится в регионе: в регионе сейчас was, станет becomes.",
        "properties": {
          "date": {
            "type": "string",
            "description": "Дата, YYYY-MM-DD."
          },
          "was": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в регионе: holiday, rest, work или short. null — исключения на эту дату нет."
          },
          "becomes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня после применения — как в базовом. null — исключение снимается."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название дня в базовом после изменения или null."
          }
        }
      },
      "WorkCalendarProposalKept": {
        "type": "object",
        "required": [
          "date",
          "region",
          "base"
        ],
        "description": "Своя дата региона: регион отличался от базового и до изменения, и изменение её не трогает.",
        "properties": {
          "date": {
            "type": "string",
            "description": "Дата, YYYY-MM-DD."
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в регионе или null — исключения нет."
          },
          "base": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в базовом после изменения или null."
          }
        }
      },
      "WorkCalendarProposalDecisionRequest": {
        "type": "object",
        "required": [
          "decision",
          "revision"
        ],
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "apply",
              "reject"
            ],
            "description": "apply — применить даты предложения, reject — оставить свои."
          },
          "revision": {
            "type": "string",
            "description": "revision показанного предложения."
          }
        }
      },
      "WorkCalendarProposalDecisionResponse": {
        "type": "object",
        "required": [
          "year",
          "source",
          "sourceVersion",
          "loadedAt",
          "version",
          "days",
          "months",
          "drift",
          "proposal",
          "skipped"
        ],
        "properties": {
          "year": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "description": "Откуда приехали дни. У года из справочника HR AI здесь reference; у года, загруженного файлом, — пометка из файла."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "loadedAt": {
            "type": "string",
            "description": "Когда год загружали, RFC 3339."
          },
          "version": {
            "type": "string",
            "description": "Токен редакции года: новый на каждой записи, в том числе в одну секунду. Его клиент отдаёт в expect при записи года, чтобы не затереть чужую запись."
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarDay"
            }
          },
          "months": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarMonth"
            },
            "description": "Норма по месяцам. Считается из тех же дней, а не хранится рядом с ними."
          },
          "drift": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarDrift"
              },
              {
                "type": "null"
              }
            ],
            "description": "Расхождение, ждущее решения, или null. Едет вместе с годом, а не отдельной ручкой: расхождение — свойство года, и спрашивать о нём вторым запросом значит позволить экрану показать год без него."
          },
          "proposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkCalendarProposal"
              },
              {
                "type": "null"
              }
            ],
            "description": "Предложение региону применить изменение базового или null. У базового календаря всегда null."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Даты, которые регион правил после предложения: они не тронуты, YYYY-MM-DD."
          }
        },
        "description": "Год региона после решения по предложению — как у GET года — и даты, которые не тронуты."
      },
      "WorkCalendarPreparation": {
        "type": "object",
        "required": [
          "base",
          "carry",
          "compare"
        ],
        "description": "Что предложит «Подготовить» год региона: копия года базового и кандидаты переноса своих дней прошлого года.",
        "properties": {
          "base": {
            "$ref": "#/components/schemas/WorkCalendarPreparationBase"
          },
          "carry": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarCarryCandidate"
            },
            "description": "Кандидаты переноса. Признака «постоянная или плавающая дата» в данных нет — делит человек; по умолчанию не переносится ничего."
          },
          "compare": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "no_previous",
                  "no_base_previous"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему кандидатов нет: no_previous — прошлого года нет в регионе, no_base_previous — в базовом; null — сравнили."
          }
        }
      },
      "WorkCalendarPreparationBase": {
        "type": "object",
        "required": [
          "id",
          "name",
          "source",
          "sourceVersion"
        ],
        "description": "Базовый календарь, чей год копируется, и источник этого года.",
        "properties": {
          "id": {
            "type": "string",
            "description": "public_id базового календаря."
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "Источник года базового."
          },
          "sourceVersion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия справочника у года базового или null."
          }
        }
      },
      "WorkCalendarCarryCandidate": {
        "type": "object",
        "required": [
          "date",
          "from",
          "kind",
          "title"
        ],
        "description": "День прошлого года региона, который можно перенести в новый год: у базового того же года на эту дату исключения нет или вид другой.",
        "properties": {
          "date": {
            "type": "string",
            "description": "Дата в новом году — тот же день и месяц, YYYY-MM-DD."
          },
          "from": {
            "type": "string",
            "description": "Дата в прошлом году, откуда перенос, YYYY-MM-DD."
          },
          "kind": {
            "type": "string",
            "enum": [
              "holiday",
              "rest",
              "work",
              "short"
            ],
            "description": "Вид дня в регионе."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название дня в регионе или null."
          }
        }
      },
      "WorkCalendarPrepareRequest": {
        "type": "object",
        "required": [
          "carry"
        ],
        "properties": {
          "carry": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 366,
            "description": "Даты нового года из кандидатов (YYYY-MM-DD), которые перенести. Пусто — копия базового без переноса."
          }
        }
      },
      "WorkCalendarImportPreviewForm": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Файл: xlsx или CSV по шаблону или JSON {source, days}. Не больше 1 МиБ."
          }
        }
      },
      "WorkCalendarImportPreview": {
        "type": "object",
        "required": [
          "format",
          "rowProblems",
          "years"
        ],
        "description": "Что сделает загрузка файла.",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "xlsx",
              "csv",
              "json"
            ],
            "description": "Формат, узнанный по содержимому."
          },
          "rowProblems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarRowProblem"
            }
          },
          "years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarImportYear"
            },
            "description": "Годы файла по возрастанию."
          }
        }
      },
      "WorkCalendarImportYear": {
        "type": "object",
        "required": [
          "year",
          "status",
          "version",
          "days",
          "changes",
          "problems",
          "blocked"
        ],
        "description": "Год файла против загруженного. Выбрать к загрузке можно, если rowProblems файла пуст, problems года пуст, blocked — null и status не same.",
        "properties": {
          "year": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "replace",
              "same"
            ],
            "description": "new — года нет; replace — заменит загруженный; same — совпадают и виды, и названия дней."
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "version загруженного года для expect при загрузке или null — года нет."
          },
          "days": {
            "type": "integer",
            "description": "Сколько дней-исключений года в файле."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarImportChange"
            }
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarYearProblem"
            }
          },
          "blocked": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "drift_pending"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "drift_pending — у года ждёт решения расхождение справочника: загрузка молча ответила бы на него."
          }
        }
      },
      "WorkCalendarImportChange": {
        "type": "object",
        "required": [
          "date",
          "was",
          "becomes",
          "titleWas",
          "titleBecomes"
        ],
        "description": "Дата, где вид или название дня в файле расходятся с загруженным годом.",
        "properties": {
          "date": {
            "type": "string",
            "description": "YYYY-MM-DD."
          },
          "was": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в загруженном году или null — исключения нет."
          },
          "becomes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня в файле или null."
          },
          "titleWas": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название в загруженном году или null."
          },
          "titleBecomes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название в файле или null."
          }
        }
      },
      "WorkCalendarYearProblem": {
        "type": "object",
        "required": [
          "row",
          "code",
          "date"
        ],
        "description": "Проблема года файла: у строки или у года целиком.",
        "properties": {
          "row": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер строки файла; null — проблема года целиком."
          },
          "code": {
            "type": "string",
            "enum": [
              "bad_date",
              "bad_kind",
              "duplicate_date",
              "too_long",
              "bad_year",
              "year_degenerate"
            ]
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Дата строки, YYYY-MM-DD, или null."
          }
        }
      },
      "WorkCalendarRowProblem": {
        "type": "object",
        "required": [
          "row",
          "code"
        ],
        "description": "Строка файла, которую нельзя отнести к году: дата пуста или не разбирается. Такая строка блокирует весь файл.",
        "properties": {
          "row": {
            "type": "integer",
            "description": "Номер строки файла."
          },
          "code": {
            "type": "string",
            "enum": [
              "bad_date"
            ]
          }
        }
      },
      "WorkCalendarImportForm": {
        "type": "object",
        "required": [
          "file",
          "years",
          "expect"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Тот же файл, что в предпросмотре: сервер загрузку между запросами не хранит."
          },
          "years": {
            "type": "string",
            "description": "Выбранные годы JSON-массивом, например [2026,2027]."
          },
          "expect": {
            "type": "string",
            "description": "JSON {год: version | null} на каждый выбранный год: version из предпросмотра, null — года не было."
          }
        }
      },
      "WorkCalendarImportResult": {
        "type": "object",
        "required": [
          "years"
        ],
        "properties": {
          "years": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkCalendarImportedYear"
            }
          }
        }
      },
      "WorkCalendarImportedYear": {
        "type": "object",
        "required": [
          "year",
          "version"
        ],
        "properties": {
          "year": {
            "type": "integer"
          },
          "version": {
            "type": "string",
            "description": "Новый version записанного года."
          }
        }
      },
      "LegalEntity": {
        "type": "object",
        "required": [
          "id",
          "name",
          "inn",
          "kpp",
          "isDefault",
          "active",
          "linked",
          "timezone",
          "mine"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес юрлица наружу."
          },
          "name": {
            "type": "string",
            "description": "Название как в источнике. У нас не правится: справочник — зеркало 1С и «моих компаний» Б24."
          },
          "inn": {
            "type": "string",
            "nullable": true,
            "description": "ИНН. Стоит рядом с названием затем, что у группы компаний названия различаются одним словом."
          },
          "kpp": {
            "type": "string",
            "nullable": true,
            "description": "КПП. Деталка юрлица читает его из списка и правит PATCH-ем; нет КПП — null."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Юрлицо по умолчанию: в нём лежит всё, собранное до подключения источников."
          },
          "active": {
            "type": "boolean",
            "description": "Действующее ли. Ликвидированное не удаляется: в нём остались графики прошлых лет."
          },
          "linked": {
            "type": "boolean",
            "description": "Связана ли пара «организация 1С ↔ моя компания Б24». Несвязанное юрлицо работает наполовину: либо печатать приказ не из чего, либо подписывать нечем."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "example": "Asia/Kamchatka",
            "description": "Часовой пояс юрлица, имя IANA. По нему датируются бланки Т-6, Т-7 и Т-13: «сегодня» документа — сутки юрлица, а не сервера. Юрлицо без настройки — по московскому времени (Europe/Moscow)."
          },
          "mine": {
            "type": "boolean",
            "description": "Смотрящий состоит в этом юрлице на «сегодня» юрлица: по привязке, а без привязок — в юрлице по умолчанию. Раздел без entity в адресе открывается на своём юрлице; своих несколько — сначала то, что по умолчанию, затем первое по имени."
          }
        }
      },
      "LegalEntitiesResponse": {
        "type": "object",
        "required": [
          "entities"
        ],
        "properties": {
          "entities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegalEntity"
            }
          }
        }
      },
      "VacationActualRequest": {
        "type": "object",
        "properties": {
          "startsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 7: с какого числа человек ушёл на самом деле. Пусто — ещё не уходил."
          },
          "endsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 7: по какое число включительно."
          },
          "basis": {
            "type": "string",
            "nullable": true,
            "description": "Графа 8: чем перенос оформлен — приказ, заявление, больничный. Меняет только перенос (POST …/move): здесь поле нет — сохранённое остаётся, равно сохранённому — проходит, отличается — 422 use_move."
          },
          "movedTo": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Графа 9: на когда перенесён отпуск. Отличается от факта: «пойдёт тогда-то» против «ушёл тогда-то». Меняет только перенос (POST …/move): здесь поле нет — сохранённое остаётся, равно сохранённому — проходит, отличается — 422 use_move."
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Графа 10: примечание."
          },
          "order": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Приказ, которым перенос оформлен: графа 8 печатает его реквизиты вместо текста из basis. Меняет перенос (POST …/move, поле movedOrder). Поля нет в запросе — ссылка не меняется; пустая строка отвязывает приказ — кадровик ошибается тоже. Приказ обязан быть из книги ТОГО ЖЕ юрлица, что и график. Сослаться на отменённый приказ нельзя — order_cancelled; ссылка, поставленная до отмены, остаётся, пока поле не прислано."
          },
          "grantOrder": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Приказ о предоставлении отпуска: Т-6 печатает его номер и дату в шапке. Поля нет в запросе — ссылка не меняется; пустая строка отвязывает приказ. Приказ обязан быть из книги ТОГО ЖЕ юрлица, что и график; приказ при печати не заводится. Сослаться на отменённый приказ нельзя — order_cancelled; ссылка, поставленная до отмены, остаётся, пока поле не прислано."
          }
        }
      },
      "VacationStage": {
        "type": "object",
        "required": [
          "key",
          "done",
          "ready",
          "of"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "announced",
              "handed",
              "filled",
              "agreed",
              "review",
              "approved"
            ],
            "description": "Шаг каскада: объявлен · раздали · внесли · согласовали · свод · утверждение."
          },
          "done": {
            "type": "boolean"
          },
          "ready": {
            "type": "integer",
            "description": "Сколько готово: подразделений или людей, смотря по шагу."
          },
          "of": {
            "type": "integer",
            "description": "Из скольких. Ноль у шагов, которые считаются не числом, а состоянием документа."
          }
        }
      },
      "VacationDepartmentProgress": {
        "type": "object",
        "required": [
          "id",
          "name",
          "people",
          "filled",
          "agreed",
          "percent",
          "noDepartment",
          "without",
          "partial",
          "withDates"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Подразделение снимка Битрикс24; у строки «Без подразделения» — 0."
          },
          "name": {
            "type": "string"
          },
          "people": {
            "type": "integer",
            "description": "Людей в подразделении по снимку. Пропавшие из снимка не считаются: уволенного не дождёшься."
          },
          "filled": {
            "type": "integer",
            "description": "Сколько внесли по норме: дней отпуска не меньше нормы."
          },
          "without": {
            "type": "integer",
            "description": "Сколько из people не внесли: дней отпуска ноль — строк нет или все строки легли на праздники."
          },
          "partial": {
            "type": "integer",
            "description": "Сколько из people внесли не всё: дней отпуска меньше нормы. Вместе с filled и without — people."
          },
          "withDates": {
            "type": "integer",
            "description": "Сколько из people внесли хоть одну строку, в том числе в 0 дней. «Без дат» — people − withDates; согласованные, ждущие и возвращённые вместе — withDates."
          },
          "agreed": {
            "type": "integer",
            "description": "У скольких строки есть и все согласованы."
          },
          "percent": {
            "type": "integer",
            "description": "Процент заполнения. Отстающие идут первыми."
          },
          "noDepartment": {
            "type": "boolean",
            "description": "Строка «Без подразделения»: участники без отдела в снимке — кадровик, люди без учётки Битрикс24. Бывает только при пустом охвате и только если такие люди есть. Руководителя у неё нет, напоминание её не адресует."
          }
        }
      },
      "VacationCascade": {
        "type": "object",
        "required": [
          "stages",
          "departments",
          "people",
          "filled",
          "scope",
          "excluded",
          "multi",
          "without",
          "partial",
          "withDates",
          "daysApprox"
        ],
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationStage"
            }
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationDepartmentProgress"
            }
          },
          "people": {
            "type": "integer",
            "description": "Участники сбора без отмеченных «Не планировать» — уникальные: человек двух подразделений считается один раз, поэтому сумма people по подразделениям бывает больше. Тот же состав, что у готовности (participants)."
          },
          "filled": {
            "type": "integer",
            "description": "Сколько из people внесли по норме — тоже уникальные люди."
          },
          "without": {
            "type": "integer",
            "description": "Сколько из people не внесли: дней отпуска ноль — строк нет или все строки легли на праздники."
          },
          "partial": {
            "type": "integer",
            "description": "Сколько из people внесли не всё: дней отпуска меньше нормы. Вместе с filled и without — people."
          },
          "withDates": {
            "type": "integer",
            "description": "Сколько из people внесли хоть одну строку, в том числе в 0 дней. «Без дат» — people − withDates; согласованные, ждущие и возвращённые вместе — withDates."
          },
          "daysApprox": {
            "type": "boolean",
            "description": "Производственный календарь молчал хоть на одной строке: её дни посчитаны длиной периода, и числа по норме приблизительны."
          },
          "excluded": {
            "type": "integer",
            "description": "Отмеченные «Не планировать в этом году»: в составе, но вне people и filled."
          },
          "multi": {
            "type": "integer",
            "description": "Сколько из people стоят в строках двух и более подразделений — поэтому сумма строк больше итога."
          },
          "scope": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Охват сбора: подразделения, с которых собирают. Пустой список значит «всё юрлицо»."
          }
        }
      },
      "VacationRemindRequest": {
        "type": "object",
        "description": "Кому напомнить: отбор как у списка участников или явный выбор людей. Тело без полей — всем отстающим области смотрящего. Из отбора берутся только «не внёс» и «внёс не всё». people вместе с полями отбора не принимается — 400 bad_request.",
        "properties": {
          "department": {
            "oneOf": [
              {
                "type": "integer",
                "format": "int64",
                "minimum": 1
              },
              {
                "type": "string",
                "enum": [
                  "none"
                ]
              }
            ],
            "nullable": true,
            "description": "id подразделения охвата — только его люди; none — «Без подразделения» (только уровень all). Вне поддерева смотрящего или none на уровне dept — 403 forbidden."
          },
          "state": {
            "type": "string",
            "enum": [
              "without",
              "partial"
            ],
            "nullable": true,
            "description": "Только «не внёс» (without) или только «внёс не всё» (partial)."
          },
          "issue": {
            "type": "string",
            "enum": [
              "short_part",
              "second_year",
              "no_days",
              "off_norm"
            ],
            "nullable": true,
            "description": "Проблема раздела «Согласования» — как у списка участников; из людей раздела напоминание уходит только отстающим."
          },
          "q": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "nullable": true,
            "description": "Поиск — как у списка участников: по началу слов имени и по почте безымянных."
          },
          "people": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "Явный выбор: public_id человека или ссылка b24-<номер> для не входившего. Человек вне области — 403 forbidden на всё нажатие; уже внёсший или «не планирует» — пропуск с причиной not_lagging. Напоминание уходит только выбранным: сводки руководителям нет, heads — нули."
          }
        }
      },
      "VacationReminded": {
        "type": "object",
        "required": [
          "sent",
          "skipped",
          "failed",
          "remaining",
          "heads"
        ],
        "properties": {
          "sent": {
            "type": "integer",
            "minimum": 0,
            "description": "Скольким отстающим напоминание ушло этим нажатием."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "reason",
                "total",
                "people"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "enum": [
                    "recent",
                    "no_account",
                    "not_lagging"
                  ],
                  "description": "Почему пропущены: recent — напоминание этому человеку ждёт отправки или ушло меньше суток назад; no_account — у человека нет учётки Битрикс24; not_lagging — уже внёс даты или отмечен «Не планировать»."
                },
                "total": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Сколько людей с этой причиной."
                },
                "people": {
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "$ref": "#/components/schemas/VacationRemindPerson"
                  },
                  "description": "Первые 100 поимённо; остальные — числом total."
                }
              }
            },
            "description": "Кого пропустили — по причинам. Пропуск не ошибка: напоминать было не нужно или некуда."
          },
          "failed": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "reason",
                "total",
                "people"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "enum": [
                    "no_rights",
                    "unavailable",
                    "rejected"
                  ],
                  "description": "Почему не дошло: no_rights — портал отказал вебхуку нажавшего, после входа в сервис заново сообщения уйдут фоном; unavailable — портал не ответил, сообщение в очереди, фон повторит его; rejected — портал отказал по человеку, повтора нет."
                },
                "total": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Сколько людей с этой причиной."
                },
                "people": {
                  "type": "array",
                  "maxItems": 100,
                  "items": {
                    "$ref": "#/components/schemas/VacationRemindPerson"
                  },
                  "description": "Первые 100 поимённо; остальные — числом total."
                }
              }
            },
            "description": "Кому не дошло — по причинам. Отдельно от skipped: пропуск — «напоминать было не нужно», отказ — «хотели, но не дошло»."
          },
          "remaining": {
            "type": "integer",
            "minimum": 0,
            "description": "Скольким нажатие не успело отправить в свой бюджет времени: сообщения в очереди, их доставит фон."
          },
          "heads": {
            "type": "object",
            "required": [
              "sent",
              "failed"
            ],
            "description": "Сводки руководителям отделов этого нажатия: одна руководителю, не чаще раза в сутки об одном отделе. Только при напоминании по отбору; при явном выборе people — нули.",
            "properties": {
              "sent": {
                "type": "integer",
                "minimum": 0,
                "description": "Сводок ушло."
              },
              "failed": {
                "type": "integer",
                "minimum": 0,
                "description": "Сводок не дошло или ждут повтора фоном."
              }
            }
          }
        }
      },
      "VacationPerson": {
        "type": "object",
        "required": [
          "user",
          "b24User",
          "userName",
          "secondYear"
        ],
        "properties": {
          "user": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "public_id человека; null — человек не входил в сервис, у него есть только строка снимка Битрикс24. Записи принимают вместо public_id ссылку b24-<b24User>. Ломающее изменение (ADR-vacation-hr-cycle): раньше поле было строкой всегда."
          },
          "b24User": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Номер человека в Битрикс24; null — учётки Битрикс24 нет."
          },
          "userName": {
            "type": "string"
          },
          "secondYear": {
            "type": "boolean",
            "description": "Отпуска у человека нет и в прошлом году — второй год подряд, что запрещает статья 124. Сведения, а не запрет на утверждение. Ложь и тогда, когда про прошлый год сказать нечего: утверждённого графика прошлого года у юрлица нет или человек пришёл в течение него."
          }
        }
      },
      "LegalEntityRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Название юрлица как в уставе. Два одинаковых имени в портале запрещены: различить их в переключателе потом нельзя."
          },
          "inn": {
            "type": "string",
            "nullable": true,
            "description": "ИНН: десять цифр у организации, двенадцать у ИП."
          },
          "kpp": {
            "type": "string",
            "nullable": true,
            "description": "КПП: девять цифр."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "Часовой пояс юрлица, имя IANA (например, Asia/Kamchatka). Нет поля — московский. Имя, которого нет в базе поясов, — отказ bad_timezone."
          }
        }
      },
      "LegalEntityPatchRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "inn": {
            "type": "string",
            "nullable": true,
            "description": "Пустая строка стирает значение; отсутствие поля оставляет как есть."
          },
          "kpp": {
            "type": "string",
            "nullable": true
          },
          "active": {
            "type": "boolean",
            "description": "Ликвидированное юрлицо не удаляют — его помечают недействующим: в нём остались графики прошлых лет."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Сделать юрлицом по умолчанию. Снять умолчание нельзя — его можно только передать другому: портал без умолчания это портал, в котором графику некуда лечь."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "description": "Новый часовой пояс, имя IANA. Пустая строка — отказ, а не сброс: пояс у юрлица есть всегда, и вернуть московский — значит прислать Europe/Moscow. Имя, которого нет в базе поясов, — отказ bad_timezone."
          }
        }
      },
      "AbsenceScenario": {
        "type": "object",
        "required": [
          "code",
          "kit",
          "dueDays",
          "catalogDueDays",
          "catalogDue",
          "enabled",
          "launchLevel",
          "timesheetCode",
          "catalogTimesheetCode",
          "catalogTimesheet",
          "needsPeriod",
          "canLaunch",
          "inWork",
          "overdue",
          "lastMonth"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Код сценария — ключ каталога; им же называется сценарий у мероприятия."
          },
          "kit": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Виды документов комплекта в порядке сбора. Коды: заявление, приказ Т-6, справка-вызов и другие; названия держит интерфейс."
          },
          "dueDays": {
            "type": "integer",
            "description": "ДЕЙСТВУЮЩИЙ срок в календарных днях от запуска: настроенный порталом или, пока портал его не трогал, каталожный. Обещание, а не запрет."
          },
          "catalogDueDays": {
            "type": "integer",
            "description": "Срок каталога — умолчание состава ТК. Экран показывает, от чего портал отступил, а не только результат."
          },
          "catalogDue": {
            "type": "boolean",
            "description": "Задан ли срок каталогом, а не порталом. Число, равное каталожному, портал мог поставить сам — тогда оно заморожено и правка каталога в коде до него не доедет; экрану это нужно словом, а не сравнением двух чисел."
          },
          "enabled": {
            "type": "boolean",
            "description": "Предлагается ли сценарий на портале. Выключенный виден в каталоге и не запускается: спрятать его значило бы притвориться, что такого вида отсутствия в ТК нет."
          },
          "launchLevel": {
            "type": "string",
            "enum": [
              "own",
              "dept",
              "all"
            ],
            "description": "С какого уровня права absence_process · launch сценарий запускают: own — и работник на себя, dept — и руководитель на своих (если портал выдал им launch), all — только кадровая служба. Умолчание — all."
          },
          "timesheetCode": {
            "type": "string",
            "description": "ДЕЙСТВУЮЩИЙ буквенный код формы Т-12, которым оформленное мероприятие (после подписи компании) ложится в табель на даты своего периода: настроенный порталом или, пока портал его не трогал, каталожный. Пустая строка — вид в табель не ставится: у ежегодного отпуска «ОТ» приходит из графика, отзыв и перенос правят другой отпуск."
          },
          "catalogTimesheetCode": {
            "type": "string",
            "description": "Код табеля каталога — умолчание по форме Т-12; пусто у видов, которые своей неявки не дают."
          },
          "catalogTimesheet": {
            "type": "boolean",
            "description": "Задан ли код табеля каталогом, а не порталом. Тот же приём, что у срока: код, равный каталожному, портал мог поставить сам, и тогда правка каталога до него не доедет."
          },
          "needsPeriod": {
            "type": "boolean",
            "description": "Запуск требует обе даты периода (startsOn и endsOn); без них — period_required. Признак каталога, портал его не настраивает: у отпусков и дней, которые сами дают отсутствие на даты, — да, у отзыва, переноса, продления и компенсации — нет."
          },
          "canLaunch": {
            "type": "boolean",
            "description": "Вправе ли ЭТОТ смотрящий запустить сценарий: уровень не ниже launchLevel и сценарий включён. Считает сервер — кнопка, обещающая отказ, врёт до нажатия."
          },
          "inWork": {
            "type": "integer",
            "description": "Идущих мероприятий по сценарию в этом юрлице. Сужено уровнем смотрящего, как список «в работе». Сумма по многим людям, поэтому при просмотре мероприятий уровня dept открыта только с включённой настройкой absence.kind_visible_to_dept, иначе 0 (уровни own и all считают то, что смотрящему и так видно) — счётчик по виду рядом со списком назвал бы вид, который список прячет (Q-402). То же правило у overdue и lastMonth."
          },
          "overdue": {
            "type": "integer",
            "description": "Из них просроченных — «горит»."
          },
          "lastMonth": {
            "type": "integer",
            "description": "Запущено за последние тридцать дней, считая законченные: это частота сценария, а не остаток работы."
          }
        }
      },
      "AbsenceScenariosResponse": {
        "type": "object",
        "required": [
          "scenarios",
          "maySetup",
          "timesheetCodes"
        ],
        "properties": {
          "scenarios": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AbsenceScenario"
            }
          },
          "maySetup": {
            "type": "boolean",
            "description": "Вправе ли смотрящий менять настройку сценариев. Настройка портальная: правит тот, кому мероприятия открыты целиком."
          },
          "timesheetCodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimesheetCode"
            },
            "description": "Из каких кодов портал выбирает код табеля вида: неявки формы Т-12 в порядке каталога, с цифрой и группой. Явки «Я» и выходного «В» здесь нет — мероприятие ими в табель не ложится."
          }
        }
      },
      "AbsenceDoc": {
        "type": "object",
        "required": [
          "kind",
          "state"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "Вид документа — код каталога."
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ready"
            ],
            "description": "Готов ли документ. При запуске все «не готовы»."
          }
        }
      },
      "AbsenceProcess": {
        "type": "object",
        "required": [
          "id",
          "user",
          "userName",
          "stage",
          "dueOn",
          "overdue",
          "startedAt",
          "startedBy",
          "docsReady",
          "docsTotal",
          "docs",
          "steps",
          "allowed",
          "finishedAt",
          "startsOn",
          "endsOn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес мероприятия наружу."
          },
          "user": {
            "type": "string",
            "format": "uuid",
            "description": "Кого оформляют."
          },
          "userName": {
            "type": "string",
            "description": "ФИО одной строкой, собранное сервером: список подписывает строки именами, а не адресами."
          },
          "scenario": {
            "type": "string",
            "description": "Код сценария из каталога. Отсутствует, когда вид скрыт от смотрящего: строка не его, просмотр мероприятий ниже all, строки этого человека он не правит и портал не включил настройку absence.kind_visible_to_dept. Беременность, уход за ребёнком и болезнь — сведения о здоровье (Q-402)."
          },
          "stage": {
            "type": "string",
            "enum": [
              "kit",
              "employee_sign",
              "company_sign",
              "onec",
              "done",
              "cancelled"
            ],
            "description": "Этап. Маршрут один на все сценарии: kit — формирование комплекта, employee_sign — подписание работником, company_sign — подписание компанией, onec — проведение в 1С:ЗУП, done — готово. cancelled — отменено, выход из маршрута."
          },
          "dueOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Срок: день запуска плюс срок сценария. Обещание, а не запрет. null, когда вид отсутствия скрыт от смотрящего (поля scenario нет): срок сценария свой, и по паре startedAt/dueOn вид восстанавливался бы. Флаг overdue при этом остаётся."
          },
          "overdue": {
            "type": "boolean",
            "description": "Просрочено на день запроса — «горит». Считает сервер, чтобы экран не спорил с ним о том, какой сегодня день."
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда запущено."
          },
          "startedBy": {
            "type": "string",
            "description": "Кто запустил — ФИО. Мероприятие — действие человека, а не сервиса."
          },
          "docsReady": {
            "type": "integer",
            "description": "Сколько документов комплекта готово."
          },
          "docsTotal": {
            "type": "integer",
            "description": "Сколько документов в комплекте."
          },
          "docs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AbsenceDoc"
            },
            "description": "Комплект по документам. Заполнен в ответе на запуск; в списке пуст — там хватает счётчика. Пуст и тогда, когда вид отсутствия скрыт от смотрящего (см. scenario): состав комплекта называет вид не хуже кода сценария (Q-402)."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AbsenceStep"
            },
            "description": "Журнал: кто, когда и куда двинул, и почему вернул или отменил. Заполнен у карточки; в списке пуст."
          },
          "allowed": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "advance",
                "back",
                "cancel",
                "manual"
              ]
            },
            "description": "Что смотрящий может сделать сейчас. Считает сервер от этапа и права; пустой — только смотреть."
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда закончено или отменено; пусто у идущего."
          },
          "startsOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Период из заявления: первый день. null — период не указан при запуске."
          },
          "endsOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "Период из заявления: последний день, включительно. null — период не указан."
          }
        }
      },
      "AbsenceProcessesResponse": {
        "type": "object",
        "required": [
          "processes",
          "attention"
        ],
        "properties": {
          "processes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AbsenceProcess"
            }
          },
          "attention": {
            "type": "integer",
            "description": "Сколько требует вмешательства — просроченных в списке."
          }
        }
      },
      "AbsenceStartRequest": {
        "type": "object",
        "required": [
          "user",
          "scenario"
        ],
        "properties": {
          "user": {
            "type": "string",
            "format": "uuid",
            "description": "На кого запустить. Адрес человека наружу."
          },
          "scenario": {
            "type": "string",
            "description": "Код сценария из каталога."
          },
          "startsOn": {
            "type": "string",
            "format": "date",
            "description": "Первый день периода из заявления, включительно. Обязателен, если у сценария needsPeriod."
          },
          "endsOn": {
            "type": "string",
            "format": "date",
            "description": "Последний день периода из заявления, включительно. Обязателен, если у сценария needsPeriod. Обе даты или ни одной; «по» не раньше «с» — иначе bad_period."
          }
        }
      },
      "AbsenceStep": {
        "type": "object",
        "required": [
          "action",
          "from",
          "to",
          "note",
          "at",
          "by"
        ],
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "advance",
              "back",
              "cancel",
              "manual"
            ],
            "description": "Что сделали."
          },
          "from": {
            "type": "string",
            "description": "С какого этапа."
          },
          "to": {
            "type": "string",
            "description": "На какой."
          },
          "note": {
            "type": "string",
            "nullable": true,
            "description": "Причина. У возврата, отмены и ручного закрытия есть всегда, у движения вперёд пуста. Это свободный текст кадровика: виден своему мероприятию, при просмотре или правке мероприятий уровня all и тому, кто ведёт мероприятие этого человека; настройка absence.kind_visible_to_dept его не открывает."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "by": {
            "type": "string",
            "description": "Кто нажал — ФИО."
          }
        }
      },
      "AbsenceMoveRequest": {
        "type": "object",
        "required": [
          "action",
          "from"
        ],
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "advance",
              "back",
              "cancel",
              "manual"
            ],
            "description": "Дальше, на шаг назад или отменить."
          },
          "from": {
            "type": "string",
            "enum": [
              "kit",
              "employee_sign",
              "company_sign",
              "onec",
              "done",
              "cancelled"
            ],
            "description": "Этап, который видел экран. Мероприятие уже на другом — 409 stage_changed: переход решался про другое состояние."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Причина. У возврата, отмены и ручного закрытия обязательна, до 500 знаков; у движения вперёд не хранится."
          }
        }
      },
      "AbsenceDocRequest": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ready"
            ],
            "description": "Готов документ или нет."
          }
        }
      },
      "AbsenceScenarioSettingRequest": {
        "type": "object",
        "required": [
          "enabled",
          "dueDays",
          "launchLevel"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Предлагать ли сценарий на портале."
          },
          "dueDays": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 365,
            "description": "Срок в календарных днях от запуска: от 1 до 365, или null — «срок как в каталоге». Портал хранит только отступления от каталога (Q-405): число, равное каталожному, заморозило бы каталог на этом портале, и правка срока в коде до него бы не доехала. Ноль — не «по каталогу», а ошибка: такой срок горел бы в день запуска."
          },
          "launchLevel": {
            "type": "string",
            "enum": [
              "own",
              "dept",
              "all"
            ],
            "description": "С какого уровня права сценарий запускают."
          },
          "timesheetCode": {
            "type": "string",
            "nullable": true,
            "description": "Код табеля вида — буква из timesheetCodes каталога; пустая строка — «в табель не ставить»; null или пропуск — «код как в каталоге» (портал хранит только отступления, как и срок). Буква не из списка — bad_timesheet_code."
          }
        }
      },
      "TimesheetDay": {
        "type": "object",
        "required": [
          "date",
          "code",
          "digit",
          "hours",
          "source",
          "note",
          "changed",
          "calendar",
          "title",
          "basis",
          "outside",
          "future",
          "normHours",
          "blank"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "code": {
            "type": "string",
            "description": "Буквенный код формы Т-12: Я — явка, В — выходной, ОТ — ежегодный отпуск, ДО — без сохранения, У — учебный, Б — болезнь, Р — по беременности и родам, ОЖ — по уходу за ребёнком, К — командировка, НН — неявка по невыясненным причинам. masked — Б, Р или ОЖ чужого человека, вид которых скрыт от смотрящего (спека прав и приватности § 2.2): клетка рисуется неявкой по уважительной причине, часов у неё 0. Пустая строка — клетка пустая, почему — в blank (у дня вне членства в юрлице — outside)."
          },
          "digit": {
            "type": "string",
            "description": "Цифровой код той же формы — вторая графа бланка. Есть только у известных букв: придумывать цифру под чужую значит печатать неправду в подписываемом документе. У masked — пустая строка."
          },
          "hours": {
            "type": "integer",
            "description": "Часы, засчитанные дню. У кодов неявки — ноль."
          },
          "source": {
            "type": "string",
            "enum": [
              "service",
              "manual",
              "portal"
            ],
            "description": "Чем клетка получена: service — посчитал сервис по производственному календарю и графику отпусков; manual — поставил человек; portal — приехало из учёта рабочего дня на портале. Источник назван у КАЖДОЙ клетки, а не только у ручной: «не расчёт» и «рука» перестанут совпадать, как только появится портал, и спор о часах решается именно тем, кто клетку поставил."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Основание ручной отметки — то, что табельщик записал при постановке. У расчётной клетки null. Свободный текст: виден своей строке, при просмотре или правке табеля уровня all и тому, кто правит табель этого человека; иначе null. Форма правки открывается с ним, чтобы поправка часов не стирала основание."
          },
          "changed": {
            "type": "boolean",
            "description": "Клетка могла измениться после последней печати Т-13 за этот месяц: отметку поставили или переписали, строку графика, чьи плановые или фактические дни накрывают клетку или накрывали до переноса, правили. Выходной помечается, как будний день: внутри отпуска он «ОТ» и меняется вместе с датами строки. Не помечается нерабочий праздничный день — он остаётся «В» при любой правке графика. Без печати всегда false. Снятая отметка следа не оставляет — клетка возвращается к расчёту, и отличить «не ставили» от «сняли» нечем."
          },
          "calendar": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "holiday",
                  "rest",
                  "short",
                  "weekend"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид дня по производственному календарю: holiday — нерабочий праздничный, rest — выходной, перенесённый на эту дату, short — сокращённый предпраздничный, weekend — обычный выходной. null у обычного рабочего дня. Для подсказки клетки: «В — День народного единства», «7 ч — предпраздничный»."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Название дня из производственного календаря, например название праздника. null, если календарь названия не дал."
          },
          "basis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimesheetBasis"
              },
              {
                "type": "null"
              }
            ],
            "description": "Основание расчётной неявки: строка графика отпусков у «ОТ» или оформленное мероприятие у его кода, с периодом. null у остальных клеток, в том числе у ручной отметки."
          },
          "outside": {
            "type": "boolean",
            "description": "День вне членства человека в юрлице: пришёл позже первого числа или ушёл раньше последнего (то же правило, что у привязок юрлица, на каждый день). Кода, часов и основания у клетки нет, в итоги и норму она не входит, правке не подлежит. Строка человека есть в табеле, если он состоял в юрлице хоть один день месяца."
          },
          "future": {
            "type": "boolean",
            "description": "День ещё не наступил по часам юрлица: клетка — заготовка расчёта. В итоги (workedDays, byCode, первая половина) не идёт, в бланк Т-13 не печатается; план месяца — planDays и planHours."
          },
          "normHours": {
            "type": "integer",
            "description": "Норма дня по производственному календарю человека: часы, которые получила бы расчётная явка, — 8, в сокращённый предпраздничный 7, в нерабочий 0. Есть у каждой клетки, у пустой тоже, и в итоги не идёт: это не часы клетки, а то, с чем форма отметки предлагает явку, когда табельщик восстанавливает её рукой. У дня вне членства (outside) — 0."
          },
          "blank": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "inactive",
                  "not_hired",
                  "dismissed"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Почему клетка пуста: inactive — человек выключен в Битрикс24, явку сервис не ставит, отметку табельщик поставить может; not_hired — день раньше даты приёма; dismissed — день позже даты увольнения. В последние два отметку сервер не примет (not_employed), и клетка не правится — как и день вне членства в юрлице (outside). null у непустой клетки и у дня вне членства без причины по 1С. Вид дня (calendar) и норма дня (normHours) у пустой клетки по 1С остаются."
          }
        }
      },
      "TimesheetBasis": {
        "type": "object",
        "required": [
          "kind",
          "from",
          "to",
          "scenario"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "plan",
              "fact",
              "process"
            ],
            "description": "plan — по плановым датам строки графика, факт не отмечен; fact — по фактическим датам; process — по оформленному мероприятию (приказ подписан компанией)."
          },
          "from": {
            "type": "string",
            "format": "date",
            "description": "Начало периода: действующие даты строки графика или период мероприятия из заявления."
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Конец периода, включительно."
          },
          "scenario": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вид отсутствия мероприятия — код сценария (unpaid_leave, maternity_leave …); названия держит интерфейс. null у строки графика."
          }
        }
      },
      "TimesheetTotals": {
        "type": "object",
        "required": [
          "workedDays",
          "workedHours",
          "byCode",
          "firstHalfDays",
          "firstHalfHours",
          "normDays",
          "normHours",
          "monthNormDays",
          "monthNormHours",
          "planDays",
          "planHours"
        ],
        "properties": {
          "workedDays": {
            "type": "integer"
          },
          "workedHours": {
            "type": "integer"
          },
          "byCode": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Сколько дней по каждому коду. Б, Р и ОЖ, вид которых скрыт от смотрящего, сливаются в ключ masked."
          },
          "firstHalfDays": {
            "type": "integer",
            "description": "Отработано дней с 1 по 15 число — графа 5 бланка Т-13, аванс за первую половину месяца (ст. 136 ТК)."
          },
          "firstHalfHours": {
            "type": "integer",
            "description": "Отработано часов с 1 по 15 число."
          },
          "normDays": {
            "type": "integer",
            "description": "Норма рабочих дней по дням работы: календарь человека только в дни, когда у него есть клетка в табеле (членство в юрлице, даты приёма и увольнения). У принятого или уволенного посреди месяца меньше месячной (monthNormDays); недоработка считается от неё."
          },
          "normHours": {
            "type": "integer",
            "description": "Норма часов по дням работы, с сокращёнными предпраздничными; у принятого или уволенного посреди месяца меньше месячной (monthNormHours)."
          },
          "monthNormDays": {
            "type": "integer",
            "description": "Норма рабочих дней за весь месяц по производственному календарю человека — справочно для расчётчика; у работавшего весь месяц совпадает с normDays."
          },
          "monthNormHours": {
            "type": "integer",
            "description": "Норма часов за весь месяц — справочно; у работавшего весь месяц совпадает с normHours."
          },
          "planDays": {
            "type": "integer",
            "description": "План месяца: дней явки по всем дням, заготовка будущих тоже. workedDays — только по сегодняшний день юрлица."
          },
          "planHours": {
            "type": "integer",
            "description": "План месяца в часах — тем же правилом, что planDays."
          }
        }
      },
      "TimesheetRow": {
        "type": "object",
        "required": [
          "user",
          "userName",
          "inactive",
          "checkLastDays",
          "department",
          "days",
          "totals"
        ],
        "properties": {
          "user": {
            "type": "string",
            "format": "uuid"
          },
          "userName": {
            "type": "string"
          },
          "inactive": {
            "type": "boolean",
            "description": "Человек выключен в Битрикс24 — уволен. Пропавший из ответа портала уволенным не считается (решение владелицы 03.10.2026). Строка остаётся, но явок «Я» за него сервис не ставит: с дня, когда впервые увидел учётку выключенной, а если этот день неизвестен — за весь месяц; есть дата увольнения из 1С — граница по ней. Клетки без явки приезжают пустыми (code и digit — пустые строки, hours — 0, source — service); ручные отметки остаются как есть. Человек без учётки Битрикс24 неактивным не считается."
          },
          "checkLastDays": {
            "type": "boolean",
            "description": "Человека выключили в Битрикс24 в этом месяце, а даты увольнения из 1С нет. Явки за него стоят до дня, когда сервис впервые увидел учётку выключенной, — а выключение могло отстать от увольнения на день-два: строка просит проверить последние дни (решение владелицы 03.10.2026). Без даты 1С и без известного дня выключения явок нет за весь месяц, как прежде."
          },
          "department": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PersonDepartment"
              },
              {
                "type": "null"
              }
            ],
            "description": "Первый отдел человека — минимальный путь среди непропавших отделов снимка; им экран группирует табель. null — человека нет в снимке оргструктуры или все его отделы пропали. От фильтра department не зависит."
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimesheetDay"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/TimesheetTotals"
          }
        }
      },
      "TimesheetResponse": {
        "type": "object",
        "required": [
          "from",
          "to",
          "rows",
          "codes",
          "print",
          "unloadedCalendars",
          "fallbackCalendars",
          "printable",
          "nextCursor",
          "people",
          "documentPeople"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimesheetRow"
            }
          },
          "codes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimesheetCode"
            },
            "description": "Алфавит формы, которым заполняются клетки. Приезжает с табелем, а не живёт на экране: буквы Т-12 принадлежат документу, и второй их список на экране разошёлся бы с этим молча."
          },
          "print": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimesheetPrint"
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя печать Т-13 за этот месяц и что изменилось с тех пор — по области документа. null — не печатали; это не то же самое, что «печатали, ничего не менялось»."
          },
          "unloadedCalendars": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "deprecated": true,
            "description": "Устарело: год без календаря табель больше не считает пятидневкой, а отказывает 422 year_not_loaded. Приходит всегда пустым списком; поле снимут отдельной задачей."
          },
          "fallbackCalendars": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Производственные календари людей страницы, в которых года месяца нет и он посчитан по базовому календарю — без региональных праздников, — по имени в порядке строк. Пустой список — подмены не было."
          },
          "printable": {
            "type": "boolean",
            "description": "Напечатается ли Т-13 этого месяца у смотрящего: в бланк не попала бы ни одна клетка Б, Р или ОЖ, вид которой от него скрыт. Считается по области документа, а не по загруженной странице. false — GET /api/v1/timesheet/print ответит 403 print_masked."
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы людей; null — последняя."
          },
          "people": {
            "type": "integer",
            "description": "Людей в области запроса (с фильтром department)."
          },
          "documentPeople": {
            "type": "integer",
            "description": "Людей документа — области без подразделения: ровно то, что напечатает Т-13. Ноль — печатать нечего."
          }
        }
      },
      "TimesheetPrint": {
        "type": "object",
        "required": [
          "number",
          "printedAt",
          "printedBy",
          "changedMarks",
          "changedEntries",
          "changedEvents"
        ],
        "properties": {
          "number": {
            "type": "integer",
            "description": "Номер документа из шапки Т-13 — порядковый в году отчётного периода и юрлица. Повторная печать того же месяца получает следующий номер: две распечатки различимы."
          },
          "printedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда печатали."
          },
          "printedBy": {
            "type": "string",
            "description": "Кто печатал, словами."
          },
          "changedMarks": {
            "type": "integer",
            "description": "Сколько отметок табельщика поставлено или переписано после печати — по области документа (уровень смотрящего без подразделения), а не по загруженной странице; подсветка клеток — по странице."
          },
          "changedEntries": {
            "type": "integer",
            "description": "У скольких строк графика отпусков после печати поменялись даты или правили их график — по людям области документа. Строка считается один раз, сколько бы дней она ни занимала; число может быть больше подсвеченного (правка только на нерабочих днях или под отметкой)."
          },
          "changedEvents": {
            "type": "integer",
            "description": "Сколько мероприятий после печати подписали компанией или вернули с подписи (отменили) — их дни в табеле появились или ушли, и клетки этих дней помечены changed, как при переносе отпуска. По людям области документа; мероприятие считается один раз, сколько бы дней оно ни занимало и сколько бы раз его ни двигали; число может быть больше подсвеченного (дни под отметкой)."
          }
        }
      },
      "TimesheetMarkRequest": {
        "type": "object",
        "required": [
          "code",
          "hours"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 24
          },
          "note": {
            "type": "string",
            "nullable": true,
            "maxLength": 255,
            "description": "Основание словами: «больничный № 12345», «приказ о командировке». Табель подписывают, и отметка без основания — отметка со слов."
          },
          "to": {
            "type": "string",
            "format": "date",
            "description": "Последний день отрезка «с — по», если отметка ставится на несколько дней; нет — отметка на один день из адреса. Отрезок — внутри одного месяца: табель сдаётся помесячно. «Б», «Т» и «К» ложатся на все календарные дни, остальные коды — только на рабочие; дни отпуска по графику («ОТ») и дни до даты приёма или после даты увольнения человека не трогаются."
          }
        }
      },
      "TimesheetCode": {
        "type": "object",
        "required": [
          "code",
          "digit",
          "family",
          "group"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Буквенный код формы Т-12."
          },
          "digit": {
            "type": "string",
            "description": "Цифровой код той же формы."
          },
          "family": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "leave",
                  "sick",
                  "trip",
                  "absent",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Семейство неявки — по разделу формы (group): leave — отпуск любого вида, sick — болезнь, trip — работа не на месте (командировка, учёба с отрывом), absent — неявка, требующая разбора (невыясненная, прогул), other — неявка без разбора (простой, отстранение, дополнительный выходной, гособязанности, забастовка). null — не неявка (явка, выходной, сокращённое время): такую клетку экран не красит."
          },
          "group": {
            "type": "string",
            "enum": [
              "work",
              "rest",
              "leave",
              "sick",
              "away",
              "absence",
              "idle",
              "short"
            ],
            "description": "Раздел формы отметки, по смыслу кода: work — явка; rest — выходные, в том числе дополнительные; leave — отпуска; sick — временная нетрудоспособность; away — командировка и учёба с отрывом от работы; absence — неявки (невыясненная, прогул, вынужденный прогул, государственные обязанности, забастовка); idle — простой и отстранение; short — сокращённое и неполное время. Коды одной группы в списке codes идут подряд."
          }
        }
      },
      "VacationNotified": {
        "type": "object",
        "required": [
          "sent",
          "late",
          "noAccount",
          "refused",
          "moved",
          "dismissed",
          "notFound",
          "skipped",
          "remaining",
          "waiting",
          "stoppedCode"
        ],
        "properties": {
          "sent": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому уведомление ушло вовремя."
          },
          "late": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому ушло, но меньше чем за две недели до начала: срок закона уже не соблюдён."
          },
          "noAccount": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому отправить нечем: человек не связан с пользователем портала."
          },
          "refused": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому портал уведомление не принял."
          },
          "moved": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому ушло уведомление о перенесённом отпуске."
          },
          "dismissed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому пора, но уведомление не отправлено: человек уволен — выключен в Битрикс24 или по датам 1С не работает в день начала отпуска. Называются при каждой рассылке; в журнал о каждом отпуске ложится одна запись «не отправлено»."
          },
          "notFound": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кого эта рассылка уведомила, хотя в Битрикс24 человека не нашли: портал перестал его отдавать, а выключенным не прислал. Уволенным такой человек не считается (решение владелицы 03.10.2026) и уведомляется, как работающий; список — чтобы кадровик проверил, работает ли он."
          },
          "skipped": {
            "type": "integer",
            "description": "Строки окна, которые проход не тронул: их уведомил параллельный проход между выборкой окна и отправкой. Строки вне окна, уже уведомлённые о этой дате и с начавшимся отпуском в выборку не попадают и здесь не считаются."
          },
          "remaining": {
            "type": "integer",
            "description": "Строки окна, оставшиеся после прохода: кнопка ограничена 15 секундами, их дошлёт следующее нажатие или ночной проход."
          },
          "waiting": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Кому пора уведомлять, но график снова в сборе, а даты строки поменяли после утверждения (решение владелицы 03.10.2026, №17): уведомление уйдёт при утверждении графика. В remaining не входят."
          },
          "stoppedCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Код, которым портал отказал 20 раз подряд; рассылка по графику остановлена. null — не останавливалась."
          }
        }
      },
      "VacationNoticeRepeated": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "sent",
              "no_b24_account",
              "portal_refused"
            ],
            "description": "Чем кончилась отправка: ушло, у работника нет учётки в Битрикс24 или портал отказал."
          }
        }
      },
      "VacationNotice": {
        "type": "object",
        "required": [
          "entryId",
          "userName",
          "startsOn",
          "endsOn",
          "goneOn",
          "about",
          "state",
          "manualRepeat",
          "portalCode",
          "sentAt",
          "byService",
          "late"
        ],
        "properties": {
          "entryId": {
            "type": "string",
            "description": "public_id строки графика: по нему повторяют уведомление."
          },
          "userName": {
            "type": "string"
          },
          "startsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "О какой дате начала уведомили. Пусто у старых записей."
          },
          "endsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "По какое число отпуск, о котором уведомили: в записи весь период «с — по» (решение владелицы 01.10.2026). Пусто у записей до этого решения и у уведомления о переносе — окончания перенесённого отпуска сервис не знает, графа 9 формы Т-7 одна дата."
          },
          "goneOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "У записи «не отправлено» (решение владелицы 03.10.2026): день, с которого человека нет у работодателя по датам 1С, — дата увольнения у dismissed, дата приёма у not_hired. Пусто у b24_inactive (снимок Битрикс24 не знает, с какого дня человек выключен) и у прочих записей."
          },
          "about": {
            "type": "string",
            "enum": [
              "plan",
              "moved"
            ],
            "description": "plan — отпуск по графику, moved — перенесённый."
          },
          "state": {
            "type": "string",
            "enum": [
              "sent",
              "no_b24_account",
              "portal_refused",
              "moved_no_dates",
              "dismissed",
              "not_hired",
              "b24_inactive"
            ],
            "description": "moved_no_dates встречается только в записях до 24.09.2026: с тех пор перенос даёт новое уведомление о новой дате. dismissed, not_hired и b24_inactive — «не отправлено», работника у работодателя нет: уволен по дате из 1С раньше начала отпуска, принят по дате из 1С после начала, выключен в Битрикс24. Такая запись одна на отпуск и дату начала (решение владелицы 03.10.2026), в портал по ней не ходили."
          },
          "manualRepeat": {
            "type": "boolean",
            "description": "Повтор, отправленный кадровиком вручную."
          },
          "portalCode": {
            "type": "string",
            "nullable": true,
            "description": "Код отказа портала, если уведомление не принято."
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "byService": {
            "type": "boolean",
            "description": "Отправил сам сервис ночным проходом, а не человек."
          },
          "late": {
            "type": "boolean",
            "description": "Уведомление ушло меньше чем за 14 дней до начала отпуска, считая в сутках юрлица графика, — «уведомление позже срока» (ст. 123 ТК). Только у отправленных."
          }
        }
      },
      "VacationNoticeDue": {
        "type": "object",
        "required": [
          "entryId",
          "userName",
          "startsOn",
          "auto"
        ],
        "properties": {
          "entryId": {
            "type": "string",
            "description": "public_id строки графика."
          },
          "userName": {
            "type": "string"
          },
          "startsOn": {
            "type": "string",
            "format": "date",
            "description": "О какой дате начала уведомлять: плановая, а у перенесённой строки — дата переноса."
          },
          "auto": {
            "type": "boolean",
            "description": "Уйдёт само: даты строки те же, что при утверждении. false — ждёт утверждения графика, даты меняли."
          }
        }
      },
      "VacationNoticesResponse": {
        "type": "object",
        "required": [
          "notices",
          "reopened",
          "due",
          "dueMore",
          "nextCursor",
          "notFound",
          "notFoundTotal"
        ],
        "properties": {
          "notices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationNotice"
            }
          },
          "reopened": {
            "type": "boolean",
            "description": "График снова в сборе после утверждения (решение владелицы 03.10.2026, №17): уведомления уходят по строкам, у которых даты те же, что при последнем утверждении; остальным — при повторном утверждении. Только с первой страницей журнала; у следующих — false."
          },
          "due": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationNoticeDue"
            },
            "description": "У графика, снова стоящего в сборе, — кому подходит срок уведомления и уйдёт ли оно само: ближайшие по дате начала, не больше 100. Только тому, кто рассылает (правка всех строк графика), и только с первой страницей; иначе — пустой список."
          },
          "dueMore": {
            "type": "boolean",
            "description": "В окне рассылки есть ещё строки сверх due — они начинаются не раньше последней из списка."
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы; null — последняя."
          },
          "notFound": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Люди графика, не найденные в Битрикс24: портал перестал их отдавать, а выключенными не прислал (решение владелицы 03.10.2026). Уведомления им уходят, как работающим. Первые 100 по алфавиту; отдаются только тому, кто рассылает уведомления (правка всех строк графика), и только с первой страницей журнала — иначе пустой массив."
          },
          "notFoundTotal": {
            "type": "integer",
            "description": "Сколько всего людей графика не найдено в Битрикс24; больше длины notFound, когда имён больше предела. 0 — там же, где notFound пуст по правам или курсору."
          }
        }
      },
      "VacationNoticeSetting": {
        "type": "object",
        "required": [
          "windowDays",
          "defaultDays",
          "legalDays",
          "maxDays"
        ],
        "properties": {
          "windowDays": {
            "type": "integer",
            "description": "Окно портала в днях."
          },
          "defaultDays": {
            "type": "integer",
            "description": "Окно по умолчанию, пока портал его не менял."
          },
          "legalDays": {
            "type": "integer",
            "description": "Срок закона: уведомление позже считается поздним."
          },
          "maxDays": {
            "type": "integer",
            "description": "Наибольшее допустимое окно."
          }
        }
      },
      "VacationNoticeSettingRequest": {
        "type": "object",
        "required": [
          "windowDays"
        ],
        "properties": {
          "windowDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "number",
          "issuedOn",
          "requisites",
          "subject",
          "subjectName",
          "createdAt",
          "status",
          "cancellation",
          "corrections",
          "linkedRows",
          "can"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "t6",
              "t6a",
              "free"
            ],
            "description": "Вид приказа: t6 — на одного работника, t6a — списком, free — свободная форма (отзыв, перенос, продление)."
          },
          "number": {
            "type": "string",
            "description": "Номер из книги приказов компании. Сервис своей нумерации не ведёт: она разошлась бы с той, что стоит на бумаге в деле."
          },
          "issuedOn": {
            "type": "string",
            "format": "date"
          },
          "requisites": {
            "type": "string",
            "description": "Реквизиты одной строкой — «№ 12-к от 03.07.2027». Складывает сервер, чтобы графа 8 формы Т-7, шапка бланка и карточка называли приказ одинаково."
          },
          "subject": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "О ком приказ. Пусто у приказа на нескольких: там предмет собирается строками графика, которые на него сослались."
          },
          "subjectName": {
            "type": "string",
            "nullable": true,
            "description": "ФИО того, о ком приказ; пусто у приказа на нескольких."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "cancelled"
            ],
            "description": "active — действует; cancelled — отменён. Отменённый приказ остаётся в книге под своим номером: зарегистрированный приказ не удаляют, а отменяют."
          },
          "cancellation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderCancellation"
              }
            ],
            "nullable": true,
            "description": "Кто, когда и почему отменил; null у действующего приказа."
          },
          "corrections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderCorrection"
            },
            "description": "История исправлений реквизитов в порядке событий. Пустой список, если не исправляли."
          },
          "linkedRows": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько строк графика ссылаются на приказ: приказом о предоставлении отпуска или основанием переноса; строка с обеими ссылками — один раз. Считаются все строки, а не только видимые смотрящему: отмена лишает основания их все. Окно отмены называет это число."
          },
          "can": {
            "$ref": "#/components/schemas/OrderCan"
          }
        }
      },
      "OrderRequest": {
        "type": "object",
        "required": [
          "kind",
          "number",
          "issuedOn"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "t6",
              "t6a",
              "free"
            ]
          },
          "number": {
            "type": "string",
            "maxLength": 32
          },
          "issuedOn": {
            "type": "string",
            "format": "date"
          },
          "subject": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "О ком приказ. Не прислано — приказ без предмета: список собирается строками графика."
          }
        }
      },
      "OrdersResponse": {
        "type": "object",
        "required": [
          "orders",
          "nextCursor"
        ],
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Курсор следующей страницы книги; null — последняя."
          }
        }
      },
      "GameTemplateTier": {
        "type": "object",
        "required": [
          "thresholdPoints",
          "achievementId",
          "rewardText"
        ],
        "properties": {
          "thresholdPoints": {
            "type": "integer",
            "description": "Порог; пороги строго возрастают."
          },
          "achievementId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Ачивка уровня."
          },
          "rewardText": {
            "type": "string",
            "description": "Реальная награда, до 500 символов.",
            "nullable": true
          }
        }
      },
      "GameSeasonTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный идентификатор."
          },
          "title": {
            "type": "string",
            "maxLength": 60,
            "description": "Название шаблона, до 60 символов."
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "description": "Описание, до 500 символов."
          },
          "weeks": {
            "type": "integer",
            "minimum": 1,
            "maximum": 13,
            "description": "Число недель; по умолчанию 6."
          },
          "teamVisibility": {
            "type": "string",
            "enum": [
              "department",
              "parent",
              "company"
            ],
            "description": "Ступень видимости командной доски; по умолчанию department."
          },
          "personalVisibility": {
            "type": "string",
            "enum": [
              "self_manager",
              "department",
              "parent",
              "company"
            ],
            "description": "Ступень видимости личной доски; по умолчанию self_manager."
          },
          "leaderboard": {
            "type": "boolean",
            "description": "Показывать личный рейтинг; по умолчанию false."
          },
          "seasonAchievementId": {
            "type": "string",
            "format": "uuid",
            "description": "Ачивка компании по окончании сезона; null снимает ссылку.",
            "nullable": true
          },
          "tiers": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/GameTemplateTier"
            },
            "description": "Уровни; пороги строго возрастают. Ачивки только компании."
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Момент архивирования; null — действующий шаблон."
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "weeks",
          "teamVisibility",
          "personalVisibility",
          "leaderboard",
          "seasonAchievementId",
          "tiers",
          "archivedAt"
        ],
        "description": "Сохранённый шаблон каталога HR; ссылки — публичные id."
      },
      "GameSeasonTemplatesResponse": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameSeasonTemplate"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Курсор следующей страницы; null — конец списка."
          }
        },
        "required": [
          "templates",
          "nextCursor"
        ],
        "description": "Страница действующих шаблонов, новые сверху."
      },
      "GameContractTemplate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный идентификатор."
          },
          "kind": {
            "type": "string",
            "enum": [
              "contract",
              "challenge"
            ],
            "description": "Контракт сезона или челлендж; по умолчанию contract."
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9_-]{1,64}$",
            "description": "Уникальный код задания в библиотеке портала."
          },
          "title": {
            "type": "string",
            "maxLength": 60,
            "description": "Название задания."
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "description": "Описание задания."
          },
          "points": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "description": "Очки за зачёт."
          },
          "repeat": {
            "type": "string",
            "nullable": true,
            "enum": [
              "once",
              "weekly",
              "limited"
            ],
            "description": "Повтор контракта; у челленджа null."
          },
          "maxCount": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 100,
            "description": "Лимит limited-контракта; null для остальных повторов."
          },
          "cadence": {
            "type": "string",
            "nullable": true,
            "enum": [
              "daily",
              "weekly"
            ],
            "description": "Ритм челленджа; у контракта null."
          },
          "activeDays": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 127,
            "description": "Маска дней дневного челленджа: бит 0 — понедельник; по умолчанию пн–пт."
          },
          "needsConfirmation": {
            "type": "boolean",
            "description": "Нужна проверка заявки; по умолчанию true."
          },
          "rewardAchievementId": {
            "type": "string",
            "format": "uuid",
            "description": "Ачивка компании за зачёт; null снимает ссылку.",
            "nullable": true
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Момент архивирования; null — действующий шаблон."
          }
        },
        "required": [
          "id",
          "kind",
          "code",
          "title",
          "description",
          "points",
          "repeat",
          "maxCount",
          "cadence",
          "activeDays",
          "needsConfirmation",
          "rewardAchievementId",
          "archivedAt"
        ],
        "description": "Сохранённый шаблон каталога HR; ссылки — публичные id."
      },
      "GameContractTemplatesResponse": {
        "type": "object",
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameContractTemplate"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Курсор следующей страницы; null — конец списка."
          }
        },
        "required": [
          "templates",
          "nextCursor"
        ],
        "description": "Страница действующих шаблонов, новые сверху."
      },
      "GameSettings": {
        "type": "object",
        "properties": {
          "catalogOnly": {
            "type": "boolean",
            "description": "Строгий режим HR: руководитель собирает игры только из каталога."
          },
          "timeZone": {
            "type": "string",
            "description": "Пояс IANA, например Europe/Moscow. Неверная зона — time_zone_invalid."
          }
        },
        "required": [
          "catalogOnly",
          "timeZone"
        ],
        "description": "Собственные настройки игр текущего портала."
      },
      "ApplicationType": {
        "type": "string",
        "enum": [
          "unspecified",
          "employee",
          "recommendation",
          "external"
        ],
        "description": "Тип отклика независимо от источника; исторические недостоверные записи unspecified."
      },
      "EmployeeSubmittedSnapshot": {
        "type": "object",
        "required": [
          "lastName",
          "firstName",
          "middleName",
          "contactKind",
          "contactValue",
          "resumeUrl",
          "note"
        ],
        "properties": {
          "lastName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "middleName": {
            "type": "string"
          },
          "contactKind": {
            "$ref": "#/components/schemas/ContactKind"
          },
          "contactValue": {
            "type": "string"
          },
          "resumeUrl": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "SurveySelection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "anyone": {
            "type": "boolean"
          },
          "employees": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            },
            "maxItems": 1000
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            },
            "maxItems": 1000
          },
          "departmentHeads": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            },
            "maxItems": 1000
          },
          "newcomers": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "format": "int64"
            },
            "maxItems": 1000,
            "description": "Новички — номера пользователей Битрикс24, которых оформляют на работу и ещё не перевели в сотрудники. Бывают только в аудитории: непустой список у контролирующих — survey_invalid с controllers.newcomers. Поле необязательное: если его нет в запросе, сохранённый набор не меняется. В ответе поле есть, когда набор не пуст, и видно всем, кто видит опрос; отсутствие поля в ответе — пустой набор. Добавить номер, которого нет в сохранённом наборе (в том числе создать опрос с непустым набором), может только тот, у кого есть просмотр оформления на уровне «все»; ключу API для этого нужен ещё явный потолок. Иначе — 403 survey_newcomers_forbidden. Добавляемый номер должен быть новичком в момент сохранения, иначе — survey_invalid с audience.newcomers. Убрать номер или оставить набор как есть можно без этого права. Копия опроса переносит только тех, кто сейчас новичок, и только при этом праве, иначе набор копии пуст; отброшенные номера ошибки не дают."
          }
        },
        "required": [
          "anyone",
          "employees",
          "departments",
          "departmentHeads"
        ]
      },
      "SurveyNotificationSettings": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "remindersEnabled": {
            "type": "boolean"
          },
          "reminderDays": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "format": "int64",
              "maximum": 365
            },
            "maxItems": 366
          },
          "reminderTime": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$|^$"
          },
          "digestEnabled": {
            "type": "boolean"
          },
          "digestTime": {
            "type": "string",
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$|^$"
          }
        },
        "required": [
          "remindersEnabled",
          "reminderDays",
          "reminderTime",
          "digestEnabled",
          "digestTime"
        ]
      },
      "SurveySettings": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "timeZone": {
            "type": "string"
          },
          "audience": {
            "$ref": "#/components/schemas/SurveySelection"
          },
          "controllers": {
            "$ref": "#/components/schemas/SurveySelection"
          },
          "organizerResults": {
            "type": "boolean"
          },
          "analysisMode": {
            "type": "string",
            "enum": [
              "manual",
              "automatic"
            ]
          },
          "notifications": {
            "$ref": "#/components/schemas/SurveyNotificationSettings"
          }
        },
        "required": [
          "title",
          "description",
          "startsAt",
          "endsAt",
          "timeZone",
          "audience",
          "controllers",
          "organizerResults",
          "analysisMode",
          "notifications"
        ],
        "description": "analysisMode=manual по умолчанию; переключение режима не обрабатывает накопленные ответы."
      },
      "SurveySaveSurvey": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "settings": {
            "$ref": "#/components/schemas/SurveySettings"
          },
          "goal": {
            "type": "string"
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyCriterion"
            },
            "maxItems": 20
          },
          "reconfirmAutomatic": {
            "type": "boolean",
            "description": "Включить заново режим automatic, у которого нет инициатора (automaticNeedsConfirm в карточке): правящий проверяется, как при включении режима, и становится инициатором; отказ — survey_automatic_forbidden. Действует, только если режим automatic и до правки, и в settings, а инициатора нет. В остальных случаях ничего не меняет: принятого инициатора не подменяет, в том числе при повторе запроса. Без поля правка согласия не приписывает."
          },
          "norm": {
            "$ref": "#/components/schemas/SurveyNorm",
            "description": "Необязательное поле: отсутствие значит «не менять», null — 400 survey_norm_null. После запуска норма заморожена: присланная норма, отличная от действующей, — 409 survey_already_started."
          },
          "anonymous": {
            "type": "boolean",
            "description": "Необязательное поле: отсутствие значит «не менять». Включение признака сохраняет режим анализа manual, даже если в settings прислан automatic, и снимает инициатора автоматического режима. automatic при признаке, уже сохранённом включённым, — 422 survey_anonymous_automatic, и до запуска, и после. Выключение признака принимает любой режим. После запуска признак заморожен: значение, отличное от сохранённого, — 409 survey_already_started."
          }
        },
        "required": [
          "revision",
          "settings",
          "goal",
          "criteria"
        ]
      },
      "SurveyVisibility": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "manage": {
            "type": "boolean"
          },
          "results": {
            "type": "boolean",
            "description": "Ответы опроса открыты смотрящему правом «Ответы опросов с именами» (survey_answer · view): own — где он действующий контролирующий; all — ещё и в опросах, запущенных после обновления правил доступа к ответам. Только у запущенного опроса; под эмуляцией платформы — false. У анонимного опроса (anonymous) — доступ к его картине: ответов с именами у такого опроса нет ни у кого, а картину видит действующий контролирующий этого опроса с правом не ниже own; право all без назначения её не открывает. Подсказка интерфейсу; данные проверяет сервер."
          },
          "participant": {
            "type": "boolean"
          },
          "edit": {
            "type": "boolean",
            "description": "Разрешение редактирования именно этой строки с учётом OWN; не заменяет серверную проверку команды."
          },
          "runAI": {
            "type": "boolean",
            "description": "Можно запускать платный анализ и сводку ИИ по ответам этого опроса: ответы открыты (results) и смотрящий назначен в опросе контролирующим или правит его (survey · edit); ключу ещё нужна клетка survey · edit в потолке. Под эмуляцией платформы — false. У анонимного опроса — запуск сводки по его картине: картина открыта (results), ключу ещё нужна клетка survey · edit в потолке. Подсказка интерфейсу; команды проверяет сервер."
          }
        },
        "required": [
          "manage",
          "results",
          "participant",
          "edit",
          "runAI"
        ]
      },
      "SurveyResultsAudience": {
        "type": "object",
        "additionalProperties": false,
        "description": "Кто видит ответы опроса — для пояснения у замка ответов. Контролирующие из снимка запуска и коды системных ролей с уровнем «все» на ответы опросов (survey_answer · view). Роли перечисляются только у опроса, запущенного после обновления правил доступа к ответам; в опросах, запущенных раньше, ответы видят только их контролирующие, и список ролей пуст. Свои роли портала кода не имеют и не перечисляются. Пусто, когда ответы открыты (visibility.results = true).",
        "properties": {
          "controllers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyPerson"
            },
            "description": "Контролирующие из снимка запуска, в том числе те, кому ответы закрыты правами; у незапущенного опроса снимка нет и список пуст."
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Коды системных ролей портала (employee, manager, recruiter, hr, portal_admin), у которых на странице прав «Ответы опросов с именами» — «все». Роль в списке, даже если она никому не выдана."
          }
        },
        "required": [
          "controllers",
          "roles"
        ]
      },
      "SurveyProgress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "participants": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "unstarted": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "missing": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "available": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "submitted": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "drafts": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "У анонимного опроса всегда 0 — данных нет."
          },
          "pendingDelivery": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "sentDelivery": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "skippedDelivery": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "failedDelivery": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "analysisQueued": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "У анонимного опроса всегда 0 — данных нет."
          },
          "analysisReady": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "У анонимного опроса всегда 0 — данных нет."
          },
          "analysisFailed": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "У анонимного опроса всегда 0 — данных нет."
          }
        },
        "required": [
          "participants",
          "unstarted",
          "missing",
          "available",
          "submitted",
          "drafts",
          "pendingDelivery",
          "sentDelivery",
          "skippedDelivery",
          "failedDelivery",
          "analysisQueued",
          "analysisReady",
          "analysisFailed"
        ]
      },
      "SurveyAnswerPolicy": {
        "type": "string",
        "enum": [
          "controllers",
          "permissions"
        ],
        "description": "Обещание, под которым запущен опрос. controllers — прежнее: ответы видят только контролирующие этого опроса, если это разрешает их право на ответы. permissions — новое правило: ответы видят те же контролирующие и сотрудники с доступом к ответам всех опросов. Признак ставится при запуске и больше не меняется; пока опрос не запущен, значение — controllers."
      },
      "SurveyCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "creatorId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "id": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "formId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "state": {
            "type": "string"
          },
          "scheduled": {
            "type": "boolean"
          },
          "startError": {
            "type": "string",
            "description": "Код отказа запуска по плану: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_controllers_no_access — ни один контролирующий не получит доступа к ответам, survey_automatic_forbidden — у инициатора автоматического режима нет права запускать анализ или инициатора нет (automaticNeedsConfirm). Пустая строка — отказа нет. При отказе опрос снимается с плана."
          },
          "completionReason": {
            "type": "string"
          },
          "actualStartedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "settings": {
            "$ref": "#/components/schemas/SurveySettings"
          },
          "audienceSummary": {
            "$ref": "#/components/schemas/SurveyAudienceSummary",
            "description": "Кому направлен опрос, для показа: первые адресаты и число остальных. Строится из сохранённого выбора — settings.audience в карточке; имена и названия текущие из справочника портала."
          },
          "content": {
            "$ref": "#/components/schemas/SurveyContent"
          },
          "visibility": {
            "$ref": "#/components/schemas/SurveyVisibility"
          },
          "progress": {
            "$ref": "#/components/schemas/SurveyProgress"
          },
          "resultsAudience": {
            "$ref": "#/components/schemas/SurveyResultsAudience",
            "description": "Кто видит ответы опроса, для пояснения у замка ответов; отдаётся только тому, кто видит опрос. Пусто (оба списка — пустые массивы), когда ответы открыты: visibility.results = true, замка нет."
          },
          "automaticNeedsConfirm": {
            "type": "boolean",
            "description": "Режим анализа automatic без инициатора: новые задания автоматического анализа не ставятся, пока режим не включат заново: перевести в manual и обратно в automatic либо сохранить правку с reconfirmAutomatic. Черновик с таким режимом не запускается: ручной запуск отвечает 403 survey_automatic_forbidden, запуск по плану ставит startError survey_automatic_forbidden и снимает опрос с плана. Инициатор — тот, кто включил режим, сменил при нём контролирующих или скопировал опрос; его действующие права проверяются при запуске и перед каждой постановкой анализа."
          },
          "answerPolicy": {
            "$ref": "#/components/schemas/SurveyAnswerPolicy"
          },
          "norm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyNorm"
              },
              {
                "type": "null"
              }
            ],
            "description": "Действующая норма опроса. null — только у запущенного опроса без нормы: так остаются опросы, запущенные до её появления."
          },
          "anonymous": {
            "type": "boolean",
            "description": "Анонимный опрос: ответ хранится без связи с человеком, о респонденте известна только отметка «прошёл». Ставится при создании (поле anonymous тела или anonymousDefault анкеты) и правкой до запуска; копия опроса его переносит, «Обновить из анкеты» не меняет. После запуска заморожен. Режим анализа анонимного опроса всегда manual."
          },
          "smallGroupMin": {
            "type": "integer",
            "minimum": 1,
            "description": "Порог малой группы анонимного опроса: число ответов, с которого показываются картина и её разрезы. Одно значение для всех опросов; клиент берёт его отсюда, своей копии числа не держит."
          }
        },
        "required": [
          "creatorId",
          "id",
          "formId",
          "revision",
          "state",
          "scheduled",
          "startError",
          "completionReason",
          "actualStartedAt",
          "completedAt",
          "settings",
          "content",
          "visibility",
          "progress",
          "audienceSummary",
          "resultsAudience",
          "automaticNeedsConfirm",
          "answerPolicy",
          "norm",
          "anonymous",
          "smallGroupMin"
        ]
      },
      "SurveyAudienceSummary": {
        "type": "object",
        "additionalProperties": false,
        "description": "Кому направлен опрос, одной строкой: первые адресаты сохранённого выбора и число остальных.",
        "properties": {
          "anyone": {
            "type": "boolean",
            "description": "Выбран «Любой сотрудник»: он перекрывает выбор отделов, руководителей и сотрудников. В items остаются выбранные новички; more считает остальных новичков."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyAudienceItem"
            },
            "description": "Первые адресаты по порядку: отделы, руководители отделов, сотрудники, новички; внутри вида — по возрастанию номера. При anyone = true здесь только выбранные новички. Пустой массив — нет адресатов по имени."
          },
          "more": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько ещё адресатов в выборе, кроме items."
          }
        },
        "required": [
          "anyone",
          "items",
          "more"
        ]
      },
      "SurveyAudienceItem": {
        "type": "object",
        "additionalProperties": false,
        "description": "Адресат сводки аудитории.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "Имя поля выбора аудитории, из которого пришёл адресат: departments, departmentHeads, employees, newcomers. Список будет расти с новыми видами аудитории; незнакомый вид показывается именем адресата."
          },
          "id": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "Номер в Битрикс24: отдела для departments и departmentHeads, сотрудника для employees, новичка для newcomers."
          },
          "name": {
            "type": "string",
            "description": "Название отдела или «Фамилия Имя Отчество» сотрудника из справочника портала. У новичка — ФИО кандидата по учётке раннего пути. Пустая строка — имени или учётки нет, подпись выбирает клиент."
          }
        },
        "required": [
          "kind",
          "id",
          "name"
        ]
      },
      "SurveyRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "formId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "formTitle": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "title": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "scheduled": {
            "type": "boolean"
          },
          "startError": {
            "type": "string",
            "description": "Код отказа запуска по плану: survey_invalid, survey_audience_empty, survey_controllers_empty, survey_controllers_no_access — ни один контролирующий не получит доступа к ответам, survey_automatic_forbidden — у инициатора автоматического режима нет права запускать анализ или инициатора нет (automaticNeedsConfirm). Пустая строка — отказа нет. При отказе опрос снимается с плана."
          },
          "completionReason": {
            "type": "string"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "timeZone": {
            "type": "string"
          },
          "actualStartedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "creatorId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "creatorName": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "visibility": {
            "$ref": "#/components/schemas/SurveyVisibility"
          },
          "progress": {
            "$ref": "#/components/schemas/SurveyProgress"
          },
          "audienceSummary": {
            "$ref": "#/components/schemas/SurveyAudienceSummary",
            "description": "Кому направлен опрос, для показа: первые адресаты и число остальных. Строится из сохранённого выбора — settings.audience в карточке; имена и названия текущие из справочника портала."
          },
          "anonymous": {
            "type": "boolean",
            "description": "Анонимный опрос — то же, что anonymous в карточке опроса."
          }
        },
        "required": [
          "id",
          "formId",
          "formTitle",
          "revision",
          "title",
          "state",
          "scheduled",
          "startError",
          "completionReason",
          "startsAt",
          "endsAt",
          "timeZone",
          "actualStartedAt",
          "completedAt",
          "creatorId",
          "creatorName",
          "updatedAt",
          "visibility",
          "progress",
          "audienceSummary",
          "anonymous"
        ]
      },
      "SurveyPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "surveys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyRow"
            }
          },
          "nextCursor": {
            "type": "string"
          },
          "emptyReason": {
            "type": "string",
            "enum": [
              "",
              "no_access",
              "new_rule_only"
            ],
            "description": "Почему список пуст у того, кто опросы не ведёт: no_access — нет ни права вести опросы, ни доступа к ответам хоть одного опроса (раньше в этом случае был 403); new_rule_only — у смотрящего «все» на ответы опросов, но открыть пока нечего: «все» действует на опросы, запущенные после обновления правил доступа к ответам, а в прежних ответы видят только их контролирующие. Пустая строка — пояснения нет: страница непуста, смотрящий ведёт опросы или список опустошил отбор."
          }
        },
        "required": [
          "surveys",
          "nextCursor",
          "emptyReason"
        ]
      },
      "SurveyCounts": {
        "type": "object",
        "additionalProperties": false,
        "description": "Числа быстрых фильтров списка опросов в пределах видимости списка.",
        "properties": {
          "mine": {
            "type": "integer",
            "minimum": 0,
            "description": "Видимые опросы, где автор — смотрящий."
          },
          "running": {
            "type": "integer",
            "minimum": 0,
            "description": "Видимые идущие опросы (state=running)."
          }
        },
        "required": [
          "mine",
          "running"
        ]
      },
      "SurveyPerson": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "employeeId": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "departments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 1000
          },
          "available": {
            "type": "boolean"
          },
          "newcomerState": {
            "type": "string",
            "description": "Пометка новичка — кандидата на оформлении, ещё не сотрудника: newcomer — новичок; not_entered — новичок, ещё не входивший на портал; onboarding_closed — оформление закрыто: напоминания ему не идут, отправленные ответы остаются; пустая строка — сотрудник, в том числе переведённый из новичков. Заполняется в списке участников опроса, в остальных ответах — пустая строка. Строка, а не перечисление: незнакомое значение клиент показывает без пометки."
          }
        },
        "required": [
          "employeeId",
          "name",
          "departments",
          "available",
          "newcomerState"
        ]
      },
      "SurveyValue": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 10000
              }
            },
            "required": [
              "text"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "number": {
                "type": "number"
              }
            },
            "required": [
              "number"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "bool": {
                "type": "boolean"
              }
            },
            "required": [
              "bool"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "options": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "maxItems": 100
              }
            },
            "required": [
              "options"
            ]
          }
        ],
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 10000
          },
          "number": {
            "type": "number"
          },
          "bool": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100
          }
        }
      },
      "SurveyParticipantRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "person": {
            "$ref": "#/components/schemas/SurveyPerson"
          },
          "progress": {
            "type": "string",
            "description": "Прогресс участника: submitted — ответ отправлен, draft — есть черновик, not_started — не начинал, hidden — опрос анонимный: отметка о прохождении в списке не показывается, значение у всех участников одно, answerId — пустая строка, submittedVersion — 0."
          },
          "answerId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "submittedVersion": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          }
        },
        "required": [
          "person",
          "progress",
          "answerId",
          "submittedVersion"
        ]
      },
      "SurveyParticipantPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyParticipantRow"
            }
          },
          "progress": {
            "$ref": "#/components/schemas/SurveyProgress"
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "participants",
          "progress",
          "nextCursor"
        ]
      },
      "SurveyAnswerRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "person": {
            "$ref": "#/components/schemas/SurveyPerson"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "overall": {
            "type": "string"
          },
          "analysisState": {
            "type": "string"
          },
          "signalId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "analysisError": {
            "type": "string"
          },
          "criteria": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/SurveyCriterionGrade"
            }
          },
          "signalState": {
            "type": "string",
            "enum": [
              "",
              "new",
              "in_progress",
              "processed"
            ]
          },
          "normStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyNormStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Статус текущей версии ответа; null — статуса нет."
          },
          "redFlags": {
            "type": "integer",
            "minimum": 0,
            "description": "Число красных флагов текущей версии ответа."
          }
        },
        "required": [
          "id",
          "person",
          "submittedAt",
          "version",
          "overall",
          "analysisState",
          "signalId",
          "analysisError",
          "criteria",
          "signalState",
          "normStatus",
          "redFlags"
        ]
      },
      "SurveyAnswerPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "answers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyAnswerRow"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "answers",
          "nextCursor"
        ]
      },
      "SurveyControllerAnswer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "person": {
            "$ref": "#/components/schemas/SurveyPerson"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "overall": {
            "type": "string"
          },
          "analysisState": {
            "type": "string"
          },
          "signalId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "values": {
            "$ref": "#/components/schemas/SurveyValues"
          },
          "currentAnalysis": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SurveyAnalysisResult"
              }
            ],
            "nullable": true
          },
          "analysisError": {
            "type": "string"
          },
          "signalReason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SurveySignalReason"
              }
            ],
            "nullable": true
          },
          "criteria": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/SurveyCriterionGrade"
            }
          },
          "signalState": {
            "type": "string",
            "enum": [
              "",
              "new",
              "in_progress",
              "processed"
            ]
          },
          "previousAnalysis": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SurveyAnalysisResult"
              }
            ],
            "nullable": true
          },
          "normStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyNormStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Статус текущей версии ответа; null — статуса нет."
          },
          "redFlags": {
            "type": "integer",
            "minimum": 0,
            "description": "Число красных флагов текущей версии ответа."
          },
          "norm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyAnswerNorm"
              },
              {
                "type": "null"
              }
            ],
            "description": "Блок «По норме»; null у опроса без нормы, с выключенной нормой и без шкальных вопросов."
          }
        },
        "required": [
          "id",
          "person",
          "submittedAt",
          "version",
          "overall",
          "analysisState",
          "signalId",
          "values",
          "currentAnalysis",
          "analysisError",
          "signalReason",
          "criteria",
          "signalState",
          "previousAnalysis",
          "normStatus",
          "redFlags",
          "norm"
        ]
      },
      "SurveyPreflight": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "questionsValid": {
            "type": "boolean"
          },
          "audienceCount": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "controllerCount": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "noAccessControllers": {
            "type": "array",
            "maxItems": 20,
            "description": "Контролирующие выбора, у которых по текущим правам нет доступа к ответам опроса (survey_answer · view ниже own), — в том числе не входившие в HRM: их уровень считается по выдачам Битрикс24. Держатели доступа ко всем ответам вне контролирующих в счёт не идут. Список называет не больше maxItems человек, первых по имени; сколько их всего — noAccessControllerCount. Когда доступа нет ни у одного контролирующего, errors несёт поле controllers с кодом no_access, а запуск отказывает survey_controllers_no_access.",
            "items": {
              "$ref": "#/components/schemas/SurveyPerson"
            }
          },
          "noAccessControllerCount": {
            "type": "integer",
            "minimum": 0,
            "format": "int64",
            "description": "Сколько всего контролирующих без доступа к ответам опроса; noAccessControllers называет из них первых по имени."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "timeZone": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFieldError"
            }
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Текущая ревизия опроса, на которой выполнена проверка."
          }
        },
        "required": [
          "questionsValid",
          "audienceCount",
          "controllerCount",
          "noAccessControllers",
          "noAccessControllerCount",
          "startsAt",
          "endsAt",
          "timeZone",
          "errors",
          "revision"
        ]
      },
      "SurveyEvidence": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "questionKey": {
            "type": "string"
          },
          "quote": {
            "type": "string"
          },
          "value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SurveyValue"
              }
            ],
            "nullable": true
          }
        },
        "required": [
          "questionKey",
          "quote",
          "value"
        ]
      },
      "SurveyAssessment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "criterionKey": {
            "type": "string"
          },
          "categoryKey": {
            "type": "string"
          },
          "insufficient": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyEvidence"
            }
          }
        },
        "required": [
          "criterionKey",
          "categoryKey",
          "insufficient",
          "reason",
          "evidence"
        ]
      },
      "SurveyInsight": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string"
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyEvidence"
            }
          }
        },
        "required": [
          "text",
          "evidence"
        ]
      },
      "SurveyAnalysisResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "answerId": {
            "type": "string",
            "description": "Публичный UUID; пустая строка если сущности нет."
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "overall": {
            "type": "string"
          },
          "importance": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyEvidence"
            }
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyAssessment"
            },
            "maxItems": 20
          },
          "insights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyInsight"
            }
          }
        },
        "required": [
          "answerId",
          "version",
          "generation",
          "overall",
          "importance",
          "reason",
          "evidence",
          "criteria",
          "insights"
        ]
      },
      "SurveyValues": {
        "type": "object",
        "maxProperties": 100,
        "additionalProperties": {
          "$ref": "#/components/schemas/SurveyValue"
        }
      },
      "SurveyCreateSurvey": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "formId": {
            "type": "string",
            "format": "uuid"
          },
          "settings": {
            "$ref": "#/components/schemas/SurveySettings"
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "anonymous": {
            "type": "boolean",
            "description": "Необязательное поле: без него признак берётся из anonymousDefault анкеты. Итоговый признак сохраняет режим анализа manual, даже если в settings прислан automatic, и инициатора автоматического режима не записывает. Признак входит в команду: повтор commandKey с другим anonymous — 409 survey_command_conflict."
          }
        },
        "required": [
          "formId",
          "settings",
          "commandKey"
        ]
      },
      "SurveyRunCommand": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "commandKey"
        ]
      },
      "SurveyRefreshForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "formId": {
            "type": "string",
            "format": "uuid"
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "formId",
          "commandKey"
        ]
      },
      "SurveyFrozenDepartment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "SurveyDepartmentPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFrozenDepartment"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "departments",
          "nextCursor"
        ]
      },
      "SurveyDeliveryCounts": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "waiting": {
            "type": "integer",
            "minimum": 0
          },
          "sent": {
            "type": "integer",
            "minimum": 0
          },
          "skipped": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "waiting",
          "sent",
          "skipped",
          "error"
        ]
      },
      "SurveyDeliveryReason": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 64
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "initiators": {
            "type": "array",
            "maxItems": 5,
            "description": "Кто пригласил новичков, у которых строка доставки получила эту причину: до пяти человек по числу новичков. Заполняется только у кодов newcomer_chat_initiator_login, newcomer_chat_initiator_archived и newcomer_chat_initiator_rights и только тому, кто может править опрос (survey · edit; ключу — с правкой опроса в его матрице); у прочих кодов, прочих читателей и анонимного опроса — пустой массив.",
            "items": {
              "$ref": "#/components/schemas/SurveyDeliveryInitiator"
            }
          },
          "initiatorsMore": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько ещё пригласивших с этой причиной не вошли в initiators."
          }
        },
        "required": [
          "code",
          "count",
          "initiators",
          "initiatorsMore"
        ]
      },
      "SurveyDeliveryInitiator": {
        "type": "object",
        "additionalProperties": false,
        "description": "Пригласивший новичков: человек HRM, чьим ключом шла попытка доставки и пойдёт повтор.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 302
          },
          "archived": {
            "type": "boolean",
            "description": "Пригласивший в архиве."
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "description": "Новичков с этой причиной, которых он пригласил."
          }
        },
        "required": [
          "id",
          "name",
          "archived",
          "count"
        ]
      },
      "SurveyDeliveryCampaign": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "kind": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "counts": {
            "$ref": "#/components/schemas/SurveyDeliveryCounts"
          },
          "reasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyDeliveryReason"
            }
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "kind",
          "createdAt",
          "counts",
          "reasons",
          "retryable"
        ]
      },
      "SurveyDeliveryPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyDeliveryCampaign"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "campaigns",
          "nextCursor"
        ]
      },
      "SurveyRemind": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "maxItems": 100
          },
          "allPending": {
            "type": "boolean"
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "employeeIds",
          "allPending",
          "commandKey"
        ],
        "description": "allPending=true requires an empty employeeIds list; false requires 1–100 fixed participant B24 IDs. No answer contents."
      },
      "SurveyRemindResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "campaignId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "counts": {
            "$ref": "#/components/schemas/SurveyDeliveryCounts"
          }
        },
        "required": [
          "campaignId",
          "counts"
        ]
      },
      "SurveyDeliveryRetry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "campaignId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "campaignId",
          "commandKey"
        ]
      },
      "SurveyAnalyze": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "answerIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "force": {
            "type": "boolean"
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "answerIds",
          "force",
          "commandKey"
        ]
      },
      "SurveyAnalyzeAck": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "accepted"
        ]
      },
      "SurveyAnalysisPart": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 1,
            "maximum": 32000
          },
          "supporting": {
            "type": "boolean"
          },
          "result": {
            "$ref": "#/components/schemas/SurveyAnalysisResult"
          }
        },
        "required": [
          "index",
          "supporting",
          "result"
        ]
      },
      "SurveyAnalysisPartsPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "generation": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "parts": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/SurveyAnalysisPart"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "generation",
          "parts",
          "nextCursor"
        ]
      },
      "SurveySignalNormReason": {
        "type": "object",
        "additionalProperties": false,
        "description": "Причина сигнала «норма»: текущая версия ответа хуже нормы опроса.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "below",
              "critical"
            ],
            "description": "below — ниже нормы, critical — критично."
          },
          "redFlags": {
            "type": "integer",
            "minimum": 0,
            "description": "Число красных флагов текущей версии ответа."
          }
        },
        "required": [
          "status",
          "redFlags"
        ]
      },
      "SurveySignalReason": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "new",
              "in_progress",
              "processed"
            ]
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "minimum": 0,
            "format": "int64"
          },
          "needsAttention": {
            "type": "boolean"
          },
          "newData": {
            "type": "boolean"
          },
          "stale": {
            "type": "boolean"
          },
          "analysis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyAnalysisResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Опубликованный анализ; null, пока у сигнала его нет: ручной сигнал или сигнал по норме до первой публикации."
          },
          "manualReasons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySignalManualReason"
            },
            "description": "Ручные причины; действуют, пока существует сигнал, анализ их не снимает."
          },
          "norm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveySignalNormReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина «норма» текущей версии ответа; null — версия в норме или статуса нет."
          }
        },
        "required": [
          "id",
          "state",
          "importance",
          "version",
          "generation",
          "needsAttention",
          "newData",
          "stale",
          "analysis",
          "manualReasons",
          "norm"
        ]
      },
      "SurveySignalCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "surveyId": {
            "type": "string",
            "format": "uuid"
          },
          "surveyTitle": {
            "type": "string"
          },
          "answerId": {
            "type": "string",
            "pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$",
            "description": "Публичный UUID ответа; пустая строка, если сотрудник ещё не отвечал (ручной сигнал)."
          },
          "person": {
            "$ref": "#/components/schemas/SurveyPerson"
          },
          "state": {
            "type": "string",
            "enum": [
              "new",
              "in_progress",
              "processed"
            ]
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "assignee": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          },
          "needsAttention": {
            "type": "boolean"
          },
          "reasonsStale": {
            "type": "boolean"
          },
          "newData": {
            "type": "boolean"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "",
              "resolved",
              "not_needed",
              "unresolved"
            ]
          },
          "resolution": {
            "type": "string",
            "maxLength": 10000
          },
          "signalReason": {
            "$ref": "#/components/schemas/SurveySignalReason"
          },
          "currentAnalysis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyAnalysisResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "allowedActions": {
            "type": "array",
            "maxItems": 7,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "claim",
                "assign",
                "comment",
                "set_due",
                "update_work",
                "resolve",
                "reopen"
              ]
            }
          },
          "source": {
            "type": "string",
            "enum": [
              "ai",
              "manual"
            ],
            "description": "Кто создал сигнал: ai — система, по выводу ИИ или по норме; manual — человек. Что именно говорит сигнал, показывают причины в signalReason."
          }
        },
        "required": [
          "id",
          "surveyId",
          "surveyTitle",
          "answerId",
          "person",
          "state",
          "revision",
          "assignee",
          "dueAt",
          "importance",
          "needsAttention",
          "reasonsStale",
          "newData",
          "outcome",
          "resolution",
          "signalReason",
          "currentAnalysis",
          "createdAt",
          "updatedAt",
          "allowedActions",
          "source"
        ]
      },
      "SurveySignalPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySignalCard"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "signals",
          "nextCursor"
        ]
      },
      "SurveySignalCounts": {
        "type": "object",
        "additionalProperties": false,
        "description": "Числа быстрых фильтров списка сигналов в пределах видимости списка.",
        "properties": {
          "mine": {
            "type": "integer",
            "minimum": 0,
            "description": "Доступные сигналы, где ответственный — смотрящий."
          },
          "new": {
            "type": "integer",
            "minimum": 0,
            "description": "Доступные новые сигналы (state=new), ждущие разбора."
          }
        },
        "required": [
          "mine",
          "new"
        ]
      },
      "SurveySignalAssigneePage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyPerson"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "people",
          "nextCursor"
        ]
      },
      "SurveySignalAction": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "claim",
              "assign",
              "comment",
              "set_due",
              "update_work",
              "resolve",
              "reopen"
            ]
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "assignee": {
            "anyOf": [
              {
                "type": "integer",
                "format": "int64",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Сотрудник Битрикс24 — действующий контролирующий опроса с доступом к ответам по текущим правам (survey_answer · view не ниже own). null — только у update_work: снять ответственного; отсутствие ключа — оставить прежнего."
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок разбора. У set_due и update_work null снимает срок; у update_work отсутствие ключа оставляет срок прежним."
          },
          "comment": {
            "type": "string",
            "maxLength": 10000
          },
          "outcome": {
            "type": "string",
            "enum": [
              "resolved",
              "not_needed",
              "unresolved"
            ]
          }
        },
        "required": [
          "action",
          "revision",
          "commandKey"
        ]
      },
      "SurveySignalComment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "comment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "comment",
          "commandKey"
        ]
      },
      "SurveySummaryCommand": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "commandKey"
        ]
      },
      "SurveySummaryRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "generation": {
            "type": "integer",
            "minimum": 0
          },
          "responses": {
            "type": "integer",
            "minimum": 0
          },
          "needsAnalysis": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "generation",
          "responses",
          "needsAnalysis"
        ]
      },
      "SurveySummarySource": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contribution": {
            "type": "string"
          },
          "answerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "evidence": {
            "$ref": "#/components/schemas/SurveyEvidence"
          }
        },
        "required": [
          "contribution",
          "answerId",
          "version",
          "evidence"
        ]
      },
      "SurveySummaryInsight": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySummarySource"
            }
          },
          "quotes": {
            "type": "array",
            "description": "Цитаты пункта у сводки анонимного опроса; у неё sources — пустой массив. У именной сводки поля нет.",
            "items": {
              "$ref": "#/components/schemas/SurveySummaryQuote"
            }
          }
        },
        "required": [
          "text",
          "sources"
        ]
      },
      "SurveySummaryStats": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "participants": {
            "type": "integer",
            "minimum": 0
          },
          "submitted": {
            "type": "integer",
            "minimum": 0
          },
          "analyzed": {
            "type": "integer",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "integer",
            "minimum": 0
          },
          "insufficient": {
            "type": "integer",
            "minimum": 0
          },
          "overall": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          },
          "criteria": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "required": [
          "participants",
          "submitted",
          "analyzed",
          "pending",
          "errors",
          "insufficient",
          "overall",
          "criteria"
        ]
      },
      "SurveySummaryCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "generation": {
            "type": "integer",
            "minimum": 0
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "queued",
              "building",
              "waiting_limit",
              "ready",
              "error"
            ]
          },
          "stale": {
            "type": "boolean"
          },
          "partial": {
            "type": "boolean"
          },
          "stats": {
            "$ref": "#/components/schemas/SurveySummaryStats"
          },
          "themes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySummaryInsight"
            }
          },
          "insights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySummaryInsight"
            }
          },
          "recommendations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySummaryInsight"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "latestAttempt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveySummaryAttempt"
              },
              {
                "type": "null"
              }
            ]
          },
          "explanation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveySummaryExplanation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Объяснение чисел BitrixGPT; null — у этой публикации его нет: сводка неполная или собрана раньше объяснений."
          }
        },
        "required": [
          "generation",
          "state",
          "stale",
          "partial",
          "stats",
          "themes",
          "insights",
          "recommendations",
          "createdAt",
          "latestAttempt",
          "explanation"
        ]
      },
      "SurveySummaryExplanation": {
        "type": "object",
        "additionalProperties": false,
        "description": "Объяснение чисел полной сводки от BitrixGPT: как читать результаты и что делать дальше. state: building — строится, waiting_limit — ждёт лимита BitrixGPT, failed — не удалось, ready — готово. Пункты есть только у ready; если пуст один раздел, второй всё равно показывается.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "building",
              "waiting_limit",
              "failed",
              "ready"
            ]
          },
          "reading": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/SurveyExplanationItem"
            },
            "description": "Как читать результаты."
          },
          "nextSteps": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/SurveyExplanationItem"
            },
            "description": "Что делать дальше."
          },
          "recommendationsCut": {
            "type": "boolean",
            "description": "Рекомендации сводки не вошли в объяснение, и их показывают отдельным списком."
          }
        },
        "required": [
          "state",
          "reading",
          "nextSteps",
          "recommendationsCut"
        ]
      },
      "SurveyExplanationItem": {
        "type": "object",
        "additionalProperties": false,
        "description": "Пункт объяснения. Числа к тексту — в refs: сам текст цифр не содержит, кроме дословных цитат из тем сводки.",
        "properties": {
          "text": {
            "type": "string"
          },
          "refs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyMetricRef"
            }
          },
          "themes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Номера тем сводки с нуля, из которых следует шаг. Поля нет, если тем нет."
          }
        },
        "required": [
          "text",
          "refs"
        ]
      },
      "SurveyMetricRef": {
        "type": "object",
        "additionalProperties": false,
        "description": "Метрика чисел опроса, на которую опирается пункт, и её значение.",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "survey",
              "block",
              "question"
            ]
          },
          "key": {
            "type": "string",
            "description": "У вопроса — ключ вопроса, у блока — его номер в порядке первого появления, у опроса — пустая строка."
          },
          "metric": {
            "type": "string",
            "enum": [
              "mean",
              "status",
              "statuses",
              "enpsIndex",
              "promoters",
              "critics",
              "share",
              "redFlags",
              "answered"
            ],
            "description": "statuses — сколько ответов в норме, ниже нормы и критично; share — доля варианта; enpsIndex, promoters и critics — у вопроса eNPS."
          },
          "option": {
            "type": "string",
            "description": "Ключ варианта у share; norm, below или critical у statuses. У остальных метрик поля нет."
          },
          "scale": {
            "type": "string",
            "description": "Шкала min..max у среднего блока и опроса и у статуса одной шкалы. Статус блока или опроса без шкалы — общий."
          },
          "value": {
            "$ref": "#/components/schemas/SurveyMetricValue"
          }
        },
        "required": [
          "scope",
          "key",
          "metric"
        ]
      },
      "SurveyMetricValue": {
        "type": "object",
        "additionalProperties": false,
        "description": "Значение метрики из снимка чисел, по которому писали объяснение. Средний — с одним знаком после запятой, остальные числа целые; promoters и critics — в процентах.",
        "properties": {
          "number": {
            "type": "number"
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          },
          "of": {
            "type": "integer",
            "minimum": 1,
            "description": "Знаменатель у доли варианта, распределения статусов и флагов. У остальных метрик поля нет."
          }
        },
        "required": []
      },
      "SurveyCriterionGrade": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "criterionKey": {
            "type": "string"
          },
          "categoryKey": {
            "type": "string"
          },
          "insufficient": {
            "type": "boolean"
          }
        },
        "required": [
          "criterionKey",
          "categoryKey",
          "insufficient"
        ]
      },
      "SurveySignalFilterOption": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "employeeId": {
            "type": "integer",
            "minimum": 1,
            "format": "int64"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "employeeId",
          "name"
        ]
      },
      "SurveySignalSurveyOption": {
        "type": "object",
        "additionalProperties": false,
        "description": "Вариант оси «Опрос» отбора сигналов: запущенный опрос, сигналы которого смотрящий читает.",
        "properties": {
          "surveyId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "surveyId",
          "title"
        ]
      },
      "SurveySignalFilterPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveySignalFilterOption"
            },
            "maxItems": 100
          },
          "surveys": {
            "type": "array",
            "description": "Варианты оси «Опрос» (kind=survey); у осей людей пуст.",
            "items": {
              "$ref": "#/components/schemas/SurveySignalSurveyOption"
            },
            "maxItems": 100
          },
          "selected": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveySignalFilterOption"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "people",
          "surveys",
          "selected",
          "nextCursor"
        ]
      },
      "InterviewDelivery": {
        "type": "object",
        "required": [
          "state",
          "sentCount"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "sent",
              "delivered",
              "rejected",
              "failed"
            ],
            "description": "Исход последней отправки. delivered сегодня недостижимо: отчётов провайдера нет."
          },
          "reason": {
            "type": "string",
            "enum": [
              "rejected",
              "quota",
              "unavailable",
              "not_configured",
              "unroutable",
              "invite_gone",
              "superseded",
              "internal",
              "outcome_unknown",
              "recipient_blocked",
              "recipient_gone",
              "unknown"
            ],
            "description": "Наш код отказа. Текст провайдера наружу не уходит никогда. superseded — ссылку в письме погасила более новая отправка; обычно письмо так и не ушло, но строку, погашенную пока письмо было у релея, он всё-таки отправит — со ссылкой, которая уже мертва. Этот код объявлен, но сегодня НЕ ПРИХОДИТ: ручка отдаёт самую новую строку очереди приглашения, а гашение идёт в одной транзакции со вставкой новой, поэтому погашенная строка всегда перекрыта. Объявлен, чтобы читающий очередь понимал строку, — то же соглашение, что у state=delivered."
          },
          "sentAt": {
            "type": "string",
            "format": "date-time"
          },
          "queuedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда письмо поставлено в очередь. Отдельно от sentAt: у письма в очереди времени отправки ещё нет, а пауза между отправками одного приглашения считается именно от постановки. Срок паузы приходит полем resendPauseSec ответа готовности раздела — своей копии клиент не держит."
          },
          "sentCount": {
            "type": "integer",
            "description": "Счёт инициированных или возможно исполненных попыток отправки приглашения, а не подтверждённых доставок. Включает погашенные отправки (superseded) и неизвестный исход (unknown); доказанно неисполненные failed не считаются. Потолок приходит полем resendMax ответа готовности раздела, своей копии клиент не держит.\n\nСчёт queued/sent/rejected и failed superseded/outcome_unknown; неизвестный исход расходует предел и сохраняется после подтверждённого повтора."
          },
          "channel": {
            "type": "string",
            "enum": [
              "telegram",
              "email",
              "sms"
            ],
            "description": "Канал последней отправки приглашения."
          },
          "possibleDuplicate": {
            "type": "boolean",
            "description": "Прошлый запрос мог быть принят Telegram; новый повтор требует явного подтверждения."
          },
          "resendBlockedUntil": {
            "type": "string",
            "format": "date-time",
            "description": "До конца активной dispatch lease повтор запрещён даже с подтверждением."
          }
        }
      },
      "SurveySummaryPreflight": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ready": {
            "type": "integer",
            "minimum": 0
          },
          "new": {
            "type": "integer",
            "minimum": 0
          },
          "stale": {
            "type": "integer",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "ready",
          "new",
          "stale",
          "pending",
          "errors"
        ]
      },
      "SurveySummaryAttempt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "generation": {
            "type": "integer",
            "minimum": 0
          },
          "state": {
            "type": "string",
            "enum": [
              "none",
              "queued",
              "building",
              "waiting_limit",
              "ready",
              "error"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "generation",
          "state",
          "createdAt"
        ]
      },
      "SurveyFilterDepartmentPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFrozenDepartment"
            }
          },
          "nextCursor": {
            "type": "string"
          },
          "selected": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyFrozenDepartment"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "departments",
          "nextCursor",
          "selected"
        ]
      },
      "FeatureFlagResolveResponse": {
        "type": "object",
        "required": [
          "flags"
        ],
        "properties": {
          "flags": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "telegramScenariosVersion": {
            "$ref": "#/components/schemas/TelegramScenariosVersion"
          }
        }
      },
      "EmployeeProcessApplicability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "company",
          "departments"
        ],
        "properties": {
          "company": {
            "type": "boolean"
          },
          "departments": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessRequirements": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rating",
          "ratingRequired",
          "commentRequired",
          "question",
          "scale",
          "metricKey"
        ],
        "properties": {
          "rating": {
            "type": "boolean"
          },
          "ratingRequired": {
            "type": "boolean"
          },
          "commentRequired": {
            "type": "boolean"
          },
          "question": {
            "type": "string",
            "maxLength": 1024
          },
          "scale": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 255
                },
                "maxItems": 5
              },
              {
                "type": "null"
              }
            ]
          },
          "metricKey": {
            "type": "string",
            "maxLength": 128
          }
        }
      },
      "EmployeeProcessItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "title",
          "instruction",
          "group",
          "assigneeRole",
          "controllerRole",
          "assigneeId",
          "controllerId",
          "offsetDays",
          "durationDays",
          "delayDays",
          "predecessor",
          "workingDays",
          "requirements",
          "stageKey"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "instruction": {
            "type": "string",
            "maxLength": 16000
          },
          "group": {
            "type": "string",
            "maxLength": 255,
            "deprecated": true,
            "description": "Устаревшее поле: заменено стадиями. Сервер хранит и возвращает значение как получил; в стадии оно не превращается."
          },
          "assigneeRole": {
            "type": "string",
            "maxLength": 64
          },
          "controllerRole": {
            "type": "string",
            "maxLength": 64
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "offsetDays": {
            "type": "integer",
            "minimum": -3650,
            "maximum": 3650
          },
          "durationDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "delayDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "predecessor": {
            "type": "string",
            "maxLength": 128
          },
          "workingDays": {
            "type": "boolean"
          },
          "requirements": {
            "$ref": "#/components/schemas/EmployeeProcessRequirements"
          },
          "stageKey": {
            "type": "string",
            "maxLength": 64,
            "description": "Ключ стадии пункта из stages; пустая строка — стадия «Новый»."
          }
        }
      },
      "EmployeeProcessPerson": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessTemplate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "state",
          "revision",
          "key",
          "title",
          "description",
          "scenario",
          "applicability",
          "items",
          "stages",
          "retiredStages"
        ],
        "properties": {
          "people": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "archived"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 16000
          },
          "scenario": {
            "type": "string",
            "enum": [
              "onboarding",
              "offboarding",
              "mentoring",
              "transfer",
              "development",
              "return",
              "other"
            ]
          },
          "applicability": {
            "$ref": "#/components/schemas/EmployeeProcessApplicability"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessItem"
            },
            "maxItems": 500
          },
          "stages": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessStage"
            }
          },
          "retiredStages": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRetiredStage"
            },
            "description": "Следы удалённых стадий; только для чтения."
          }
        }
      },
      "EmployeeProcessStarter": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "title",
          "description",
          "scenario",
          "applicability",
          "items",
          "stages"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 16000
          },
          "scenario": {
            "type": "string",
            "enum": [
              "onboarding",
              "offboarding",
              "mentoring",
              "transfer",
              "development",
              "return",
              "other"
            ]
          },
          "applicability": {
            "$ref": "#/components/schemas/EmployeeProcessApplicability"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessItem"
            },
            "maxItems": 500
          },
          "stages": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessStage"
            },
            "description": "Стадии заготовки между «Новым» и «Завершено»; пункты ссылаются на них по stageKey."
          }
        }
      },
      "EmployeeProcessTemplateSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "key",
          "title",
          "scenario",
          "state",
          "revision",
          "applicability",
          "itemCount",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "scenario": {
            "type": "string",
            "enum": [
              "onboarding",
              "offboarding",
              "mentoring",
              "transfer",
              "development",
              "return",
              "other"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "archived"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "applicability": {
            "$ref": "#/components/schemas/EmployeeProcessApplicability"
          },
          "itemCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Дата последнего сохранённого изменения шаблона; null, если исторический снимок её не содержит."
          }
        }
      },
      "EmployeeProcessTemplateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "title"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "archived"
            ]
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "key": {
            "type": "string",
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": "string",
            "maxLength": 16000
          },
          "scenario": {
            "type": "string",
            "enum": [
              "onboarding",
              "offboarding",
              "mentoring",
              "transfer",
              "development",
              "return",
              "other"
            ]
          },
          "applicability": {
            "$ref": "#/components/schemas/EmployeeProcessApplicabilityInput"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessTemplateItemInput"
            },
            "maxItems": 500
          },
          "stages": {
            "anyOf": [
              {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "$ref": "#/components/schemas/EmployeeProcessStageInput"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Необязательно. Отсутствует или null — сервер сохраняет стадии прежней редакции; [] — стадий нет."
          },
          "retiredStages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRetiredStage"
            },
            "description": "Принимается и игнорируется: следы вычисляет сервер."
          }
        }
      },
      "EmployeeProcessTemplateList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessTemplateSummary"
            },
            "maxItems": 100
          },
          "next": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessLibraryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessStarter"
            },
            "maxItems": 7
          }
        }
      },
      "EmployeeProcessRole": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "defaultUserId",
          "archived",
          "builtin",
          "revision"
        ],
        "properties": {
          "defaultUser": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "key": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "defaultUserId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "builtin": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "defaultUserId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessRoleList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRole"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone",
          "revision"
        ],
        "properties": {
          "zone": {
            "type": "string",
            "maxLength": 128
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessSettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone",
          "expectedRevision"
        ],
        "properties": {
          "zone": {
            "type": "string",
            "maxLength": 128
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessItemInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "instruction": {
            "type": "string",
            "maxLength": 16000
          },
          "group": {
            "type": "string",
            "maxLength": 255,
            "deprecated": true,
            "description": "Устаревшее поле: заменено стадиями. Сервер хранит и возвращает значение как получил; в стадии оно не превращается."
          },
          "assigneeRole": {
            "type": "string",
            "maxLength": 64
          },
          "controllerRole": {
            "type": "string",
            "maxLength": 64
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "offsetDays": {
            "type": "integer",
            "minimum": -3650,
            "maximum": 3650
          },
          "durationDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "delayDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "predecessor": {
            "type": "string",
            "maxLength": 128
          },
          "workingDays": {
            "type": "boolean"
          },
          "requirements": {
            "$ref": "#/components/schemas/EmployeeProcessRequirementsInput"
          },
          "stageKey": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Стадия нового пункта: ключ из stages копии процесса (management-context), пустая строка — «Новый». Пункт встаёт следом за последним заданием стадии, в пустой стадии — перед первым заданием следующей стадии с заданиями, иначе в конец. Предшественник должен стоять в той же или более ранней стадии, если копия не сохранена запросом без стадий. Отсутствует или null — пункт дописывается в конец со стадией последнего задания процесса, как до появления стадий. Неизвестный ключ — validation_failed с полем item.stageKey."
          }
        }
      },
      "EmployeeProcessRequirementsInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "rating": {
            "type": "boolean"
          },
          "ratingRequired": {
            "type": "boolean"
          },
          "commentRequired": {
            "type": "boolean"
          },
          "question": {
            "type": "string",
            "maxLength": 1024
          },
          "scale": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 255
                },
                "maxItems": 5
              },
              {
                "type": "null"
              }
            ]
          },
          "metricKey": {
            "type": "string",
            "maxLength": 128
          }
        }
      },
      "EmployeeProcessApplicabilityInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "company": {
            "type": "boolean"
          },
          "departments": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "total",
          "completed",
          "skipped",
          "cancelled",
          "cancelledProcesses",
          "percent"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "completed": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "cancelled": {
            "type": "integer"
          },
          "cancelledProcesses": {
            "type": "integer"
          },
          "percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "employeeId",
          "coordinatorId",
          "authorId",
          "title",
          "scenario",
          "anchor",
          "revision",
          "state",
          "canManage",
          "summary",
          "employeeName",
          "coordinatorName",
          "departments",
          "problems"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "employeeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "coordinatorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "canManage": {
            "type": "boolean"
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "settings": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeSettings"
          },
          "employeeName": {
            "type": "string"
          },
          "coordinatorName": {
            "type": "string"
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessDepartment"
            }
          },
          "problems": {
            "type": "integer",
            "minimum": 0
          },
          "participants": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeParticipants",
            "description": "Referenced current public names and role labels from this authorized runtime snapshot. Full meta detail and bounded instance pages include this optional projection. No directory defaults or private hire/result data."
          }
        }
      },
      "EmployeeProcessInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "templateId",
          "title",
          "revision",
          "state",
          "summary",
          "templateRevision",
          "controllerId",
          "roles"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "templateRevision": {
            "type": "integer",
            "minimum": 1
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "participants": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeParticipants",
            "description": "Referenced current public names and role labels from this authorized runtime snapshot. Full meta detail and bounded instance pages include this optional projection. No directory defaults or private hire/result data."
          }
        }
      },
      "EmployeeProcessTaskSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "metaId",
          "processId",
          "title",
          "metaTitle",
          "processTitle",
          "scenario",
          "state",
          "revision",
          "assigneeId",
          "controllerId",
          "startAt",
          "dueBefore",
          "originalDueBefore",
          "assigneeInactive",
          "controllerInactive",
          "help",
          "needsCalendar",
          "overdue",
          "problem",
          "employeeId",
          "employeeName",
          "assigneeName",
          "controllerName",
          "zone"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "metaId": {
            "type": "string",
            "format": "uuid"
          },
          "processId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "metaTitle": {
            "type": "string"
          },
          "processTitle": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigneeInactive": {
            "type": "boolean"
          },
          "controllerInactive": {
            "type": "boolean"
          },
          "help": {
            "type": "boolean"
          },
          "needsCalendar": {
            "type": "boolean"
          },
          "overdue": {
            "type": "boolean"
          },
          "problem": {
            "type": "boolean"
          },
          "employeeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "employeeName": {
            "type": "string"
          },
          "assigneeName": {
            "type": "string"
          },
          "controllerName": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessMetaList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessMeta"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessInstanceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessInstanceListItem"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessTaskDepartmentList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessDepartment"
            },
            "maxItems": 100
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessTaskList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessTaskSummary"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessTaskResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "rating",
          "comment",
          "authorId",
          "enteredAt",
          "imported",
          "question",
          "scale",
          "metricKey"
        ],
        "properties": {
          "at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "rating": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "comment": {
            "type": "string",
            "maxLength": 16000
          },
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "enteredAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "boolean"
          },
          "question": {
            "type": "string",
            "maxLength": 1024
          },
          "scale": {
            "anyOf": [
              {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metricKey": {
            "type": "string",
            "maxLength": 128
          }
        }
      },
      "EmployeeProcessTaskCard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "metaId",
          "processId",
          "title",
          "metaTitle",
          "processTitle",
          "scenario",
          "state",
          "revision",
          "assigneeId",
          "controllerId",
          "startAt",
          "dueBefore",
          "originalDueBefore",
          "assigneeInactive",
          "controllerInactive",
          "help",
          "needsCalendar",
          "overdue",
          "problem",
          "item",
          "result",
          "draft",
          "dateOverridden",
          "assignmentSource",
          "controlSource",
          "finishedAt",
          "finishedBy",
          "canManage",
          "zone",
          "people",
          "canComplete",
          "canHelp",
          "canComment",
          "canControl",
          "employeeId",
          "employeeName",
          "assigneeName",
          "controllerName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "metaId": {
            "type": "string",
            "format": "uuid"
          },
          "processId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "metaTitle": {
            "type": "string"
          },
          "processTitle": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "assigneeInactive": {
            "type": "boolean"
          },
          "controllerInactive": {
            "type": "boolean"
          },
          "help": {
            "type": "boolean"
          },
          "needsCalendar": {
            "type": "boolean"
          },
          "overdue": {
            "type": "boolean"
          },
          "problem": {
            "type": "boolean"
          },
          "item": {
            "$ref": "#/components/schemas/EmployeeProcessItem"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessTaskResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "draft": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessTaskResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateOverridden": {
            "type": "boolean"
          },
          "assignmentSource": {
            "type": "string"
          },
          "controlSource": {
            "type": "string"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "canManage": {
            "type": "boolean"
          },
          "zone": {
            "type": "string"
          },
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            }
          },
          "canComplete": {
            "type": "boolean"
          },
          "canHelp": {
            "type": "boolean"
          },
          "canComment": {
            "type": "boolean"
          },
          "canControl": {
            "type": "boolean"
          },
          "employeeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "employeeName": {
            "type": "string"
          },
          "assigneeName": {
            "type": "string"
          },
          "controllerName": {
            "type": "string"
          },
          "restoreBlocked": {
            "type": "string",
            "enum": [
              "meta",
              "process",
              "predecessor"
            ],
            "description": "Текущее препятствие восстановлению отменённого задания: сначала восстановите мета-процесс, вложенный процесс или отменённое предшествующее задание неоткрытого зависимого. meta имеет приоритет, затем process. Отсутствует, если родительские процессы уже восстановлены или задание не отменено; не предоставляет права управления."
          }
        }
      },
      "EmployeeProcessPreviewSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "template",
          "roles",
          "controllerId",
          "summary"
        ],
        "properties": {
          "template": {
            "$ref": "#/components/schemas/EmployeeProcessTemplateSummary"
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "people": {
            "type": "array",
            "maxItems": 1001,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            },
            "description": "Текущие публичные имена только участников, на которых ссылается эта разрешённая страница или явные переопределения выбранного источника; включая архивных сотрудников. Не содержит каталог, значения по умолчанию или частные ссылки результатов/черновиков."
          }
        }
      },
      "EmployeeProcessLaunchHireRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "episodeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "primary": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "identityConfirmed": {
            "type": "boolean"
          },
          "identityReason": {
            "type": "string",
            "maxLength": 16000
          }
        }
      },
      "EmployeeProcessLaunchHire": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "applicationId",
          "onboardingId",
          "episodeId",
          "primary",
          "expectedRevision",
          "identityConfirmed",
          "identityReason",
          "onboardingState",
          "actualStartDate",
          "identityMatched"
        ],
        "properties": {
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "episodeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "primary": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "identityConfirmed": {
            "type": "boolean"
          },
          "identityReason": {
            "type": "string",
            "maxLength": 16000
          },
          "onboardingState": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "identityMatched": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessHireChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "applicationId",
          "onboardingId",
          "candidateName",
          "vacancyTitle",
          "actualStartDate",
          "revision",
          "hasPrimary",
          "identityMatched"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidateName": {
            "type": "string"
          },
          "vacancyTitle": {
            "type": "string"
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "hasPrimary": {
            "type": "boolean"
          },
          "identityMatched": {
            "type": "boolean"
          },
          "sourceUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Настоящий application.updated_at доступного источника. Не используйте revision0 заявки как версию исправления."
          },
          "onboardingUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Настоящий onboarding.updated_at доступного оформления; скрывается независимо вместе с onboardingId при отсутствии onboarding.view."
          }
        }
      },
      "EmployeeProcessHireChoices": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireChoice"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessLaunchPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "expiresAt",
          "employeeId",
          "coordinatorId",
          "title",
          "scenario",
          "anchor",
          "actualStartDate",
          "zone",
          "calendarId",
          "calendarName",
          "calendarSource",
          "roles",
          "companyRoles",
          "processes",
          "calendarYears",
          "summary",
          "duplicateCount",
          "duplicateLinks",
          "canManageAfterLaunch",
          "hireAccess",
          "hire"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "employeeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "coordinatorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "zone": {
            "type": "string"
          },
          "calendarId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "calendarName": {
            "type": "string"
          },
          "calendarSource": {
            "type": "string"
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "companyRoles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "processes": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPreviewSource"
            }
          },
          "calendarYears": {
            "type": "array",
            "maxItems": 201,
            "description": "Годы, загруженные в замороженный снимок календаря (покрытие, §15.4); пусто без календаря.",
            "items": {
              "type": "integer",
              "minimum": 1900,
              "maximum": 2100
            }
          },
          "calendarFallbackYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы из calendarYears, посчитанные по базовому календарю: у выбранного регионального календаря их нет — сроки без региональных праздников. Отсутствует — подмены не было."
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "duplicateCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько активных мета-процессов того же сценария уже есть у сотрудника."
          },
          "duplicateLinks": {
            "type": "array",
            "maxItems": 20,
            "description": "Публичные id тех дубликатов, которые запускающий вправе просматривать по текущим правам; право запуска само чтения не даёт (§15.1).",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "canManageAfterLaunch": {
            "type": "boolean",
            "description": "process.edit текущего актора покроет созданный процесс (автор — запускающий)."
          },
          "hireAccess": {
            "type": "string",
            "enum": [
              "none",
              "visible",
              "revoked"
            ]
          },
          "hire": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessLaunchHire"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessImportedCompletion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at",
          "rating",
          "comment"
        ],
        "properties": {
          "at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "rating": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "comment": {
            "type": "string",
            "maxLength": 16000
          }
        }
      },
      "EmployeeProcessPreviewTask": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item",
          "startAt",
          "dueBefore",
          "conditional",
          "originalDueBefore",
          "dateOverridden",
          "assigneeId",
          "controllerId",
          "assignmentSource",
          "controlSource",
          "completion",
          "overdue"
        ],
        "properties": {
          "item": {
            "$ref": "#/components/schemas/EmployeeProcessItem"
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "conditional": {
            "type": "boolean"
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateOverridden": {
            "type": "boolean"
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignmentSource": {
            "type": "string"
          },
          "controlSource": {
            "type": "string"
          },
          "completion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessImportedCompletion"
              },
              {
                "type": "null"
              }
            ]
          },
          "overdue": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessPreviewTaskList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPreviewTask"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "people": {
            "type": "array",
            "maxItems": 400,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            },
            "description": "Публичные имена только вычисленных исполнителей/контролирующих и явных назначений заданий этой разрешённой страницы. Не содержит каталог, роли по умолчанию или частные ссылки результатов."
          }
        }
      },
      "EmployeeProcessLaunchConfirmRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "previewId",
          "idempotencyKey"
        ],
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[!-~]+$"
          },
          "duplicateConfirmed": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessLaunchDatesInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "startAt",
          "dueBefore"
        ],
        "properties": {
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "dueBefore": {
            "type": "string",
            "format": "date-time"
          },
          "conditional": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "EmployeeProcessLaunchCompletionInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "at"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "rating": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "default": 0
          },
          "comment": {
            "type": "string",
            "maxLength": 16000,
            "default": ""
          }
        }
      },
      "EmployeeProcessLaunchOverrides": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "properties": {
          "roles": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 1000,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "additionalProperties": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignees": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 500,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "additionalProperties": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "dates": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 500,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/EmployeeProcessLaunchDatesInput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "completions": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 500,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "additionalProperties": {
                  "$ref": "#/components/schemas/EmployeeProcessLaunchCompletionInput"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessLaunchRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "employeeId",
          "coordinatorId",
          "title",
          "scenario",
          "anchor",
          "templateIds"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "format": "uuid"
          },
          "coordinatorId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "scenario": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "templateIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "roles": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 20000,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "additionalProperties": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "processes": {
            "anyOf": [
              {
                "type": "object",
                "maxProperties": 20,
                "propertyNames": {
                  "type": "string",
                  "format": "uuid"
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/EmployeeProcessLaunchOverrides"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "calendarId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "hire": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessLaunchHireRequest"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessTaskCommandRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "complete",
                  "save_result"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "rating": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5,
                    "default": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "comment": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 16000
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "help",
              "comment"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "help"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "help": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "comment": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "help"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "help"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "help": {
                "type": "boolean",
                "enum": [
                  false
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "assigneeId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "assign"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "assigneeId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "controllerId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "assign_controller"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "controllerId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "dates"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "reschedule"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "dates": {
                "$ref": "#/components/schemas/EmployeeProcessLaunchDatesInput"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "instruction"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "edit_instruction"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "instruction": {
                "type": "string",
                "maxLength": 16000
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "skip",
                  "reopen",
                  "restore"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "maxLength": 16000,
                "minLength": 1
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason"
            ],
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "cancel"
                ]
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "maxLength": 16000,
                "minLength": 1
              },
              "dependencyAction": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "cascade",
                      "reparent"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "replacementKey": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        ]
      },
      "EmployeeProcessComment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorId",
          "body",
          "createdAt"
        ],
        "properties": {
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "body": {
            "type": "string"
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessCommentList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next",
          "people"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessComment"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "people": {
            "type": "array",
            "description": "Текущие публичные имена только участников разрешённых записей страницы; приватные черновики не входят в проекцию.",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            }
          }
        }
      },
      "EmployeeProcessCommentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedRevision",
          "body"
        ],
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          }
        }
      },
      "EmployeeProcessConsequenceState": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "revision",
          "state",
          "assigneeId",
          "controllerId",
          "startAt",
          "dueBefore",
          "originalDueBefore",
          "help",
          "needsCalendar"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "help": {
            "type": "boolean"
          },
          "needsCalendar": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessConsequence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "before",
          "after"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "before": {
            "$ref": "#/components/schemas/EmployeeProcessConsequenceState"
          },
          "after": {
            "$ref": "#/components/schemas/EmployeeProcessConsequenceState"
          }
        }
      },
      "EmployeeProcessConsequenceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessConsequence"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "people": {
            "type": "array",
            "maxItems": 400,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            },
            "description": "Текущие публичные имена только участников, на которых ссылается эта разрешённая страница или явные переопределения выбранного источника; включая архивных сотрудников. Не содержит каталог, значения по умолчанию или частные ссылки результатов/черновиков."
          }
        }
      },
      "EmployeeProcessManagementPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "metaId",
          "expiresAt",
          "revision",
          "stateBefore",
          "stateAfter",
          "count",
          "items",
          "next",
          "action",
          "instanceId",
          "additionCount",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "metaId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          },
          "stateBefore": {
            "type": "string"
          },
          "stateAfter": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessConsequence"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "action": {
            "type": "string",
            "enum": [
              "cancel_meta",
              "restore_meta",
              "cancel_process",
              "restore_process",
              "change_anchor",
              "update_calendar",
              "update_roles",
              "update_local_roles",
              "update_process_controller",
              "add_item",
              "add_process"
            ]
          },
          "instanceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "additionCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessPreviewSource"
              },
              {
                "type": "null"
              }
            ]
          },
          "people": {
            "type": "array",
            "maxItems": 400,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            },
            "description": "Текущие публичные имена только участников, на которых ссылается эта разрешённая страница или явные переопределения выбранного источника; включая архивных сотрудников. Не содержит каталог, значения по умолчанию или частные ссылки результатов/черновиков."
          }
        }
      },
      "EmployeeProcessManagementRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "cancel_meta"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "restore_meta"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "instanceId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "cancel_process"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "instanceId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "instanceId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "restore_process"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "instanceId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "anchor"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "change_anchor"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "anchor": {
                "type": "string",
                "format": "date"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "calendarId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "update_calendar"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "calendarId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "update_roles"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "roles": {
                "type": "object",
                "minProperties": 1,
                "maxProperties": 500,
                "propertyNames": {
                  "minLength": 1,
                  "maxLength": 64
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "Ключ до64 байт UTF-8; null удаляет явное переопределение и возвращает наследование."
              },
              "coordinatorId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "anyOf": [
              {
                "required": [
                  "roles"
                ]
              },
              {
                "required": [
                  "coordinatorId"
                ]
              }
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "instanceId",
              "roles"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "update_local_roles"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "instanceId": {
                "type": "string",
                "format": "uuid"
              },
              "roles": {
                "type": "object",
                "minProperties": 1,
                "maxProperties": 500,
                "propertyNames": {
                  "minLength": 1,
                  "maxLength": 64
                },
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": "Ключ до64 байт UTF-8; null удаляет явное переопределение и возвращает наследование."
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "instanceId",
              "controllerId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "update_process_controller"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "instanceId": {
                "type": "string",
                "format": "uuid"
              },
              "controllerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "instanceId",
              "item"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "add_item"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "instanceId": {
                "type": "string",
                "format": "uuid"
              },
              "item": {
                "$ref": "#/components/schemas/EmployeeProcessItemInput"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "action",
              "expectedRevision",
              "reason",
              "templateId"
            ],
            "properties": {
              "action": {
                "type": "string",
                "const": "add_process"
              },
              "expectedRevision": {
                "type": "integer",
                "minimum": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16000,
                "pattern": "\\S"
              },
              "templateId": {
                "type": "string",
                "format": "uuid"
              },
              "process": {
                "$ref": "#/components/schemas/EmployeeProcessLaunchOverrides"
              }
            }
          }
        ]
      },
      "EmployeeProcessManagementConfirmRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "previewId"
        ],
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "EmployeeProcessCalendarRules": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "loadedYears",
          "exceptions"
        ],
        "properties": {
          "loadedYears": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1000,
              "maximum": 9999
            }
          },
          "fallbackYears": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Годы из loadedYears, замороженные по базовому календарю: у выбранного регионального календаря их нет. Отсутствует — подмены не было (в том числе у снимков до этапа 2)."
          },
          "exceptions": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "holiday",
                "rest",
                "work",
                "short"
              ]
            }
          }
        }
      },
      "EmployeeProcessRuntimeSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "zone",
          "calendarId",
          "calendarName",
          "calendarSource",
          "calendar",
          "roles",
          "companyRoles"
        ],
        "properties": {
          "zone": {
            "type": "string"
          },
          "calendarId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "calendarName": {
            "type": "string"
          },
          "calendarSource": {
            "type": "string"
          },
          "calendar": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessCalendarRules"
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "companyRoles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        }
      },
      "EmployeeProcessHistoryMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "anchor",
          "coordinatorId",
          "state"
        ],
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "coordinatorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHistoryInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "controllerId",
          "roles",
          "state"
        ],
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "state": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHistoryTask": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "item",
          "revision",
          "state",
          "assigneeId",
          "controllerId",
          "assignmentSource",
          "controlSource",
          "startAt",
          "dueBefore",
          "originalDueBefore",
          "dateOverridden",
          "help",
          "needsCalendar",
          "finishedAt",
          "finishedBy",
          "result"
        ],
        "properties": {
          "item": {
            "$ref": "#/components/schemas/EmployeeProcessItem"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "assignmentSource": {
            "type": "string"
          },
          "controlSource": {
            "type": "string"
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateOverridden": {
            "type": "boolean"
          },
          "help": {
            "type": "boolean"
          },
          "needsCalendar": {
            "type": "boolean"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedBy": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessTaskResult"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHistorySource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "templateId",
          "revision",
          "title",
          "itemCount",
          "roles",
          "controllerId"
        ],
        "properties": {
          "templateId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string"
          },
          "itemCount": {
            "type": "integer",
            "minimum": 0
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHistorySnapshot": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryMeta"
          },
          "settings": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeSettings"
          },
          "instances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHistoryInstance"
            }
          },
          "task": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryTask"
          },
          "result": {
            "$ref": "#/components/schemas/EmployeeProcessTaskResult"
          },
          "addedTask": {
            "$ref": "#/components/schemas/EmployeeProcessPreviewTask"
          },
          "source": {
            "$ref": "#/components/schemas/EmployeeProcessHistorySource"
          },
          "advance": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryAdvance"
          }
        }
      },
      "EmployeeProcessHistory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "actorId",
          "occurredAt",
          "factAt",
          "taskId",
          "processId",
          "taskTitle",
          "processTitle",
          "before",
          "after",
          "reason"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "actorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "occurredAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "factAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "taskId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "processId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "taskTitle": {
            "type": "string"
          },
          "processTitle": {
            "type": "string"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHistorySnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "after": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHistorySnapshot"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHistoryList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next",
          "people"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHistory"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "people": {
            "type": "array",
            "description": "Текущие публичные имена только участников разрешённых записей страницы; приватные черновики не входят в проекцию.",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            }
          }
        }
      },
      "EmployeeProcessDepartmentOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "path"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessDepartment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Внешний идентификатор отдела Б24."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessCalendarOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "isDefault"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessCalendarOptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessCalendarOption"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessLaunchContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "employee",
          "departments",
          "manager",
          "zone",
          "calendar",
          "calendarSource",
          "recommendedTemplates"
        ],
        "properties": {
          "employee": {
            "$ref": "#/components/schemas/EmployeeProcessPerson"
          },
          "departments": {
            "type": "array",
            "maxItems": 2000,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessDepartmentOption"
            }
          },
          "manager": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "zone": {
            "type": "string"
          },
          "calendar": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessCalendarOption"
              },
              {
                "type": "null"
              }
            ]
          },
          "calendarSource": {
            "type": "string",
            "enum": [
              "none",
              "employee_calendar",
              "company_default"
            ]
          },
          "recommendedTemplates": {
            "type": "array",
            "maxItems": 140,
            "description": "Активные непустые шаблоны, подходящие компании или текущему прямому отделу сотрудника, не больше 20 на сценарий; форма отмечает их заранее, предпросмотр остаётся авторитетом (§7, шаг 3).",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessTemplateSummary"
            }
          }
        }
      },
      "EmployeeProcessDependencyChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "key",
          "title",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "available",
              "completed",
              "skipped"
            ]
          }
        }
      },
      "EmployeeProcessDependencyChoiceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessDependencyChoice"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessRoleLabel": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "archived",
          "builtin"
        ],
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "archived": {
            "type": "boolean"
          },
          "builtin": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessRuntimeParticipants": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "people",
          "roles"
        ],
        "properties": {
          "people": {
            "type": "array",
            "maxItems": 40003,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessPerson"
            }
          },
          "roles": {
            "type": "array",
            "maxItems": 40000,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRoleLabel"
            }
          }
        }
      },
      "EmployeeProcessManagementCalendarList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessCalendarOption"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessManagementSourceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessTemplateSummary"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessManagementSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "template",
          "roles"
        ],
        "properties": {
          "template": {
            "$ref": "#/components/schemas/EmployeeProcessTemplate"
          },
          "roles": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRoleLabel"
            }
          }
        }
      },
      "EmployeeProcessManagementContextTask": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "key",
          "title",
          "state",
          "predecessor",
          "assigneeRole",
          "controllerRole"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "available",
              "completed",
              "skipped",
              "cancelled"
            ]
          },
          "predecessor": {
            "type": "string",
            "maxLength": 128
          },
          "assigneeRole": {
            "type": "string",
            "maxLength": 64
          },
          "controllerRole": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "EmployeeProcessManagementContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metaRevision",
          "instance",
          "usedRoles",
          "tasks",
          "stages",
          "stageKey"
        ],
        "properties": {
          "metaRevision": {
            "type": "integer",
            "minimum": 1
          },
          "instance": {
            "$ref": "#/components/schemas/EmployeeProcessInstance"
          },
          "usedRoles": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessRoleLabel"
            }
          },
          "tasks": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessManagementContextTask"
            }
          },
          "stages": {
            "type": "array",
            "maxItems": 20,
            "description": "Свои стадии копии этого процесса по порядку; «Новый» и «Завершено» в список не входят.",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessManagementContextStage"
            }
          },
          "stageKey": {
            "type": "string",
            "maxLength": 64,
            "description": "Текущая стадия процесса: ключ своей стадии, _new, _done или _cancelled."
          }
        }
      },
      "EmployeeProcessInstanceCard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "templateId",
          "title",
          "revision",
          "state",
          "summary",
          "templateRevision",
          "controllerId",
          "roles",
          "metaRevision"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "templateRevision": {
            "type": "integer",
            "minimum": 1
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "participants": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeParticipants",
            "description": "Referenced current public names and role labels from this authorized runtime snapshot. Full meta detail and bounded instance pages include this optional projection. No directory defaults or private hire/result data."
          },
          "metaRevision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "EmployeeProcessHireDateCorrectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandKey",
          "expectedRevision",
          "expectedContextRevision",
          "expectedPrimaryRevision",
          "reason",
          "actualStartDate"
        ],
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "contextMetaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "expectedContextRevision": {
            "type": "integer",
            "minimum": 0
          },
          "expectedPrimaryRevision": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHirePrimaryCorrectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandKey",
          "expectedRevision",
          "expectedContextRevision",
          "expectedPrimaryRevision",
          "reason",
          "primaryMetaId",
          "expectedNewPrimaryRevision"
        ],
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "contextMetaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "expectedContextRevision": {
            "type": "integer",
            "minimum": 0
          },
          "expectedPrimaryRevision": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "primaryMetaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedNewPrimaryRevision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessHireSourceCorrectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandKey",
          "expectedRevision",
          "expectedContextRevision",
          "expectedPrimaryRevision",
          "reason",
          "applicationId",
          "onboardingId"
        ],
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "contextMetaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "expectedContextRevision": {
            "type": "integer",
            "minimum": 0
          },
          "expectedPrimaryRevision": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedOldSourceUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedSourceUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedOnboardingUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "identityConfirmed": {
            "type": "boolean"
          },
          "identityReason": {
            "type": "string",
            "maxLength": 16000
          }
        }
      },
      "EmployeeProcessQualityExclusions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "skippedTasks",
          "cancelledTasks",
          "cancelledProcesses",
          "unknownOriginalDeadlines",
          "missingCompletions",
          "lateCompletions",
          "incompleteDurations"
        ],
        "properties": {
          "skippedTasks": {
            "type": "integer",
            "minimum": 0
          },
          "cancelledTasks": {
            "type": "integer",
            "minimum": 0
          },
          "cancelledProcesses": {
            "type": "integer",
            "minimum": 0
          },
          "unknownOriginalDeadlines": {
            "type": "integer",
            "minimum": 0
          },
          "missingCompletions": {
            "type": "integer",
            "minimum": 0
          },
          "lateCompletions": {
            "type": "integer",
            "minimum": 0
          },
          "incompleteDurations": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessQualityMetric": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "groupId",
          "metricKey",
          "question",
          "scale",
          "n",
          "mean",
          "distribution"
        ],
        "properties": {
          "groupId": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "metricKey": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "scale": {
            "type": "array",
            "minItems": 5,
            "maxItems": 5,
            "items": {
              "type": "string"
            }
          },
          "n": {
            "type": "integer",
            "minimum": 0
          },
          "mean": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 1,
                "maximum": 5
              },
              {
                "type": "null"
              }
            ]
          },
          "distribution": {
            "type": "array",
            "minItems": 5,
            "maxItems": 5,
            "items": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      },
      "EmployeeProcessQualityAdaptationDuration": {
        "type": "object",
        "additionalProperties": false,
        "description": "Фактическая длительность завершённых основных адаптаций когорты: от фактического первого открытия задания до завершения последнего живого процесса. Опорная дата и плановые границы не подставляются. Незавершённые и отменённые адаптации не входят.",
        "required": [
          "medianSeconds",
          "n",
          "excluded"
        ],
        "properties": {
          "medianSeconds": {
            "description": "Медиана в секундах; null, когда наблюдений нет.",
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "n": {
            "description": "Число наблюдений в медиане.",
            "type": "integer",
            "minimum": 0
          },
          "excluded": {
            "description": "Завершённые адаптации, исключённые из медианы: результаты внесены задним числом без истории начала или граница длительности неизвестна.",
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessQualityStage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "stage",
          "medianSeconds",
          "n",
          "unfinished",
          "unknownIntervals",
          "unknownCurrent"
        ],
        "properties": {
          "stage": {
            "type": "string",
            "enum": [
              "new",
              "interview",
              "offer"
            ]
          },
          "medianSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "n": {
            "type": "integer",
            "minimum": 0
          },
          "unfinished": {
            "type": "integer",
            "minimum": 0
          },
          "unknownIntervals": {
            "type": "integer",
            "minimum": 0
          },
          "unknownCurrent": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessQualityRecruitmentStage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "stage",
          "knownSeconds",
          "intervals",
          "unknownIntervals",
          "completedSeconds",
          "currentSeconds",
          "currentUnknown"
        ],
        "properties": {
          "stage": {
            "type": "string"
          },
          "knownSeconds": {
            "type": "number",
            "minimum": 0
          },
          "intervals": {
            "type": "integer",
            "minimum": 0
          },
          "unknownIntervals": {
            "type": "integer",
            "minimum": 0
          },
          "completedSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "currentSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnknown": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessQualityRecruitment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "stages",
          "migrationRows",
          "invalidTransitions"
        ],
        "properties": {
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityRecruitmentStage"
            }
          },
          "migrationRows": {
            "type": "integer",
            "minimum": 0
          },
          "invalidTransitions": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessQualityAdaptation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "eligible",
          "timely",
          "currentOverdue",
          "movedDeadlines",
          "exclusions"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "eligible": {
            "type": "boolean"
          },
          "timely": {
            "type": "boolean"
          },
          "currentOverdue": {
            "type": "integer",
            "minimum": 0
          },
          "movedDeadlines": {
            "type": "integer",
            "minimum": 0
          },
          "exclusions": {
            "$ref": "#/components/schemas/EmployeeProcessQualityExclusions"
          }
        }
      },
      "EmployeeProcessQualityRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "employeeId",
          "employeeName",
          "revision",
          "primaryRevision",
          "actualStartDate",
          "primaryState",
          "primaryId",
          "recruitmentState",
          "applicationId",
          "adaptation",
          "recruitment",
          "controlMetrics"
        ],
        "properties": {
          "episodeId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeName": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "primaryRevision": {
            "type": "integer",
            "minimum": 0
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "primaryId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "recruitmentState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "adaptation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessQualityAdaptation"
              },
              {
                "type": "null"
              }
            ]
          },
          "recruitment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessQualityRecruitment"
              },
              {
                "type": "null"
              }
            ]
          },
          "controlMetrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityMetric"
            }
          }
        }
      },
      "EmployeeProcessQualitySummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "people",
          "episodes",
          "withAdaptation",
          "planned",
          "inProgress",
          "completed",
          "cancelled",
          "noPrimary",
          "noActiveAdaptation",
          "primaryDenied",
          "recruitmentDenied",
          "unknownStarts",
          "futureStarts",
          "outsidePeriod",
          "timelyNumerator",
          "timelyDenominator",
          "currentOverdue",
          "movedDeadlines",
          "incomparableRatings",
          "migrationRows",
          "invalidRecruitmentTransitions",
          "timelyRatio",
          "exclusions",
          "adaptationDuration",
          "stages",
          "metrics"
        ],
        "properties": {
          "people": {
            "type": "integer",
            "minimum": 0
          },
          "episodes": {
            "type": "integer",
            "minimum": 0
          },
          "withAdaptation": {
            "type": "integer",
            "minimum": 0
          },
          "planned": {
            "type": "integer",
            "minimum": 0
          },
          "inProgress": {
            "type": "integer",
            "minimum": 0
          },
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "cancelled": {
            "type": "integer",
            "minimum": 0
          },
          "noPrimary": {
            "type": "integer",
            "minimum": 0
          },
          "noActiveAdaptation": {
            "type": "integer",
            "minimum": 0
          },
          "primaryDenied": {
            "type": "integer",
            "minimum": 0
          },
          "recruitmentDenied": {
            "type": "integer",
            "minimum": 0
          },
          "unknownStarts": {
            "type": "integer",
            "minimum": 0
          },
          "futureStarts": {
            "type": "integer",
            "minimum": 0
          },
          "outsidePeriod": {
            "type": "integer",
            "minimum": 0
          },
          "timelyNumerator": {
            "type": "integer",
            "minimum": 0
          },
          "timelyDenominator": {
            "type": "integer",
            "minimum": 0
          },
          "currentOverdue": {
            "type": "integer",
            "minimum": 0
          },
          "movedDeadlines": {
            "type": "integer",
            "minimum": 0
          },
          "incomparableRatings": {
            "type": "integer",
            "minimum": 0
          },
          "migrationRows": {
            "type": "integer",
            "minimum": 0
          },
          "invalidRecruitmentTransitions": {
            "type": "integer",
            "minimum": 0
          },
          "timelyRatio": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "exclusions": {
            "$ref": "#/components/schemas/EmployeeProcessQualityExclusions"
          },
          "adaptationDuration": {
            "$ref": "#/components/schemas/EmployeeProcessQualityAdaptationDuration"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityStage"
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityMetric"
            }
          }
        }
      },
      "EmployeeProcessQuality": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "summary",
          "items",
          "next",
          "metricNext"
        ],
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessQualitySummary"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityRow"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "metricNext": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireOnboarding": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "state",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Настоящий onboarding.updated_at для текущего доступного оформления. В исторической ссылке версия может отсутствовать."
          }
        }
      },
      "EmployeeProcessHireProcessObservation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "openedAt",
          "finishedAt",
          "durationSeconds",
          "elapsedSeconds",
          "incompleteDuration"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "openedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "durationSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "elapsedSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "incompleteDuration": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessHireProcess": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "revision",
          "summary",
          "observation"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "observation": {
            "$ref": "#/components/schemas/EmployeeProcessHireProcessObservation"
          }
        }
      },
      "EmployeeProcessHireProcessList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireProcess"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "taskId",
          "processId",
          "taskTitle",
          "processTitle",
          "revision",
          "originalDueBefore",
          "dueBefore",
          "finishedAt",
          "rating",
          "comment",
          "question",
          "metricKey",
          "scale",
          "authorId",
          "authorName",
          "enteredAt",
          "factAt",
          "imported"
        ],
        "properties": {
          "taskId": {
            "type": "string",
            "format": "uuid"
          },
          "processId": {
            "type": "string",
            "format": "uuid"
          },
          "taskTitle": {
            "type": "string"
          },
          "processTitle": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "originalDueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "rating": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "comment": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "metricKey": {
            "type": "string"
          },
          "scale": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "authorName": {
            "type": "string"
          },
          "enteredAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "factAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "type": "boolean"
          }
        }
      },
      "EmployeeProcessHireResultList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireResult"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHirePrimary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "eligible",
          "timely",
          "currentOverdue",
          "movedDeadlines",
          "exclusions",
          "id",
          "title",
          "anchor",
          "revision",
          "processes",
          "results",
          "history"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "eligible": {
            "type": "boolean"
          },
          "timely": {
            "type": "boolean"
          },
          "currentOverdue": {
            "type": "integer",
            "minimum": 0
          },
          "movedDeadlines": {
            "type": "integer",
            "minimum": 0
          },
          "exclusions": {
            "$ref": "#/components/schemas/EmployeeProcessQualityExclusions"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "processes": {
            "$ref": "#/components/schemas/EmployeeProcessHireProcessList"
          },
          "results": {
            "$ref": "#/components/schemas/EmployeeProcessHireResultList"
          },
          "history": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryList"
          }
        }
      },
      "EmployeeProcessHireCurrentReview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "score",
          "scoreSource",
          "comment",
          "authorId",
          "authorName",
          "at"
        ],
        "properties": {
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "scoreSource": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "authorName": {
            "type": "string"
          },
          "at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireRecruitmentEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "stage",
          "status",
          "leftTo",
          "via",
          "score",
          "scoreHuman",
          "comment",
          "actorId",
          "authorId",
          "actorName",
          "authorName",
          "actorKind",
          "leftAt"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "leftTo": {
            "type": "string"
          },
          "via": {
            "type": "string"
          },
          "score": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "scoreHuman": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "comment": {
            "type": "string"
          },
          "actorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "authorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "actorName": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "actorKind": {
            "type": "string"
          },
          "leftAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireRecruitmentHistory": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireRecruitmentEvent"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireRecruitment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "applicationId",
          "candidateId",
          "vacancyId",
          "candidateName",
          "position",
          "stage",
          "updatedAt",
          "currentReview",
          "observation",
          "history"
        ],
        "properties": {
          "applicationId": {
            "type": "string",
            "format": "uuid"
          },
          "candidateId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "vacancyId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidateName": {
            "type": "string"
          },
          "position": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentReview": {
            "$ref": "#/components/schemas/EmployeeProcessHireCurrentReview"
          },
          "observation": {
            "$ref": "#/components/schemas/EmployeeProcessQualityRecruitment"
          },
          "history": {
            "$ref": "#/components/schemas/EmployeeProcessHireRecruitmentHistory"
          }
        }
      },
      "EmployeeProcessHireLink": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "scenario",
          "anchor",
          "revision",
          "state",
          "primary",
          "canSelectPrimary"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "state": {
            "type": "string",
            "enum": [
              "planned",
              "in_progress",
              "completed",
              "cancelled"
            ]
          },
          "primary": {
            "type": "boolean"
          },
          "canSelectPrimary": {
            "type": "boolean",
            "description": "Связанный onboarding-процесс того же сотрудника независимо доступен для просмотра аналитики и редактирования. Для изменения основной адаптации также нужно capabilities.canCorrectPrimary."
          }
        }
      },
      "EmployeeProcessHireLinkList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireLink"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHirePrimaryRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHireCorrectionState": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "actualStartDate",
          "primaryState",
          "primary",
          "recruitmentState",
          "applicationId",
          "sourceUpdatedAt",
          "onboardingState",
          "onboarding"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "primary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHirePrimaryRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "recruitmentState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceUpdatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "onboarding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireOnboarding"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireCorrectionDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "before",
          "after",
          "reason",
          "identityConfirmed",
          "identityReason"
        ],
        "properties": {
          "episodeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "before": {
            "$ref": "#/components/schemas/EmployeeProcessHireCorrectionState"
          },
          "after": {
            "$ref": "#/components/schemas/EmployeeProcessHireCorrectionState"
          },
          "reason": {
            "type": "string"
          },
          "identityConfirmed": {
            "type": "boolean"
          },
          "identityReason": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHireLinkDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "revision",
          "primary",
          "actualStartDate",
          "applicationId",
          "onboardingState",
          "onboarding",
          "identityConfirmed",
          "identityReason"
        ],
        "properties": {
          "episodeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "primary": {
            "type": "boolean"
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "applicationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "onboarding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireOnboarding"
              },
              {
                "type": "null"
              }
            ]
          },
          "identityConfirmed": {
            "type": "boolean"
          },
          "identityReason": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessHireJournalEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metaId",
          "actorId",
          "metaTitle",
          "actorName",
          "kind",
          "occurredAt",
          "privateState",
          "details",
          "dateCorrection",
          "primaryCorrection",
          "sourceCorrection"
        ],
        "properties": {
          "metaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "actorId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "metaTitle": {
            "type": "string"
          },
          "actorName": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "occurredAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "privateState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "unsupported"
            ]
          },
          "details": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireLinkDetails"
              },
              {
                "type": "null"
              }
            ]
          },
          "dateCorrection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireCorrectionDetails"
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryCorrection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireCorrectionDetails"
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceCorrection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireCorrectionDetails"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireJournal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessHireJournalEvent"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessHireCard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "employeeId",
          "employeeName",
          "actualStartDate",
          "revision",
          "primaryState",
          "primaryId",
          "primaryRevision",
          "recruitmentState",
          "onboardingState",
          "primary",
          "recruitment",
          "onboarding",
          "links",
          "journal",
          "capabilities"
        ],
        "properties": {
          "episodeId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeName": {
            "type": "string"
          },
          "actualStartDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "primaryState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "primaryId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryRevision": {
            "type": "integer",
            "minimum": 0
          },
          "recruitmentState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "onboardingState": {
            "type": "string",
            "enum": [
              "available",
              "denied",
              "absent"
            ]
          },
          "primary": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHirePrimary"
              },
              {
                "type": "null"
              }
            ]
          },
          "recruitment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireRecruitment"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboarding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessHireOnboarding"
              },
              {
                "type": "null"
              }
            ]
          },
          "links": {
            "$ref": "#/components/schemas/EmployeeProcessHireLinkList"
          },
          "journal": {
            "$ref": "#/components/schemas/EmployeeProcessHireJournal"
          },
          "capabilities": {
            "$ref": "#/components/schemas/EmployeeProcessHireCorrectionCapabilities"
          }
        }
      },
      "EmployeeProcessHireCorrectionCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextMetaId",
          "contextRevision",
          "canCorrectDate",
          "canCorrectPrimary",
          "canCorrectSource",
          "canSelectOnboarding"
        ],
        "properties": {
          "contextMetaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текущий доступный контекст команды. Null допускается при общих правах и отсутствии основной адаптации."
          },
          "contextRevision": {
            "type": "integer",
            "minimum": 0,
            "description": "Ревизия возвращённого контекста; 0 при null."
          },
          "canCorrectDate": {
            "type": "boolean",
            "description": "Можно исправить ручную фактическую дату; источник подбора отсутствует."
          },
          "canCorrectPrimary": {
            "type": "boolean",
            "description": "Можно изменить основную адаптацию с текущими правами на эпизод и основную адаптацию."
          },
          "canCorrectSource": {
            "type": "boolean",
            "description": "Можно изменить источник с текущими правами на эпизод и старый источник подбора."
          },
          "canSelectOnboarding": {
            "type": "boolean",
            "description": "Можно явно выбрать КЭДО; дополнительно требуются независимые права просмотра оформления."
          }
        },
        "description": "Подсказки из текущего снимка чтения. Каждая команда повторно проверяет текущие права и версии; эти флаги не заменяют серверную авторизацию."
      },
      "EmployeeProcessQualityChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "departmentId",
          "name"
        ],
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "departmentId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          }
        }
      },
      "EmployeeProcessQualityChoices": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessQualityChoice"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "HistoricalApplicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lastName",
          "firstName",
          "contact",
          "occurredOn",
          "category"
        ],
        "properties": {
          "lastName": {
            "type": "string",
            "maxLength": 100
          },
          "firstName": {
            "type": "string",
            "maxLength": 100
          },
          "middleName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "description": "Отчество; null, пустая строка или одни пробелы — отчества нет."
          },
          "contact": {
            "$ref": "#/components/schemas/CandidateContact",
            "description": "Ровно один контакт. Уже известный порталу контакт указывает на существующего кандидата, и имя из тела тогда не применяется — как у appCreateApplication."
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ApplicationSource"
              }
            ],
            "description": "Откуда пришёл отклик. Без поля — manual."
          },
          "resumeUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "description": "Только http или https. Пустая строка и null — ссылки нет."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Заметка отклика: исходный статус, происхождение строки и прочее важное."
          },
          "occurredOn": {
            "type": "string",
            "format": "date",
            "description": "Когда отклик был на самом деле, ГГГГ-ММ-ДД: не раньше 2000-01-01 и не позже сегодняшнего дня в самом позднем гражданском поясе UTC+14 — так любой вызывающий может внести свой сегодняшний день, а дата до 14 часов впереди UTC тоже принимается."
          },
          "category": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RejectCategory"
              }
            ],
            "description": "Категория формальной причины отказа, с которой отклик заводится."
          },
          "comment": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "description": "Необязательный внутренний комментарий к причине; хранится шифрованным, края пробелов снимает сервер."
          }
        }
      },
      "ApprovalRouteActor": {
        "type": "object",
        "description": "Автор последней правки маршрута. Имя отдаётся только вызывающему с правом approval_route · edit и сессией по куке; иначе name — null.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "ФИО; null — имя вызывающему не отдаётся."
          }
        }
      },
      "ApprovalRouteParticipant": {
        "type": "object",
        "description": "Участник маршрута в строке списка: заполнено поле субъекта своего вида. Одинаковые участники разных шагов схлопнуты.",
        "required": [
          "kind",
          "userId",
          "b24UserId",
          "b24DeptId",
          "roleCode",
          "roleId",
          "name"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ]
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "b24UserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "b24DeptId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "roleCode": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Адрес роли портала у участника вида `role`; null у прочих видов и у системной роли без строки в портале."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Человек (`user`, `b24_user`) — ФИО, но только вызывающему с approval_route · edit по куке; отдел (`b24_dept_head`) — название отдела из снимка Битрикс24, всем; собственная роль портала — её название, всем; прочие виды, системная роль (её подписывает клиент по roleCode) и отсутствие в снимке — null."
          }
        }
      },
      "ApprovalRouteUsage": {
        "type": "object",
        "description": "Где маршрут используется. Архивные должности и шаблоны вакансий считаются: удаление маршрута упирается и в них.",
        "required": [
          "positions",
          "templates",
          "hadRounds"
        ],
        "properties": {
          "positions": {
            "type": "integer",
            "minimum": 0,
            "description": "Должностей с этим маршрутом."
          },
          "templates": {
            "type": "integer",
            "minimum": 0,
            "description": "Шаблонов вакансий с этим маршрутом."
          },
          "hadRounds": {
            "type": "boolean",
            "description": "По маршруту уже шли круги согласования."
          }
        }
      },
      "ApprovalRouteListItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApprovalRoute"
          },
          {
            "type": "object",
            "required": [
              "participants",
              "participantCount",
              "usage"
            ],
            "properties": {
              "participants": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApprovalRouteParticipant"
                },
                "description": "Первые три различных участника по порядку шагов."
              },
              "participantCount": {
                "type": "integer",
                "minimum": 0,
                "description": "Всех различных участников маршрута."
              },
              "usage": {
                "$ref": "#/components/schemas/ApprovalRouteUsage"
              }
            }
          }
        ]
      },
      "WorkFormatCode": {
        "type": "string",
        "enum": [
          "on_site",
          "hybrid",
          "remote",
          "field_work"
        ],
        "description": "Код формата работы: on_site — офис, hybrid — гибрид, remote — удалённо, field_work — разъездной. Поле workFormat принимает и отдаёт и прежний свободный текст (например, office): его показывают как есть. Совпадение с hiring.WorkFormatCodes держит тест."
      },
      "EmploymentTypeCode": {
        "type": "string",
        "enum": [
          "permanent",
          "fixed_term"
        ],
        "description": "Код формата оформления: permanent — бессрочный договор, fixed_term — срочный. Совпадение с hiring.EmploymentTypes держит тест."
      },
      "LanguageCode": {
        "type": "string",
        "enum": [
          "ru",
          "en",
          "fr",
          "it",
          "es"
        ],
        "description": "Код языка: ru — русский, en — английский, fr — французский, it — итальянский, es — испанский. Совпадение с hiring.LanguageCodes держит тест."
      },
      "LocationCode": {
        "type": "string",
        "enum": [
          "moscow",
          "saint_petersburg"
        ],
        "description": "Код локации: moscow — Москва, saint_petersburg — Санкт-Петербург. Совпадение с hiring.LocationCodes держит тест."
      },
      "WorkScheduleCode": {
        "type": "string",
        "enum": [
          "5_2",
          "2_2",
          "2_3"
        ],
        "description": "Код графика — дни работы и отдыха: 5_2 — пять через два, 2_2 — два через два, 2_3 — два через три. Совпадение с hiring.WorkSchedules держит тест."
      },
      "TermsLegalEntity": {
        "type": "object",
        "required": [
          "id",
          "name",
          "active"
        ],
        "description": "Юрлицо условий заявки, от которого открывается вакансия.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес юрлица, как LegalEntity.id."
          },
          "name": {
            "type": "string",
            "description": "Название юрлица."
          },
          "active": {
            "type": "boolean",
            "description": "Действующее ли юрлицо. false — ушло из источника или ликвидировано: у шаблона оно остаётся, но выбрать его вновь нельзя, и в заявку оно не переходит."
          }
        }
      },
      "TermsFile": {
        "type": "object",
        "required": [
          "name",
          "contentType",
          "size"
        ],
        "description": "Файл условий заявки.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес файла. Ключу API не приходит: файлы прикладывает и скачивает только кабинет."
          },
          "name": {
            "type": "string",
            "description": "Имя файла для человека, с расширением."
          },
          "contentType": {
            "type": "string",
            "description": "Тип содержимого, например application/pdf."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "description": "Размер в байтах."
          }
        }
      },
      "TermsObserver": {
        "type": "object",
        "required": [
          "id"
        ],
        "description": "Наблюдатель условий заявки — сотрудник Битрикс24.",
        "properties": {
          "id": {
            "type": "string",
            "example": "42",
            "description": "Номер сотрудника в Битрикс24 строкой, как AppDirectoryItem.id. Не разбирайте его как число."
          },
          "name": {
            "type": "string",
            "description": "Имя из снимка людей Битрикс24. Ключу API не приходит."
          },
          "active": {
            "type": "boolean",
            "description": "Сотрудник есть в снимке Битрикс24 и работает. false — ушёл: в заявку он не переходит. Ключу API не приходит."
          }
        }
      },
      "ApprovalSubject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "roleCode",
          "departmentName",
          "person",
          "captured"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "roleCode": {
            "type": "string"
          },
          "departmentName": {
            "type": "string"
          },
          "person": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Человек субъекта шага (вид user или b24_user) — только если вызывающему он виден по праву portal_user · view, той же проверкой, что имена members; иначе null."
          },
          "captured": {
            "type": "boolean"
          }
        }
      },
      "RejectCategory": {
        "type": "string",
        "enum": [
          "requirements",
          "conditions",
          "customer_decision",
          "candidate_withdrew",
          "vacancy_closed",
          "other"
        ],
        "description": "Стабильная категория формального отказа."
      },
      "ApplicationRejection": {
        "type": "object",
        "required": [
          "category",
          "author",
          "at",
          "comment"
        ],
        "properties": {
          "category": {
            "$ref": "#/components/schemas/RejectCategory"
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "commentUnreadable": {
            "type": "boolean",
            "readOnly": true,
            "description": "Внутренний комментарий лежит шифротекстом, который сервер не смог открыть (например, после смены ключа шифрования): comment приходит null, category, author и at — как есть. Поля нет или false — комментарий прочитан или его не было."
          }
        }
      },
      "ApplicationRejectRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fromStage",
          "category"
        ],
        "properties": {
          "fromStage": {
            "$ref": "#/components/schemas/ApplicationStage"
          },
          "category": {
            "$ref": "#/components/schemas/RejectCategory"
          },
          "comment": {
            "type": "string",
            "maxLength": 4000,
            "description": "Необязательный внутренний комментарий; края пробелов снимает сервер."
          },
          "publicComment": {
            "type": "string",
            "maxLength": 4000,
            "description": "Optional public comment for the candidate, saved atomically with a manual ordinary-hiring rejection. Omission preserves the existing behavior; whitespace is trimmed."
          },
          "offerDraftRevision": {
            "type": "integer",
            "minimum": 1,
            "description": "Ревизия подготовленного оффера отклика, которую видел вызывающий (OfferDraft.revision, Application.offerApproval.revision). Решение согласующего или правка, успевшие раньше отказа, отвечают 409 offer_draft_changed. Не прислана — без сверки, как прежде."
          }
        }
      },
      "RejectionDescriptor": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "category"
        ],
        "properties": {
          "category": {
            "$ref": "#/components/schemas/RejectCategory"
          },
          "comment": {
            "type": "string",
            "maxLength": 4000,
            "description": "Необязательный внутренний комментарий; края пробелов снимает сервер."
          }
        }
      },
      "ScoreSourceRef": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "id"
        ],
        "description": "Вход, на котором стоит оценка: вид и публичный адрес строки источника. Список собирает сервер из того, что легло во вход оценки; контактов, ссылок и текстов здесь нет.",
        "properties": {
          "kind": {
            "type": "string",
            "description": "Вид источника. Известные коды: brief — версия брифа, decision — решённый круг собеседования (адрес собеседования), offer — оффер, channel_response — доставка площадки. Прочие коды приходят как есть, строкой. resume — содержание ручного резюме, публичного адреса источника нет (id=null)."
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Публичный адрес источника; null — у источника публичного адреса нет (доставка площадки). У resume всегда null; адрес резюме, digest и версия Диска не выдаются."
          }
        }
      },
      "ScorePortrait": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "number",
          "source",
          "available"
        ],
        "description": "Версия портрета, по которой поставлена оценка: адрес, номер и источник сохранены значениями и переживают удаление версии пределом.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Адрес версии портрета."
          },
          "number": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Номер версии в документе вакансии."
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "manual",
                  "ai",
                  "import"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Откуда версия: manual — правка руками, ai — итог генерации, import — прежняя строка, усыновлённая как есть."
          },
          "available": {
            "type": "boolean",
            "description": "Версия ещё хранится. false — её удалил предел версий: адрес и номер остаются, подробностей версии больше нет."
          }
        }
      },
      "ScoreProvenance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "portrait",
          "sources",
          "capturedAt",
          "stale"
        ],
        "description": "Происхождение оценки: версия портрета и входы, по которым она поставлена, и момент записи. Автор и момент берутся с сервера.",
        "properties": {
          "portrait": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScorePortrait"
              },
              {
                "type": "null"
              }
            ],
            "description": "Версия портрета; null — в момент оценки у портрета версий не было, и она не угадывается."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScoreSourceRef"
            },
            "description": "Прочие входы оценки."
          },
          "capturedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Момент записи оценки, UTC."
          },
          "stale": {
            "type": "boolean",
            "description": "Портрет вакансии с тех пор сменился: оценка требует пересмотра. Результат не переписывается."
          }
        }
      },
      "InterviewCalendarOperation": {
        "type": "object",
        "description": "Последняя операция над встречей собеседования в календаре Б24: перенос (reschedule) или запись встречи бронью (create). Состояние prepared — заведена, applying — идёт вызов портала, verifying — календарь ещё не подтвердил исход (действует прежнее время), confirmed — время подтверждено чтением календаря, conflict — операция закрыта без изменения, причина — в code. Названий и описаний событий календаря здесь нет.",
        "required": [
          "id",
          "kind",
          "state",
          "code",
          "targetStartsAt",
          "targetEndsAt",
          "confirmedStartsAt",
          "confirmedEndsAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Ключ операции: у переноса — присланный клиентом, по нему же проверка."
          },
          "kind": {
            "type": "string",
            "enum": [
              "create",
              "reschedule"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "prepared",
              "applying",
              "verifying",
              "confirmed",
              "conflict"
            ]
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Машинный код исхода: calendar_owner_mismatch, calendar_host_mismatch, calendar_attendees_mismatch, calendar_time_mismatch — первое наблюдаемое несовпадение владельца, ведущего, списка участников или точного UTC-интервала соответственно; calendar_changed — нейтральный fallback. Код не устанавливает автора или способ изменения встречи. Остальные исходы: calendar_update_unconfirmed, calendar_unreadable, calendar_event_gone, calendar_unavailable, slot_taken, attendee_gone, provider_refused, invite_changed, invite_cancelled, decision_taken, operation_abandoned, create_outcome_unknown, booking_commit_unknown, booking_rolled_back, webhook_dead, scope_missing. Неизвестный клиенту код показывается как есть. null — кода нет."
          },
          "targetStartsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Начало, которое ставит операция, UTC."
          },
          "targetEndsAt": {
            "type": "string",
            "format": "date-time",
            "description": "Конец, который ставит операция, UTC."
          },
          "confirmedStartsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Начало, подтверждённое чтением календаря; null до подтверждения."
          },
          "confirmedEndsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Конец, подтверждённый чтением календаря; null до подтверждения."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InterviewCalendarRemoval": {
        "type": "object",
        "description": "Намерение удалить встречу в календаре Б24 у приглашения, отменённого закрытием вакансии. awaiting_event — встреча ещё записывается бронью, queued — удаление ждёт фонового прохода, removed — встреча удалена, not_needed — удалять нечего, failed — портал отказал, unknown — исход неизвестен. Подтверждённое человеком (confirmedManuallyAt) намерение задачей больше не считается; бронь, назвавшая настоящую встречу, снова ставит его в очередь и гасит подтверждение.",
        "required": [
          "state",
          "code",
          "confirmedManuallyAt"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "awaiting_event",
              "queued",
              "removed",
              "not_needed",
              "failed",
              "unknown"
            ]
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Машинный код исхода; неизвестный клиенту код показывается как есть. null — кода нет."
          },
          "confirmedManuallyAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Человек подтвердил в кабинете, что встречи в календаре нет. state при этом прежний (failed или unknown): ручное подтверждение не выдаёт себя за ответ календаря. null — не подтверждали."
          }
        }
      },
      "SurveySignalManualReason": {
        "type": "object",
        "additionalProperties": false,
        "description": "Ручная причина сигнала: автор из снимка участников опроса, важность и текст.",
        "properties": {
          "author": {
            "$ref": "#/components/schemas/SurveyPerson"
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 10000
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "author",
          "importance",
          "text",
          "createdAt"
        ]
      },
      "SurveyControllerPage": {
        "type": "object",
        "additionalProperties": false,
        "description": "Действующие контролирующие опроса с доступом к ответам страницами и сам вызывающий, если он действующий контролирующий. Тому, у кого нет права работы с сигналами опроса, `people` пуст.",
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyPerson"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string"
          },
          "me": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Вызывающий как действующий контролирующий; null — не контролирует или недоступен."
          }
        },
        "required": [
          "people",
          "nextCursor",
          "me"
        ]
      },
      "SurveySignalCreate": {
        "type": "object",
        "additionalProperties": false,
        "description": "Ручное заведение сигнала: опрос, сотрудник из его снимка участников, важность и причина; ответственный — действующий контролирующий с доступом к ответам, по желанию.",
        "properties": {
          "surveyId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "importance": {
            "type": "string",
            "enum": [
              "ordinary",
              "important",
              "urgent"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "assignee": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "surveyId",
          "employeeId",
          "importance",
          "reason",
          "commandKey"
        ]
      },
      "SurveyFormFolder": {
        "type": "object",
        "additionalProperties": false,
        "description": "Папка анкет: один уровень, внутри только анкеты. formCount считает только видимые смотрящему неархивные анкеты; canManage — может ли смотрящий переименовать и удалить папку.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "formCount": {
            "type": "integer",
            "minimum": 0
          },
          "canManage": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "title",
          "formCount",
          "canManage",
          "updatedAt"
        ]
      },
      "SurveyFormFolderList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFormFolder"
            },
            "maxItems": 200
          }
        },
        "required": [
          "folders"
        ]
      },
      "SurveyFormFolderTitle": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "Название без крайних пробелов, от 1 до 255 символов. Совпадение без учёта регистра и ё/е с названием другой папки портала — survey_folder_title_taken."
          }
        },
        "required": [
          "title"
        ]
      },
      "SurveyFormFolderMove": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "folderId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Папка назначения; null — в корень."
          }
        },
        "required": [
          "folderId"
        ]
      },
      "MeFeatures": {
        "type": "object",
        "description": "Build and portal feature availability, independent of the caller's grants.",
        "required": [
          "blueCollarEnabled",
          "vacationSchedule"
        ],
        "properties": {
          "blueCollarEnabled": {
            "type": "boolean",
            "description": "Доступность ручного выбора режима в этой сборке; права не предоставляет. Сохранённый режим и восстановление назначений действуют при false."
          },
          "aiConnected": {
            "type": "boolean",
            "description": "Whether a live stored AI connection exists for the session portal. Available only to human cookie and embed sessions; omitted for API keys, a missing dependency or a failed lookup. This reports stored row presence only, not provider health, scope, usable credentials, quota or authorization."
          },
          "employeeCatalogAvailable": {
            "type": "boolean",
            "description": "Navigation hint for the employee vacancy catalog. True only when the human cookie or embed session has a confirmed active user with a positive Bitrix24 user ID in the session portal; false when no such identity exists. Omitted for API keys, a missing dependency or a failed lookup. Does not grant access: employee endpoints verify identity and publication audience independently."
          },
          "personalSurveysAvailable": {
            "type": "boolean",
            "description": "Navigation hint for personal surveys. True only when the human cookie or embed session has a confirmed active user with a positive Bitrix24 user ID in the session portal; false when no such identity exists. Omitted for API keys, a missing dependency or a failed lookup. Does not grant access: personal survey endpoints verify the respondent independently."
          },
          "vacationSchedule": {
            "type": "string",
            "enum": [
              "on",
              "off",
              "unknown"
            ],
            "description": "График отпусков компании — настройка vacation.schedule_enabled. on — включён; off — выключен, ручки графика отвечают 403 vacation_schedule_disabled, а у меню нет его счётчиков; unknown — настройку прочитать не удалось, экраны закрывают график как выключенный. Права не предоставляет: каждая ручка графика проверяет настройку сама."
          },
          "telegramConfigured": {
            "type": "boolean",
            "description": "Whether the service Telegram bot has a stored positive bot ID, independently of enabled state, lifecycle or operational delivery readiness. Available to all admitted cabinet principals. Omitted when the dependency is missing, the read fails or the required singleton row is missing; omission means unknown, not false."
          }
        }
      },
      "VacancyScenario": {
        "type": "string",
        "enum": [
          "regular",
          "mass"
        ],
        "description": "Снимок сценария вакансии при создании; последующая правка шаблона его не меняет."
      },
      "VacancyArchivedFilter": {
        "type": "string",
        "enum": [
          "exclude",
          "only",
          "all"
        ],
        "description": "Отбор строк по архиву: exclude — без архивных, only — только архивные, all — все. Архивная строка — та, у которой archivedAt не null. Отбор стоит до пагинации и подсчёта: страница и числа считаются уже по отобранным строкам."
      },
      "SurveyDeleteForm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "revision",
          "commandKey"
        ]
      },
      "SurveyFormDeleteResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "deleted": {
            "type": "boolean",
            "description": "true: анкета физически удалена."
          }
        },
        "required": [
          "id",
          "deleted"
        ]
      },
      "TemplateCatalogItem": {
        "type": "object",
        "description": "Карточка выбора без зарплаты, брифа, портрета и внутренних настроек процесса.",
        "required": [
          "id",
          "title",
          "positionTitle",
          "description",
          "group",
          "massHiring"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "positionTitle": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "group": {
            "type": "string",
            "nullable": true
          },
          "massHiring": {
            "type": "boolean"
          }
        }
      },
      "TemplateCatalogPage": {
        "type": "object",
        "required": [
          "items",
          "next",
          "emptyReason"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/TemplateCatalogItem"
            }
          },
          "next": {
            "type": "string",
            "maxLength": 64,
            "description": "Непрозрачный курсор продолжения; null означает конец.",
            "nullable": true
          },
          "emptyReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none_configured",
                  "none_available",
                  "no_matches"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the accessible catalog is empty. none_configured requires template-edit admin with template-view permission and full configured-set proof; no hidden counts or IDs."
          }
        }
      },
      "ResponseChannelCode": {
        "type": "string",
        "enum": [
          "avito",
          "hh",
          "telegram"
        ],
        "description": "Канал доставки отклика: подключаемая площадка (ChannelCode) или Telegram-форма. Набор держит тест по паспортам реестра откликов. Набор растёт вместе с каналами: незнакомый код — не ошибка, его стоит пропустить или показать как есть."
      },
      "CompanyPdnOperator": {
        "type": "object",
        "required": [
          "name",
          "address",
          "policyUrl",
          "withdrawEmail"
        ],
        "description": "Реквизиты оператора ПДн (спека Telegram § 7.1). null — не заполнено.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "description": "Полное наименование оператора."
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "description": "Адрес оператора."
          },
          "policyUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Ссылка на политику обработки ПДн, только https://."
          },
          "withdrawEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "description": "Почта для отзыва согласия."
          }
        }
      },
      "CompanyConsentPreview": {
        "type": "object",
        "required": [
          "version",
          "text",
          "missing"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "description": "Версия шаблона согласия."
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текст; null — реквизиты неполны."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "pdnOperatorName",
                "pdnOperatorAddress",
                "pdnPolicyUrl",
                "pdnWithdrawEmail"
              ]
            }
          }
        }
      },
      "InterviewSendRequest": {
        "type": "object",
        "properties": {
          "confirmPossibleDuplicate": {
            "type": "boolean",
            "default": false,
            "description": "Явное согласие на возможный дубль после неизвестного исхода. Пока dispatch lease активна, даже true не разрешает повтор; срок приходит details.resendBlockedUntil."
          },
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "$ref": "#/components/schemas/CandidateB24EmailDecision",
            "description": "Optional outbound email decision; the server uses saved when omitted."
          }
        },
        "required": [
          "intentId"
        ]
      },
      "OfferChannelChoice": {
        "type": "object",
        "properties": {
          "responseId": {
            "type": "string",
            "maxLength": 2048
          },
          "provider": {
            "type": "string",
            "enum": [
              "hh",
              "avito"
            ]
          },
          "label": {
            "type": "string"
          },
          "available": {
            "type": "boolean",
            "description": "Send readiness, not selectability. HH preview_required remains selectable for explicit preview; Avito contract_unverified is disabled."
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "responseId",
          "provider",
          "label",
          "available"
        ],
        "additionalProperties": false
      },
      "OfferChannelTargets": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OfferChannelChoice"
            }
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "OfferChannelPreview": {
        "type": "object",
        "properties": {
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "previewToken": {
            "type": "string"
          },
          "blockingOperation": {
            "type": "string"
          }
        },
        "required": [
          "available"
        ],
        "additionalProperties": false
      },
      "OfferChannelConfirm": {
        "type": "object",
        "properties": {
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "previewToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "email": {
            "$ref": "#/components/schemas/CandidateB24EmailDecision",
            "description": "Optional outbound decision; omitted uses saved before any link or queue effect."
          }
        },
        "required": [
          "intentId",
          "previewToken"
        ],
        "additionalProperties": false
      },
      "OfferChannelOperation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "offerId": {
            "type": "string",
            "format": "uuid"
          },
          "responseId": {
            "type": "string",
            "maxLength": 2048
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "in_flight",
              "unknown",
              "accepted",
              "rejected_no_effect"
            ]
          },
          "reason": {
            "type": "string"
          },
          "canRetry": {
            "type": "boolean",
            "description": "Only proven verified_no_effect enables a new explicit preview and confirmation. Never automatically retry transport."
          },
          "canReconcile": {
            "type": "boolean",
            "description": "Requires an admitted exact message ID; reconciliation reads only that message/account/chat and never sends."
          },
          "acceptedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Independent known fact; absence is not a negative fact."
          },
          "deliveredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Independent known fact; absence is not a negative fact."
          },
          "readAt": {
            "type": "string",
            "format": "date-time",
            "description": "Independent known fact; absence is not a negative fact."
          },
          "b24": {
            "$ref": "#/components/schemas/CandidateB24OutboundReceipt",
            "description": "Independent native preparation receipt; legacy external operations have not_applicable and acquire no replacement authority."
          }
        },
        "required": [
          "id",
          "intentId",
          "offerId",
          "responseId",
          "state",
          "canRetry",
          "canReconcile"
        ],
        "additionalProperties": false
      },
      "OfferChannelOperations": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OfferChannelOperation"
            }
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "GameAchievementSet": {
        "type": "object",
        "description": "Набор достижений — тематическая группа определений портала, не испытание и не кампания.",
        "required": [
          "id",
          "title",
          "description",
          "origin",
          "builtinCode",
          "achievementCount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный id набора."
          },
          "title": {
            "type": "string",
            "description": "Название, до 60 символов."
          },
          "description": {
            "type": "string",
            "description": "Описание, до 500 символов."
          },
          "origin": {
            "type": "string",
            "enum": [
              "builtin",
              "custom"
            ],
            "description": "builtin — стандартный набор поставки (название и удаление закрыты), custom — заведён компанией."
          },
          "builtinCode": {
            "type": "string",
            "nullable": true,
            "description": "Код стандартного набора (hrm_service); null у своих."
          },
          "achievementCount": {
            "type": "integer",
            "description": "Сколько ачивок набора видит вызывающий — по тому же праву, что и сам набор."
          }
        }
      },
      "GameAchievementSetsResponse": {
        "type": "object",
        "required": [
          "sets",
          "nextCursor"
        ],
        "properties": {
          "sets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAchievementSet"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "description": "Курсор следующей страницы; null — страница последняя."
          }
        }
      },
      "GameAchievementRule": {
        "type": "object",
        "description": "Исполняемое правило HRM: событие, порог, получатель и часы закреплены кодом; тексты — содержимое сервера на русском.",
        "required": [
          "code",
          "title",
          "conditionText",
          "eventKind",
          "threshold",
          "recipient",
          "clockRule",
          "repeatable",
          "points",
          "sourceState"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Код правила — значение ruleCode определения."
          },
          "title": {
            "type": "string",
            "description": "Название правила."
          },
          "conditionText": {
            "type": "string",
            "description": "Условие зачёта словами."
          },
          "eventKind": {
            "type": "string",
            "enum": [
              "P",
              "O",
              "H",
              "C"
            ],
            "description": "Событие: P — публикация вакансии, O — принятый оффер, H — наём, C — завершённое оформление."
          },
          "threshold": {
            "type": "integer",
            "description": "Сколько различных сущностей нужно одному сотруднику: 1 или 5."
          },
          "recipient": {
            "type": "string",
            "enum": [
              "vacancy_creator",
              "offer_creator",
              "vacancy_recruiter",
              "completion_actor"
            ],
            "description": "Кому засчитывается событие."
          },
          "clockRule": {
            "type": "string",
            "enum": [
              "enabled_intervals"
            ],
            "description": "Считаются только события внутри интервалов включения."
          },
          "repeatable": {
            "type": "boolean",
            "description": "Правило разовое: всегда false."
          },
          "points": {
            "type": "integer",
            "description": "Баллов вручение не даёт: всегда 0."
          },
          "sourceState": {
            "type": "string",
            "enum": [
              "ready",
              "not_connected",
              "unavailable"
            ],
            "description": "Готовность автоматического зачёта; not_connected — правило описано, но зачёт ещё не подключён."
          }
        }
      },
      "GameAchievementRulesResponse": {
        "type": "object",
        "required": [
          "rules"
        ],
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GameAchievementRule"
            }
          }
        }
      },
      "ApprovalRouteDuplicateRequest": {
        "type": "object",
        "description": "Название копии присылает клиент: сервер языка смотрящего не знает и подписать «Копия» по-человечески не может.",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255,
            "description": "Название копии; пустое или длиннее допустимого отклоняется."
          }
        }
      },
      "EmployeeProcessStage": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия шаблона между «Новым» и «Завершено». Ключ постоянен: переименование и смена тона его не меняют.",
        "required": [
          "key",
          "title",
          "tone",
          "description"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,64}$",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 64
          },
          "tone": {
            "type": "string",
            "enum": [
              "accent",
              "sky",
              "teal",
              "success",
              "yellow",
              "warning",
              "orange",
              "danger",
              "pink",
              "violet",
              "purple",
              "silver",
              "grey",
              "base"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 280
          }
        }
      },
      "EmployeeProcessStageInput": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия в теле сохранения. Ключ создаёт клиент; служебные _new, _done и _cancelled в формат не попадают.",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,64}$",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 64,
            "description": "При активации — непустое после обрезки пробелов."
          },
          "tone": {
            "type": "string",
            "enum": [
              "accent",
              "sky",
              "teal",
              "success",
              "yellow",
              "warning",
              "orange",
              "danger",
              "pink",
              "violet",
              "purple",
              "silver",
              "grey",
              "base",
              ""
            ],
            "description": "Пустое или отсутствующее значение — accent."
          },
          "description": {
            "type": "string",
            "maxLength": 280
          }
        }
      },
      "EmployeeProcessRetiredStage": {
        "type": "object",
        "additionalProperties": false,
        "description": "След удалённой стадии: процесс, стоящий в ней, показывается на стадии after. Следы ведёт сервер.",
        "required": [
          "key",
          "after"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,64}$",
            "maxLength": 64
          },
          "after": {
            "type": "string",
            "maxLength": 64,
            "description": "Ключ ближайшей предыдущей сохранившейся стадии, другого следа или _new."
          }
        }
      },
      "EmployeeProcessTemplateItemInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "instruction": {
            "type": "string",
            "maxLength": 16000
          },
          "group": {
            "type": "string",
            "maxLength": 255,
            "deprecated": true,
            "description": "Устаревшее поле: заменено стадиями. Сервер хранит и возвращает значение как получил; в стадии оно не превращается."
          },
          "assigneeRole": {
            "type": "string",
            "maxLength": 64
          },
          "controllerRole": {
            "type": "string",
            "maxLength": 64
          },
          "assigneeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "offsetDays": {
            "type": "integer",
            "minimum": -3650,
            "maximum": 3650
          },
          "durationDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "delayDays": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650
          },
          "predecessor": {
            "type": "string",
            "maxLength": 128
          },
          "workingDays": {
            "type": "boolean"
          },
          "requirements": {
            "$ref": "#/components/schemas/EmployeeProcessRequirementsInput"
          },
          "stageKey": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "description": "Ключ стадии пункта из stages; пустая строка — стадия «Новый». Отсутствует или null — пункт с ключом из прежней редакции сохраняет прежнюю стадию (если её удалили — ближайшую предыдущую сохранившуюся), новый пункт берёт стадию предыдущего пункта списка."
          }
        }
      },
      "EmployeeProcessManagementContextStage": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия копии процесса — для выбора стадии добавляемого пункта.",
        "required": [
          "key",
          "title",
          "tone"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,64}$",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 64
          },
          "tone": {
            "type": "string",
            "enum": [
              "accent",
              "sky",
              "teal",
              "success",
              "yellow",
              "warning",
              "orange",
              "danger",
              "pink",
              "violet",
              "purple",
              "silver",
              "grey",
              "base"
            ]
          }
        }
      },
      "EmployeeProcessHistoryStageRef": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия в событии process.advanced. Название замораживается на момент события; у _new и _done оно пустое — подпись берётся из каталога клиента.",
        "required": [
          "key",
          "title"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 64,
            "description": "Ключ стадии процесса: своя стадия или служебный ключ _new, _done."
          },
          "title": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "EmployeeProcessHistoryAdvance": {
        "type": "object",
        "additionalProperties": false,
        "description": "Ручной перевод процесса вперёд по доске: со стадии from на стадию to, пропущено skipped пунктов.",
        "required": [
          "processId",
          "processTitle",
          "from",
          "to",
          "skipped"
        ],
        "properties": {
          "processId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "processTitle": {
            "type": "string"
          },
          "from": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryStageRef"
          },
          "to": {
            "$ref": "#/components/schemas/EmployeeProcessHistoryStageRef"
          },
          "skipped": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessStageColumn": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия текущей редакции шаблона, в которой показывается процесс: своя стадия, «Новый» (_new) или «Завершено» (_done). У _new и _done название пустое — подпись выбирает вызывающий. Процесс из удалённой стадии шаблона показывается в стадии, после которой удалённая стояла; неизвестный ключ — в «Новом».",
        "required": [
          "key",
          "title",
          "tone"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^(_new|_done|[a-z0-9-]{1,64})$",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 64
          },
          "tone": {
            "type": "string",
            "enum": [
              "accent",
              "sky",
              "teal",
              "success",
              "yellow",
              "warning",
              "orange",
              "danger",
              "pink",
              "violet",
              "purple",
              "silver",
              "grey",
              "base"
            ]
          }
        }
      },
      "EmployeeProcessStageProgress": {
        "type": "object",
        "additionalProperties": false,
        "description": "Пункты собственной стадии процесса: done — выполненные и «Не требуется», total — все неотменённые.",
        "required": [
          "done",
          "total"
        ],
        "properties": {
          "done": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EmployeeProcessBoardTemplate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "state",
          "open"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "archived"
            ]
          },
          "open": {
            "type": "integer",
            "minimum": 0,
            "description": "Видимые процессы шаблона, кроме отменённых и процессов отменённых мета-процессов."
          }
        }
      },
      "EmployeeProcessBoardTemplateList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessBoardTemplate"
            }
          }
        }
      },
      "EmployeeProcessBoardColumn": {
        "type": "object",
        "additionalProperties": false,
        "description": "Стадия доски шаблона по текущей редакции. У _new и _done название и описание пустые.",
        "required": [
          "key",
          "title",
          "tone",
          "description",
          "count"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^(_new|_done|[a-z0-9-]{1,64})$",
            "maxLength": 64
          },
          "title": {
            "type": "string",
            "maxLength": 64
          },
          "tone": {
            "type": "string",
            "enum": [
              "accent",
              "sky",
              "teal",
              "success",
              "yellow",
              "warning",
              "orange",
              "danger",
              "pink",
              "violet",
              "purple",
              "silver",
              "grey",
              "base"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 280
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "Процессы стадии с учётом фильтров; совпадает с числом элементов всех порций /board/instances этой стадии."
          }
        }
      },
      "EmployeeProcessBoard": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "columns"
        ],
        "properties": {
          "columns": {
            "type": "array",
            "description": "«Новый», свои стадии шаблона по порядку, «Завершено».",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessBoardColumn"
            }
          }
        }
      },
      "EmployeeProcessBoardInstance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "metaId",
          "employeeId",
          "employeeName",
          "metaTitle",
          "scenario",
          "anchor",
          "coordinatorName",
          "state",
          "stageKey",
          "column",
          "stageEnteredAt",
          "stageProgress",
          "openTasks",
          "summary",
          "problems",
          "overdue",
          "help",
          "canManage",
          "zone"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "metaId": {
            "type": "string",
            "format": "uuid"
          },
          "employeeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "employeeName": {
            "type": "string"
          },
          "metaTitle": {
            "type": "string"
          },
          "scenario": {
            "type": "string"
          },
          "anchor": {
            "type": "string",
            "format": "date"
          },
          "coordinatorName": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "stageKey": {
            "type": "string",
            "maxLength": 64,
            "description": "Собственная стадия процесса из его копии: своя стадия, _new, _done или _cancelled."
          },
          "column": {
            "description": "Стадия доски, в которой показывается процесс; null — процесс отменён по сводке заданий. Выборка со stage доверяет сохранённому состоянию процесса: null в ней бывает только на несогласованных данных.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessStageColumn"
              },
              {
                "type": "null"
              }
            ]
          },
          "stageEnteredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Когда процесс вошёл в текущую стадию."
          },
          "stageProgress": {
            "$ref": "#/components/schemas/EmployeeProcessStageProgress"
          },
          "openTasks": {
            "type": "integer",
            "minimum": 0
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "problems": {
            "type": "integer",
            "minimum": 0,
            "description": "Незавершённые проблемные задания процесса по тому же предикату, что у заданий; у отменённого — 0."
          },
          "overdue": {
            "type": "integer",
            "minimum": 0,
            "description": "Открытые пункты процесса с истёкшим сроком (начавшиеся, срок прошёл) — признак «Просрочено: K» карточки; у отменённого — 0."
          },
          "help": {
            "type": "integer",
            "minimum": 0,
            "description": "Открытые пункты процесса с запросом помощи — признак «Нужна помощь» карточки; у отменённого — 0."
          },
          "canManage": {
            "type": "boolean"
          },
          "zone": {
            "type": "string",
            "maxLength": 128,
            "description": "Имя зоны IANA процесса, например Europe/Moscow: в ней показываются моменты карточки."
          }
        }
      },
      "EmployeeProcessBoardInstanceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmployeeProcessBoardInstance"
            }
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmployeeProcessInstanceListItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "templateId",
          "title",
          "revision",
          "state",
          "summary",
          "templateRevision",
          "controllerId",
          "roles",
          "stageKey",
          "column"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "templateId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/EmployeeProcessSummary"
          },
          "templateRevision": {
            "type": "integer",
            "minimum": 1
          },
          "controllerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "roles": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "participants": {
            "$ref": "#/components/schemas/EmployeeProcessRuntimeParticipants",
            "description": "Referenced current public names and role labels from this authorized runtime snapshot. Full meta detail and bounded instance pages include this optional projection. No directory defaults or private hire/result data."
          },
          "stageKey": {
            "type": "string",
            "maxLength": 64,
            "description": "Собственная стадия процесса из его копии: своя стадия, _new, _done или _cancelled."
          },
          "column": {
            "description": "Стадия текущей доски шаблона, в которой показывается процесс; null у отменённого процесса и у шаблона без своих стадий.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmployeeProcessStageColumn"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AppInterviewCancelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sendSms": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Только true разрешает СМС об отмене; отсутствие поля, false и null — без СМС."
          }
        }
      },
      "ApprovalRouteMember": {
        "type": "object",
        "description": "Участник шага: вид и ссылка своего вида — тот же публичный идентификатор, что принимает запись. roleCode и label — только чтение.",
        "required": [
          "kind",
          "userId",
          "b24UserId",
          "b24DeptId",
          "roleId",
          "roleCode",
          "label"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ],
            "description": "Вид участника. `user` — человек сервиса (userId), `b24_user` — человек Битрикс24 (b24UserId), `b24_dept_head` — руководитель отдела Битрикс24 (b24DeptId), `role` — носители роли портала (roleId), `author_dept_head` и `any_dept_head` — вычисляемые руководители, без ссылки."
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Адрес человека сервиса у вида `user`."
          },
          "b24UserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Идентификатор человека Битрикс24 у вида `b24_user`."
          },
          "b24DeptId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Идентификатор отдела Битрикс24 у вида `b24_dept_head`."
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Адрес роли портала у вида `role`."
          },
          "roleCode": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение: код системной роли (`hr`, `recruiter`…); null у собственной роли и у прочих видов."
          },
          "label": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение: подпись участника. Имя человека (`user`, `b24_user`) — только вызывающему с approval_route · edit и сессией по куке, ключу API и смотрящему без права — null при том же идентификаторе. Название отдела и собственной роли — всем; системную роль клиент подписывает по roleCode."
          }
        }
      },
      "ApprovalRouteMemberInput": {
        "type": "object",
        "description": "Участник шага в теле записи: вид и ссылка своего вида. Поля roleCode и label из ответа можно прислать как есть — они только для чтения и игнорируются. Ссылка, которой нет в портале, — 400 invalid_value с путём участника.",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ],
            "description": "Вид участника. `user` — человек сервиса (userId), `b24_user` — человек Битрикс24 (b24UserId), `b24_dept_head` — руководитель отдела Битрикс24 (b24DeptId), `role` — носители роли портала (roleId), `author_dept_head` и `any_dept_head` — вычисляемые руководители, без ссылки."
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Адрес человека сервиса у вида `user`."
          },
          "b24UserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Идентификатор человека Битрикс24 у вида `b24_user`."
          },
          "b24DeptId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Идентификатор отдела Битрикс24 у вида `b24_dept_head`."
          },
          "roleId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Адрес роли портала у вида `role`."
          },
          "roleCode": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          },
          "label": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          }
        }
      },
      "ApprovalRouteCondition": {
        "type": "object",
        "description": "Строка условия: поле каталога типа объекта (GET /api/v1/approval-routes/object-types), оператор и значение. Все строки шага — через «И»; шаг с ложным условием пропускается. Форма значения по виду поля: money — `{\"amount\": \"300000.00\", \"currency\": \"RUB\"}` (сумма строкой с двумя знаками; валюту ставит сервер, при записи она игнорируется); number — целое; enum — список строк из values каталога; department — список идентификаторов отделов Битрикс24; ref — список названий: должности (`position`) — как в /job-positions, причины (`open_reason`) — как в /vacancy-reasons?kind=open. Удалённая должность приходит значением `{\"missing\": true}`. При записи значение `{\"missing\": true}` отбрасывается из любого списка, не только у должности, а строка, в которой были значения и все оказались такими пометками, — целиком.",
        "required": [
          "field",
          "op",
          "value"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Ключ поля каталога. Открытая строка: перечень публикует каталог."
          },
          "op": {
            "type": "string",
            "description": "Оператор из ops поля каталога: `gte`, `lte` у money и number; `in`, `not_in` у enum, ref и department (у отдела — с подотделами)."
          },
          "value": {
            "description": "Значение; форма — по виду поля (см. описание схемы). `{\"missing\": true}` в списке при записи отбрасывается."
          }
        }
      },
      "ApprovalRouteStepView": {
        "description": "Шаг маршрута в ответе. Прежние поля (kind, userId, b24UserId, b24DeptId, roleCode) — субъект старой модели: первый участник, которого она выражает; у шага из одних собственных ролей — kind = role и roleCode = null. Новые поля: groupNo (шаги одного номера идут параллельно), rule, title, members, conditions.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ApprovalRouteStep"
          },
          {
            "type": "object",
            "required": [
              "groupNo",
              "rule",
              "title",
              "members",
              "conditions"
            ],
            "properties": {
              "groupNo": {
                "type": "integer",
                "minimum": 1,
                "description": "Группа шага с 1 по порядку; шаги одной группы стоят подряд и идут параллельно."
              },
              "rule": {
                "type": "string",
                "enum": [
                  "any",
                  "all"
                ],
                "description": "`any` — шаг закрывает решение любого участника, `all` — нужны решения всех."
              },
              "title": {
                "type": "string",
                "nullable": true,
                "description": "Название шага; null — не задано."
              },
              "members": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApprovalRouteMember"
                },
                "description": "Участники шага по порядку."
              },
              "conditions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApprovalRouteCondition"
                },
                "description": "Условия шага; пусто — шаг нужен всегда."
              }
            }
          }
        ]
      },
      "ApprovalRouteStepInput": {
        "type": "object",
        "description": "Шаг в теле POST /api/v1/approval-routes/full и PUT /api/v1/approval-routes/{id}. Шаги из ответа GET {id} годятся как есть: прежние поля (kind, userId, b24UserId, b24DeptId, roleCode) — только чтение и игнорируются. Номера групп — любые числа, шаги одной группы стоят подряд; сервер перенумерует группы с 1, позиции ставит по порядку в массиве. Обязательные groupNo, rule и members — без них 400 invalid_value с путём steps[i].groupNo, steps[i].rule или steps[i].members. В условиях значение `{\"missing\": true}` отбрасывается из любого списка; строка из одних таких пометок — целиком.",
        "required": [
          "groupNo",
          "rule",
          "members"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "Только чтение, игнорируется."
          },
          "userId": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          },
          "b24UserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          },
          "b24DeptId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          },
          "roleCode": {
            "type": "string",
            "nullable": true,
            "description": "Только чтение, игнорируется."
          },
          "groupNo": {
            "type": "integer",
            "description": "Группа шага."
          },
          "rule": {
            "type": "string",
            "enum": [
              "any",
              "all"
            ],
            "description": "`any` — достаточно одного решения, `all` — нужны все."
          },
          "title": {
            "type": "string",
            "nullable": true,
            "maxLength": 120,
            "description": "Название шага; null или пусто — без названия."
          },
          "members": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteMemberInput"
            },
            "description": "Участники без повторов, от 1 до 20."
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteCondition"
            },
            "maxItems": 8,
            "description": "Условия шага, до 8 строк, не больше двух строк на поле; во всех условиях маршрута — не больше 200 значений."
          }
        }
      },
      "ApprovalRouteStepWrite": {
        "description": "Шаг в теле прежней PUT .../steps. Читаются только прежние поля. Поля ответа (groupNo, rule, title, members, conditions) можно прислать как есть — они игнорируются и не читаются ни для записи, ни для отказа.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ApprovalRouteStep"
          },
          {
            "type": "object",
            "properties": {
              "groupNo": {
                "type": "integer",
                "description": "Только чтение, игнорируется."
              },
              "rule": {
                "type": "string",
                "enum": [
                  "any",
                  "all"
                ],
                "description": "Только чтение, игнорируется."
              },
              "title": {
                "type": "string",
                "nullable": true,
                "description": "Только чтение, игнорируется."
              },
              "members": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApprovalRouteMember"
                },
                "description": "Только чтение, игнорируется."
              },
              "conditions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ApprovalRouteCondition"
                },
                "description": "Только чтение, игнорируется."
              }
            }
          }
        ]
      },
      "ApprovalRouteCreateFullRequest": {
        "type": "object",
        "required": [
          "title",
          "objectType",
          "steps"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "objectType": {
            "type": "string",
            "description": "Ключ типа объекта из GET /api/v1/approval-routes/object-types."
          },
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteStepInput"
            },
            "description": "Шаги по порядку, от 1 до 32."
          },
          "makeDefault": {
            "type": "boolean",
            "description": "Сделать маршрутом по умолчанию своего типа в той же транзакции; прежнее умолчание снимается и остаётся в списке. Нет поля — false. С true новые заявки этого типа пойдут по этому маршруту, а не по прежнему: передавайте true только по явному решению пользователя."
          }
        }
      },
      "ApprovalRouteReplaceRequest": {
        "type": "object",
        "required": [
          "title",
          "version",
          "steps"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 255
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "description": "Версия из прочитанного маршрута; не совпала с хранимой — 409 route_conflict."
          },
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ApprovalRouteStepInput"
            },
            "description": "Шаги по порядку, от 1 до 32."
          }
        }
      },
      "ApprovalObjectField": {
        "type": "object",
        "description": "Поле каталога: по нему шаг получает условие.",
        "required": [
          "key",
          "kind",
          "ops",
          "options",
          "values"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Ключ поля — field строки условия."
          },
          "kind": {
            "type": "string",
            "description": "Вид значения: `money`, `number`, `enum`, `ref`, `department` (среди прочих — открытая строка). От него зависят форма значения и операторы."
          },
          "ops": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Допустимые операторы."
          },
          "options": {
            "type": "string",
            "description": "Источник значений: `positions` — названия должностей (/job-positions), `reasons` — названия причин открытия (/vacancy-reasons?kind=open), `departments` — отделы Битрикс24; пусто у прочих видов."
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Значения поля вида `enum`; у прочих — пусто."
          }
        }
      },
      "ApprovalObjectType": {
        "type": "object",
        "required": [
          "key",
          "fields"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Ключ типа — objectType маршрута."
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalObjectField"
            },
            "description": "Поля в порядке показа."
          }
        }
      },
      "ApprovalObjectTypesResponse": {
        "type": "object",
        "required": [
          "objectTypes"
        ],
        "properties": {
          "objectTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalObjectType"
            }
          }
        }
      },
      "ApprovalStepMember": {
        "type": "object",
        "additionalProperties": false,
        "description": "Участник шага круга по снимку отправки. Идентификатора наружу нет. Имя человека (`user`, `b24_user`) приходит, если вызывающему этот человек виден по праву portal_user · view — и кукой, и ключом API с этим правом; без права — только вид, name = null. У `b24_user` без пользователя сервиса имени нет. Отдел и собственная роль — название на момент отправки; системная роль — roleCode без имени (подписывает клиент).",
        "required": [
          "kind",
          "name",
          "roleCode"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "user",
              "b24_user",
              "b24_dept_head",
              "author_dept_head",
              "any_dept_head",
              "role"
            ],
            "description": "Вид участника, как в маршруте."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Подпись участника на момент отправки или null (см. описание схемы)."
          },
          "roleCode": {
            "type": "string",
            "nullable": true,
            "description": "Код системной роли (`hr`, `recruiter`…) у вида `role`; null у собственной роли и у прочих видов."
          }
        }
      },
      "ApprovalConditionFact": {
        "type": "object",
        "additionalProperties": false,
        "description": "Строка условия шага на момент отправки: условие, факт заявки и итог. Все строки шага — через «И»; шаг с ложной строкой пропущен (skipReason = condition_false). Форма value по виду поля каталога (GET /api/v1/approval-routes/object-types): money — `{\"amount\": \"300000.00\", \"currency\": \"RUB\"}`; number — целое; enum — список строк; department — список `{\"id\": <отдел Битрикс24>, \"name\": \"…\"}`; position и open_reason — список названий. Значения, которых на момент отправки уже не было в справочнике, не приходят. Вилка, скрытая от смотрящего, вырезает денежные строки целиком — см. conditionsMasked шага.",
        "required": [
          "field",
          "op",
          "value",
          "actual",
          "result"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Ключ поля каталога. Открытая строка: перечень публикует каталог."
          },
          "op": {
            "type": "string",
            "enum": [
              "gte",
              "lte",
              "in",
              "not_in"
            ],
            "description": "Оператор строки."
          },
          "value": {
            "description": "Значение условия; форма — по виду поля (см. описание схемы)."
          },
          "actual": {
            "description": "Значение поля в заявке на момент отправки — одиночное, той же формы, что элемент value (у money — объект суммы, у number — целое, у enum — строка). null — поле в заявке не задано (строка считалась истинной) или значение справочника на момент отправки уже не было живым и подписи не имеет."
          },
          "result": {
            "type": "boolean",
            "description": "Итог строки при отправке."
          }
        }
      },
      "ApprovalStepDecision": {
        "type": "object",
        "additionalProperties": false,
        "description": "Решение одного человека в шаге «Нужны все» (rule = all). Идентификатора человека наружу нет: решивший назван строкой decidedBy — по тому же правилу и в той же форме, что decidedBy шага.",
        "required": [
          "decidedBy",
          "state",
          "decidedAt",
          "comment"
        ],
        "properties": {
          "decidedBy": {
            "type": "string",
            "description": "Кто решил: «Фамилия Имя», как decidedBy шага. Приходит любому смотрящему круга — решившие в круге и есть его согласующие."
          },
          "state": {
            "type": "string",
            "enum": [
              "approved",
              "rejected"
            ]
          },
          "decidedAt": {
            "type": "string",
            "format": "date-time"
          },
          "comment": {
            "type": "string",
            "nullable": true,
            "description": "Причина решения; у отказа непуста всегда."
          }
        }
      },
      "CompanySyncAddress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ADDRESS_1": {
            "type": "string",
            "maxLength": 255
          },
          "ADDRESS_2": {
            "type": "string",
            "maxLength": 255
          },
          "CITY": {
            "type": "string",
            "maxLength": 255
          },
          "POSTAL_CODE": {
            "type": "string",
            "maxLength": 255
          },
          "REGION": {
            "type": "string",
            "maxLength": 255
          },
          "PROVINCE": {
            "type": "string",
            "maxLength": 255
          },
          "COUNTRY": {
            "type": "string",
            "maxLength": 255
          },
          "COUNTRY_CODE": {
            "type": "string",
            "maxLength": 255
          },
          "LOC_ADDR_ID": {
            "type": "integer",
            "minimum": 0,
            "description": "Read-only passthrough identity. Must equal server-owned snapshot of the exact address in current binding generation; mismatch rejects before any mutation/outbox/network. No client-selected Location identity."
          }
        },
        "required": [
          "ADDRESS_1",
          "ADDRESS_2",
          "CITY",
          "POSTAL_CODE",
          "REGION",
          "PROVINCE",
          "COUNTRY",
          "COUNTRY_CODE",
          "LOC_ADDR_ID"
        ]
      },
      "HHVersion": {
        "type": "string",
        "pattern": "^[0-9]+$",
        "description": "Unsigned snapshot version as a decimal string; no JavaScript precision loss."
      },
      "HHSelectionStatus": {
        "type": "string",
        "enum": [
          "none",
          "verified",
          "legacy",
          "unavailable",
          "missing"
        ]
      },
      "HHIssueParams": {
        "type": "object",
        "required": [],
        "properties": {
          "used": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          },
          "min": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          },
          "max": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          },
          "delta": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          }
        },
        "additionalProperties": false
      },
      "HHIssue": {
        "type": "object",
        "required": [
          "category",
          "field",
          "reason",
          "params",
          "diagnosticCode"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "field",
              "general"
            ]
          },
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string"
          },
          "params": {
            "$ref": "#/components/schemas/HHIssueParams"
          },
          "diagnosticCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_.:/-]{1,64}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "HHEvaluation": {
        "type": "object",
        "required": [
          "contextKey",
          "clientSerial",
          "contentVersion",
          "contentHash",
          "used",
          "min",
          "max",
          "conditionsVersion",
          "testsVersion",
          "expiresAt",
          "ready",
          "selectionStatus",
          "issues"
        ],
        "properties": {
          "contextKey": {
            "type": "string",
            "pattern": "^([0-9a-f]{64})?$",
            "description": "Empty when no usable server context exists."
          },
          "clientSerial": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          },
          "contentVersion": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "SHA-256 of canonical effective input, baseline, context and selection provenance."
          },
          "contentHash": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "SHA-256 context or content key in hexadecimal."
          },
          "used": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18446744073709552000
              },
              {
                "type": "null"
              }
            ]
          },
          "min": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18446744073709552000
              },
              {
                "type": "null"
              }
            ]
          },
          "max": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18446744073709552000
              },
              {
                "type": "null"
              }
            ]
          },
          "conditionsVersion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HHVersion"
              },
              {
                "type": "null"
              }
            ]
          },
          "testsVersion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HHVersion"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "ready": {
            "type": "boolean"
          },
          "selectionStatus": {
            "$ref": "#/components/schemas/HHSelectionStatus"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HHIssue"
            }
          }
        },
        "additionalProperties": false
      },
      "HHLastRefusal": {
        "type": "object",
        "required": [
          "attemptAt",
          "accountId",
          "contentHash",
          "contextKey",
          "errorCode",
          "errorText",
          "historicalOnly"
        ],
        "properties": {
          "attemptAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "contentHash": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-fA-F]{64}$",
                "description": "SHA-256 context or content key in hexadecimal."
              },
              {
                "type": "null"
              }
            ]
          },
          "contextKey": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-fA-F]{64}$",
                "description": "SHA-256 context or content key in hexadecimal."
              },
              {
                "type": "null"
              }
            ]
          },
          "errorCode": {
            "type": "string"
          },
          "errorText": {
            "type": "string"
          },
          "historicalOnly": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Optional causal refusal metadata; publication edit plus vacancy visibility required. Legacy or incomplete binding has null identifiers/timestamp and historicalOnly=true. Unknown outcome remains historical; metadata never grants a retry."
      },
      "HHPublicationContext": {
        "type": "object",
        "required": [
          "key",
          "companyId",
          "accountId",
          "employerId"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "SHA-256 context or content key in hexadecimal."
          },
          "companyId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "accountId": {
            "type": "string"
          },
          "employerId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HHBaseline": {
        "type": "object",
        "required": [
          "membershipRevision",
          "updatedAt",
          "baseProfession"
        ],
        "properties": {
          "membershipRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 18446744073709552000
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "baseProfession": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "HHSelection": {
        "type": "object",
        "required": [
          "id",
          "title",
          "required",
          "status"
        ],
        "properties": {
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "required": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/HHSelectionStatus"
          }
        },
        "additionalProperties": false
      },
      "HHPublicationContextResponse": {
        "type": "object",
        "required": [
          "code",
          "context",
          "baseline",
          "selection"
        ],
        "properties": {
          "code": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "hh_context_unavailable"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HHPublicationContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "baseline": {
            "$ref": "#/components/schemas/HHBaseline"
          },
          "selection": {
            "$ref": "#/components/schemas/HHSelection"
          },
          "hhLastRefusal": {
            "$ref": "#/components/schemas/HHLastRefusal"
          }
        },
        "additionalProperties": false
      },
      "HHPublicationConditions": {
        "type": "object",
        "required": [
          "contextKey",
          "status",
          "version",
          "fetchedAt",
          "expiresAt",
          "code",
          "retryable",
          "min",
          "max"
        ],
        "properties": {
          "contextKey": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "SHA-256 context or content key in hexadecimal."
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "unavailable"
            ]
          },
          "version": {
            "$ref": "#/components/schemas/HHVersion"
          },
          "fetchedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "min": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18446744073709552000
              },
              {
                "type": "null"
              }
            ]
          },
          "max": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 18446744073709552000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "HHTest": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9]{1,64}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "additionalProperties": false
      },
      "HHPublicationTests": {
        "type": "object",
        "required": [
          "contextKey",
          "status",
          "version",
          "fetchedAt",
          "expiresAt",
          "code",
          "retryable",
          "complete",
          "items"
        ],
        "properties": {
          "contextKey": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "SHA-256 context or content key in hexadecimal."
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "unavailable"
            ]
          },
          "version": {
            "$ref": "#/components/schemas/HHVersion"
          },
          "fetchedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "RFC3339 UTC timestamp."
              },
              {
                "type": "null"
              }
            ]
          },
          "code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "complete": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "maxItems": 5000,
            "items": {
              "$ref": "#/components/schemas/HHTest"
            }
          }
        },
        "additionalProperties": false
      },
      "HHError": {
        "type": "object",
        "description": "Отказ. Внутренних подробностей здесь нет: текст ошибки базы — это подсказка о схеме, и в ответе ей не место.",
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Машиночитаемая причина. Различает исходы, у которых совпал HTTP-код."
          },
          "message": {
            "type": "string",
            "description": "Заранее написанный текст для человека."
          },
          "retryable": {
            "type": "boolean",
            "description": "Пройдёт ли тот же запрос при повторе без изменений. Поле обязательное: клиент, отличающий false от «не прислали», начинает угадывать по HTTP-коду."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Машиночитаемое уточнение: имя поля формы, лимит, срок. Свободного текста здесь не бывает, для человека есть message.",
            "properties": {
              "hhIssues": {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "$ref": "#/components/schemas/HHIssue"
                }
              },
              "evaluation": {
                "$ref": "#/components/schemas/HHEvaluation"
              }
            }
          }
        }
      },
      "PublicRejectionComment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "revision",
          "comment"
        ],
        "properties": {
          "episodeId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "uint64",
            "minimum": 1
          },
          "comment": {
            "type": "string",
            "nullable": true,
            "maxLength": 4000
          },
          "commentUnreadable": {
            "type": "boolean",
            "description": "Stored ciphertext cannot be read. comment is null and must not trigger an automatic clear. Only present as true."
          }
        }
      },
      "PublicRejectionCommentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "episodeId",
          "expectedRevision",
          "comment"
        ],
        "properties": {
          "episodeId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "uint64",
            "minimum": 1
          },
          "comment": {
            "type": "string",
            "maxLength": 4000,
            "description": "Whitespace is trimmed; an empty value explicitly clears the public comment."
          }
        }
      },
      "AvitoCatalogRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestKey"
        ],
        "properties": {
          "requestKey": {
            "type": "string",
            "format": "uuid",
            "description": "Nonzero UUID scoped to the authenticated original principal. Reuse the same key when the response is lost."
          }
        }
      },
      "AvitoCatalogRetryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestKey",
          "failureRef"
        ],
        "properties": {
          "requestKey": {
            "type": "string",
            "format": "uuid",
            "description": "Nonzero UUID scoped to the authenticated original principal. Reuse the same key when the response is lost."
          },
          "failureRef": {
            "type": "string",
            "format": "uuid",
            "description": "The completed cold-load failure being retried. At most one explicit retry bypasses its shared cooldown."
          }
        }
      },
      "AvitoCatalogStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "available",
          "generation",
          "failureRef",
          "nextAttemptAt",
          "retryAfterSeconds"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "updating",
              "empty",
              "failed",
              "waiting"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "A previously committed full snapshot remains usable even while updating or after failure."
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "failureRef": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Opaque reference to a completed failure; no initiating portal, user or account identifiers."
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "retryAfterSeconds": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ApplicationReviewRunOne": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "description": "ИИ-анализ одного отклика. Своя схема, а не ReviewRun: у разбора стадии числа и idle, а queued сливается с running.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "description": "queued — в очереди, running — идёт, done — предложение легло, failed — отказ, причина в reason. Пока queued или running, экран опрашивает отклик."
          },
          "reason": {
            "type": "string",
            "enum": [
              "ai_not_connected",
              "ai_key_dead",
              "ai_scope_missing",
              "ai_quota",
              "ai_unavailable",
              "timeout",
              "internal",
              "reply_invalid",
              "portrait_changed",
              "left_stage",
              "doc_unreadable",
              "resume_url_rejected",
              "resume_route_unsupported",
              "resume_access_required",
              "resume_access_denied",
              "resume_unavailable",
              "resume_format_unsupported",
              "resume_unreadable",
              "resume_resource_limit",
              "resume_input_too_large",
              "resume_unsafe_content",
              "resume_source_changed"
            ],
            "description": "Код причины у failed; у прочих поля нет. ai_* — отказ модели или ключа, timeout — вышел бюджет шага или анализ завис, reply_invalid — ответ модели не разобрался, portrait_changed — основная версия портрета сменилась, пока модель думала, left_stage — анализ не лёг: у отклика уже есть анализ новее, у него разбор прежней доски «Собеседования» или «Оффера» либо отклик стёрт; анализ закрытой стадии (interview, offer), поставленный до выката, закрывается этим кодом без вызова модели, doc_unreadable — документ портрета или брифа не читается, internal — прочая ошибка. Неизвестный код показывается как есть. resume_* — отказ подготовки резюме до модели и без новой оценки; прежняя оценка сохраняется отдельно."
          }
        }
      },
      "LinkChannel": {
        "type": "string",
        "description": "Канал отправки ссылки кандидату. telegram, max и avito_chat пока только вариант с причиной soon: отправки по ним нет.",
        "enum": [
          "email",
          "sms",
          "hh_chat",
          "telegram",
          "max",
          "avito_chat"
        ]
      },
      "LinkOutcome": {
        "type": "string",
        "description": "Исход попытки: queued — в очереди; sent — ушла; failed — не ушла, причина в failure; unknown — неизвестно, ушла ли; superseded — погашена перевыпуском ссылки, не успех и не неудача. Успех — только sent.",
        "enum": [
          "queued",
          "sent",
          "failed",
          "unknown",
          "superseded"
        ]
      },
      "LinkFailure": {
        "type": "string",
        "description": "Причина неудачи попытки с исходом failed. Набор расширяется: неизвестное значение клиент показывает общим текстом.",
        "enum": [
          "rejected",
          "unroutable",
          "subject_gone",
          "not_configured",
          "unavailable",
          "quota",
          "no_effect",
          "internal"
        ]
      },
      "LinkChatState": {
        "type": "object",
        "description": "Что отправка вариантом сделает с чатом кандидата в Битрикс24. Чтение локальное: без запросов в Битрикс24 и без записи.",
        "required": [
          "state",
          "reason",
          "emailToo",
          "superseded",
          "skip"
        ],
        "properties": {
          "state": {
            "$ref": "#/components/schemas/LinkChatStateCode"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinkChatReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина blocked и unavailable. У blocked — только смотрящему, которому видны причины квитанций Битрикс24 (чтение отклика, у документов — чтение оформления), иначе null; null и у прочих состояний."
          },
          "emailToo": {
            "type": "boolean",
            "description": "У blocked: подготовке к тому же нужна почта кандидата — её спросят при отправке."
          },
          "superseded": {
            "type": "boolean",
            "description": "Текущее поколение уже в чате, а отправка этим вариантом выпускает новое: прежняя ссылка в чате перестанет действовать."
          },
          "skip": {
            "type": "boolean",
            "description": "У blocked: отправка документов или быстрая отправка встречи пропустит чат, выбранный канал уйдёт сразу. Виден и тому, кому причина не видна; у прочих состояний false."
          }
        }
      },
      "LinkChatStateCode": {
        "type": "string",
        "enum": [
          "unavailable",
          "closed",
          "skipped",
          "blocked",
          "email_required",
          "again",
          "ready",
          "prepare",
          "unknown"
        ],
        "description": "Что отправка сделает с чатом кандидата в Битрикс24, первое подходящее по приоритету. unavailable — команда предмета отказывает (причина в reason: у приглашения — причины учётки, у форм — candidate_employee); closed — работа Битрикс24 не будет записана, а предмет отправку принимает (встреча без отклика); skipped — ранее выбрано «продолжить без Битрикс24»; blocked — работа будет записана, но локально известно препятствие, на котором подготовка или чат остановятся (причина в reason); email_required — для входа на портал нужна почта кандидата, её спросят при отправке; again — эта цель уже уходила в текущий чат кандидата; ready — учётка и чат есть; prepare — учётки или чата нет, подготовка возможна; unknown — прочитать чат не удалось, исход будет виден после отправки. Набор расширяется: неизвестное значение клиент показывает общим текстом."
      },
      "LinkChatReason": {
        "type": "string",
        "enum": [
          "personal_webhook_missing",
          "chat_prepare_forbidden",
          "binding_unconfirmed",
          "account_stopped",
          "account_legacy",
          "chat_not_ready",
          "account_deleted",
          "invite_forbidden",
          "account_unconfirmed",
          "account_type_changed",
          "account_contact_changed",
          "account_inactive",
          "account_in_groups",
          "account_network_broken",
          "bot_disabled",
          "account_not_ready",
          "account_email_changed",
          "candidate_employee",
          "forbidden"
        ],
        "description": "Причина blocked и unavailable — машинным кодом. blocked: personal_webhook_missing — у отправляющего нет личного вебхука; chat_prepare_forbidden — подготовить чат может сотрудник с доступом к кандидату и отклику, а у отправляющего нет права правки кандидата или доступа к кандидату и отклику; binding_unconfirmed — привязка учётки не подтверждена; account_stopped — доступ кандидата остановлен; account_legacy — учётка прежнего вида; chat_not_ready — чат ещё не готов, подготовить его может сотрудник, который пригласил кандидата; account_deleted — учётку удалили; invite_forbidden — учётку не завёл модуль: у отправляющего нет права приглашать пользователей на портал; account_unconfirmed — учётка не подтверждена; account_type_changed, account_contact_changed, account_inactive, account_in_groups, account_network_broken — последнее чтение учётки её отвергло; bot_disabled — бот портала выключен. unavailable: account_not_ready, account_email_changed — те же причины учётки, что у вариантов приглашения; candidate_employee — кандидат переведён в сотрудники, сообщения кандидата ему не отправляются (так отвечают формы; окна отправки ссылки отвечают 409 candidate_employee). Набор расширяется: неизвестное значение клиент показывает общим текстом."
      },
      "LinkDeliverySummary": {
        "type": "object",
        "description": "Сводка отправки ссылки в строке списка, без адресов.",
        "required": [
          "delivered",
          "last"
        ],
        "properties": {
          "delivered": {
            "anyOf": [
              {
                "type": "object",
                "description": "Первая успешная отправка.",
                "required": [
                  "at",
                  "channel"
                ],
                "properties": {
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Момент успеха, UTC."
                  },
                  "channel": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/LinkChannel"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "manual"
                        ]
                      }
                    ],
                    "description": "Канал; manual — «Передал сам»."
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Самый ранний успешный факт; null — успеха ещё нет."
          },
          "last": {
            "anyOf": [
              {
                "type": "object",
                "description": "Последняя попытка.",
                "required": [
                  "channel",
                  "outcome",
                  "at",
                  "failure"
                ],
                "properties": {
                  "channel": {
                    "$ref": "#/components/schemas/LinkChannel"
                  },
                  "outcome": {
                    "$ref": "#/components/schemas/LinkOutcome"
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Момент постановки попытки, UTC."
                  },
                  "failure": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/LinkFailure"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Причина неудачи; не null только при outcome=failed."
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Последняя попытка по очереди и переписке hh; отметка «Передал сам» попыткой не считается."
          }
        }
      },
      "OrderCancellation": {
        "type": "object",
        "required": [
          "reason",
          "by",
          "at"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "description": "Причина отмены словами кадровика."
          },
          "by": {
            "type": "string",
            "description": "ФИО того, кто отменил."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderCorrection": {
        "type": "object",
        "required": [
          "oldNumber",
          "oldIssuedOn",
          "newNumber",
          "newIssuedOn",
          "oldKind",
          "newKind",
          "subjectChanged",
          "oldSubjectName",
          "newSubjectName",
          "by",
          "at"
        ],
        "description": "Одно исправление ошибки ввода: было → стало, кто и когда. Номер и дата — парой всегда: после нескольких исправлений прежний реквизит из одних «стало» не восстановить. Вид и «о ком» — парой только у исправления, которое их меняло: строка истории называет то, что исправили.",
        "properties": {
          "oldNumber": {
            "type": "string"
          },
          "oldIssuedOn": {
            "type": "string",
            "format": "date"
          },
          "newNumber": {
            "type": "string"
          },
          "newIssuedOn": {
            "type": "string",
            "format": "date"
          },
          "oldKind": {
            "type": "string",
            "enum": [
              "t6",
              "t6a",
              "free"
            ],
            "nullable": true,
            "description": "Вид до исправления; null — исправление вид не меняло."
          },
          "newKind": {
            "type": "string",
            "enum": [
              "t6",
              "t6a",
              "free"
            ],
            "nullable": true,
            "description": "Вид после исправления; null — исправление вид не меняло."
          },
          "subjectChanged": {
            "type": "boolean",
            "description": "Менялся ли «о ком»."
          },
          "oldSubjectName": {
            "type": "string",
            "nullable": true,
            "description": "ФИО того, о ком приказ был до исправления; null — «о ком» не менялся или приказ был на нескольких."
          },
          "newSubjectName": {
            "type": "string",
            "nullable": true,
            "description": "ФИО того, о ком приказ стал; null — «о ком» не менялся или приказ стал на нескольких."
          },
          "by": {
            "type": "string",
            "description": "ФИО того, кто исправил."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderFixRequest": {
        "type": "object",
        "description": "Исправление ошибки ввода в сервисе. Поле не прислано — не трогается; нужно хотя бы одно из number, issuedOn, kind, subject. Приказ, который изменили или отменили в компании, не исправляют, а отменяют и заводят новый.",
        "properties": {
          "number": {
            "type": "string",
            "maxLength": 32,
            "description": "Новый номер из книги приказов компании."
          },
          "issuedOn": {
            "type": "string",
            "format": "date",
            "description": "Новая дата приказа."
          },
          "kind": {
            "type": "string",
            "enum": [
              "t6",
              "t6a",
              "free"
            ],
            "description": "Новый вид приказа. Только подходящий строкам графика: где приказ стоит приказом о предоставлении отпуска — t6 или t6a (иначе order_kind_grant), где основанием переноса — free (иначе order_kind_move)."
          },
          "subject": {
            "type": "string",
            "description": "Новый «о ком» — адрес работника (format uuid); пустая строка — приказ на нескольких (требует personnel_order · edit уровня «все»). Работник проходит проверки заведения: попадает в уровни personnel_order · edit и view пишущего (иначе not_found — тот же ответ, что на работника, которого нет) и состоит в юрлице книги на дату приказа (иначе not_in_entity)."
          },
          "unlinkRows": {
            "type": "boolean",
            "description": "Согласие снять связь со строками графика, которым приказ после смены «о ком» больше не подходит. Без него такое исправление ничего не пишет и отвечает order_unlinks_rows с числом строк в details.rows."
          }
        }
      },
      "OrderCancelRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 255,
            "description": "Почему приказ отменяют. Обязательна: отмена без причины через год читается как попытка спрятать документ."
          }
        }
      },
      "OfferActionPrepareRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "responseId"
        ],
        "properties": {
          "responseId": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "MintedLink": {
        "type": "object",
        "description": "An admitted result of a link operation. May contain a sensitive personalized exact-action credential or a legacy contact-authenticated URL. A legacy/public URL never authorizes first-email registration or independent B24 identity.",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "Use the URL returned by the admitted operation; do not substitute a native/public URL or log it."
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Срок действия ссылки."
          },
          "b24": {
            "$ref": "#/components/schemas/CandidateB24OutboundReceipt"
          }
        }
      },
      "LinkMintRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "intentId"
        ],
        "properties": {
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "$ref": "#/components/schemas/CandidateB24EmailDecision",
            "description": "Optional outbound email decision; the server uses saved when omitted."
          }
        }
      },
      "CallPlanCriterion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1
          }
        },
        "required": [
          "text"
        ]
      },
      "CallPlanQuestion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "text": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1
          },
          "required": {
            "type": "boolean"
          },
          "hint": {
            "type": "string",
            "maxLength": 2000
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanCriterion"
            },
            "maxItems": 10,
            "minItems": 1
          }
        },
        "required": [
          "text",
          "required",
          "criteria"
        ]
      },
      "CallPlanSection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanQuestion"
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "required": [
          "name",
          "questions"
        ]
      },
      "CallPlanDepartment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CallPlanContent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanDepartment"
            },
            "maxItems": 100
          },
          "roleLabels": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            },
            "maxItems": 20
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanSection"
            },
            "maxItems": 20,
            "minItems": 1
          }
        },
        "required": [
          "name",
          "departments",
          "roleLabels",
          "sections"
        ],
        "description": "Нормализованное UTF-8 JSON не более 512 KiB; до 100 вопросов суммарно. Пустые новые id сервер выдаёт сам. Существующие id принадлежат этому плану; копирование проверяет исходную версию и выдаёт новые id с серверным происхождением."
      },
      "CallPlanVersion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "content": {
            "$ref": "#/components/schemas/CallPlanContent"
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "planId",
          "number",
          "content",
          "createdBy",
          "createdAt"
        ]
      },
      "CallPlan": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "archived": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currentVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/CallPlanVersion"
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sourcePlanId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "presetVersion": {
            "type": "string",
            "maxLength": 100
          },
          "selectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "id",
          "name",
          "archived",
          "revision",
          "currentVersionId",
          "version",
          "createdBy",
          "createdAt"
        ]
      },
      "CallPlanSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 2000
          },
          "archived": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "currentVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanDepartment"
            },
            "maxItems": 100
          },
          "roleLabels": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200
            },
            "maxItems": 20
          },
          "recommended": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "archived",
          "revision",
          "currentVersionId",
          "departments",
          "roleLabels",
          "recommended"
        ]
      },
      "CallPlanPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanSummary"
            },
            "maxItems": 50
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "items"
        ]
      },
      "CallPlanVersionPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanVersionSummary"
            },
            "maxItems": 50
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 100
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "items"
        ]
      },
      "CallPlanSelection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "selectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "currentVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "plan": {
            "$ref": "#/components/schemas/CallPlan"
          }
        },
        "required": [
          "selectionRevision"
        ]
      },
      "CallPlanDescriptor": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/CallPlan"
          },
          "preset": {
            "$ref": "#/components/schemas/CallPlanContent"
          },
          "presetVersion": {
            "type": "string",
            "maxLength": 100
          },
          "basis": {
            "type": "string",
            "enum": [
              "inherited",
              "default"
            ],
            "readOnly": true
          }
        },
        "required": [],
        "description": "GET не создаёт записи. Если активного резервного плана нет, preset несёт поставляемое содержимое без постоянных id. Сохранение вакансии/шаблона материализует одну общую копию портала в той же транзакции."
      },
      "CallPlanSaveRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/CallPlanContent"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "vacancyId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedSelectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "content",
          "expectedRevision",
          "commandKey"
        ],
        "description": "До 1 MiB. Новая запись ожидает revision=0. vacancyId допустим только при создании; создание и выбор атомарны, с проверкой vacancy.view/edit. Ключ команды привязан к порталу, человеку, API-ключу и виду команды; квитанция хранится вместе с историей без истечения, повтор тела возвращает прежний исход."
      },
      "CallPlanCopyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "content": {
            "$ref": "#/components/schemas/CallPlanContent"
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "vacancyId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedSelectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "sourceVersionId",
          "content",
          "commandKey"
        ],
        "description": "Копирует явно указанную неизменяемую версию, в том числе архивного плана. Новые вопросы и критерии получают собственные id; сервер сохраняет происхождение. При vacancyId копия и выбор атомарны."
      },
      "CallPlanArchiveRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "archived": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "archived",
          "expectedRevision",
          "commandKey"
        ]
      },
      "CallPlanSelectRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "planId",
          "expectedRevision",
          "commandKey"
        ]
      },
      "CallPlanChange": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "previousPlanId": {
            "type": "string",
            "format": "uuid"
          },
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "previousVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          },
          "previousName": {
            "type": "string",
            "maxLength": 200
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "changedBy": {
            "type": "string",
            "format": "uuid"
          },
          "changedAt": {
            "type": "string",
            "format": "date-time"
          },
          "origin": {
            "type": "string",
            "enum": [
              "explicit",
              "vacancy_template",
              "portal_default",
              "manual"
            ],
            "description": "Доверенный источник события: explicit — явный выбор при создании; vacancy_template — наследование исходного шаблона; portal_default — автоматический резервный план; manual — последующая ручная смена, включая создание/копирование и выбор. У прежних событий без известного источника поле отсутствует; текущий выбор не используется для его восстановления."
          },
          "sourceTemplateId": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный ID исходного шаблона вакансии при создании через шаблон/заявку, в том числе при явном выборе или резервном плане вместо архивного. Проверяется сервером в портале и сохраняется в зашифрованном событии, не принимается от клиента."
          }
        },
        "required": [
          "revision",
          "planId",
          "versionId",
          "name",
          "changedBy",
          "changedAt"
        ]
      },
      "CallPlanHistoryPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallPlanChange"
            },
            "maxItems": 50
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 100
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "items"
        ]
      },
      "CallPlanVersionSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "planId",
          "number",
          "createdBy",
          "createdAt"
        ]
      },
      "CallPlanDepartmentChoice": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "path": {
            "type": "string",
            "maxLength": 512
          }
        },
        "required": [
          "id",
          "name",
          "path"
        ]
      },
      "CallPlanDepartmentPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/CallPlanDepartmentChoice"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        },
        "required": [
          "items"
        ]
      },
      "CallComparisonActivateInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string"
          },
          "expectedRevisionId": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "revisionId": {
            "type": "string"
          }
        },
        "required": [
          "commandKey",
          "expectedRevisionId",
          "revisionId",
          "reason"
        ],
        "type": "object"
      },
      "CallComparisonAttempt": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "effectiveRevisionId": {
            "type": "string"
          },
          "errorCode": {
            "type": "string",
            "description": "Why the attempt ended without a result; a code without a closed list. Among others: timeout, ai_key_dead, ai_not_connected, invalid_output, access_revoked, evidence_withdrawn (also on a cancelled attempt), processing_failed, and vacancy_archived: the vacancy was archived after the attempt was queued, so the attempt failed and its revision was not published."
          },
          "expectedRevisionId": {
            "type": "string"
          },
          "finishedAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "needsReview": {
            "type": "boolean"
          },
          "parserVersion": {
            "type": "string"
          },
          "promptVersion": {
            "type": "string"
          },
          "revisionId": {
            "type": "string"
          },
          "scopeId": {
            "type": "string"
          },
          "scopeSequence": {
            "format": "int64",
            "type": "integer"
          },
          "startedAt": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "selectionBasis": {
            "type": "string",
            "enum": [
              "current_selection",
              "historical_retry"
            ]
          },
          "actorId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "readOnly": true,
            "description": "Автор события, когда он известен; системное или прежнее событие может не содержать автора."
          },
          "planName": {
            "type": "string",
            "readOnly": true
          },
          "planVersionNumber": {
            "type": "integer",
            "minimum": 1,
            "readOnly": true
          },
          "sourceCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "readOnly": true
          }
        },
        "required": [
          "id",
          "scopeId",
          "scopeSequence",
          "state",
          "createdAt",
          "needsReview",
          "model",
          "promptVersion",
          "parserVersion",
          "commandKey",
          "selectionBasis"
        ],
        "type": "object",
        "description": "Queued at most 30 minutes; execution at most 30 minutes; lease 2 minutes, heartbeat every 30 seconds. One running attempt per portal under transactional claim. The previous effective result survives failures and retries. A candidate needs explicit activation if a human revision or cross-scope withdrawal intervenes."
      },
      "CallComparisonAttribution": {
        "additionalProperties": false,
        "properties": {
          "departmentId": {
            "type": "string"
          },
          "provenance": {
            "type": "string",
            "enum": [
              "source",
              "human_confirmation",
              "inferred_current",
              "unknown"
            ]
          },
          "recruiterId": {
            "type": "string"
          }
        },
        "required": [
          "provenance"
        ],
        "type": "object"
      },
      "CallComparisonContradiction": {
        "additionalProperties": false,
        "properties": {
          "criterionIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "duplicateOf": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "observationIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "questionIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reason": {
            "type": "string"
          },
          "resolutionObservationIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "observationIds",
          "questionIds",
          "criterionIds",
          "description",
          "state",
          "resolutionObservationIds"
        ],
        "type": "object"
      },
      "CallComparisonCriterion": {
        "additionalProperties": false,
        "properties": {
          "fingerprint": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "text",
          "fingerprint"
        ],
        "type": "object"
      },
      "CallComparisonDetail": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "$ref": "#/components/schemas/CallComparisonAttempt"
          },
          "effectiveRevision": {
            "$ref": "#/components/schemas/CallComparisonRevision"
          },
          "input": {
            "$ref": "#/components/schemas/CallComparisonInput"
          },
          "revision": {
            "$ref": "#/components/schemas/CallComparisonRevision"
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "attempt",
          "input"
        ],
        "type": "object",
        "description": "One frozen plan/question/source manifest, the immutable AI attempt revision and current effective revision. Source bodies are omitted; use the exact source-version endpoint. Deleted sources sanitize all affected historical facts; unaffected questions remain readable."
      },
      "CallComparisonEvidence": {
        "additionalProperties": false,
        "properties": {
          "contentVersionId": {
            "type": "string"
          },
          "end": {
            "format": "int64",
            "type": "integer",
            "minimum": 1
          },
          "key": {
            "type": "string"
          },
          "metadataRevisionId": {
            "type": "string"
          },
          "quote": {
            "type": "string"
          },
          "segmentId": {
            "type": "string"
          },
          "sourceVersionId": {
            "type": "string"
          },
          "start": {
            "format": "int64",
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "key",
          "sourceVersionId",
          "contentVersionId",
          "metadataRevisionId",
          "segmentId",
          "start",
          "end",
          "quote"
        ],
        "type": "object"
      },
      "CallComparisonFactTime": {
        "additionalProperties": false,
        "properties": {
          "offsetSeconds": {
            "format": "int64",
            "type": "integer"
          },
          "precision": {
            "type": "string",
            "enum": [
              "unknown",
              "day",
              "instant"
            ]
          },
          "provenance": {
            "type": "string",
            "enum": [
              "source",
              "human_confirmation",
              "unknown"
            ]
          },
          "value": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          }
        },
        "required": [
          "precision",
          "provenance"
        ],
        "type": "object"
      },
      "CallComparisonHistory": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonAttempt"
            },
            "type": "array",
            "maxItems": 30
          },
          "nextCursor": {
            "type": "string"
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CallComparisonInput": {
        "additionalProperties": false,
        "properties": {
          "assessmentDefinitionId": {
            "type": "string"
          },
          "currentAttribution": {
            "$ref": "#/components/schemas/CallComparisonAttribution"
          },
          "planId": {
            "type": "string"
          },
          "planName": {
            "type": "string"
          },
          "planVersionId": {
            "type": "string"
          },
          "preparationRevisionId": {
            "type": "string"
          },
          "publicationIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonQuestion"
            },
            "type": "array",
            "maxItems": 100
          },
          "selectionBasis": {
            "type": "string"
          },
          "selectionRevision": {
            "format": "int64",
            "type": "integer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonSource"
            },
            "type": "array",
            "minItems": 1,
            "maxItems": 20
          },
          "vacancyId": {
            "type": "string"
          },
          "rubricVersion": {
            "type": "string"
          },
          "planVersionNumber": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Номер неизменяемой версии плана, зафиксированной при запуске. Не номер текущей версии общего плана."
          },
          "record": {
            "$ref": "#/components/schemas/CallComparisonRecordContext"
          }
        },
        "required": [
          "vacancyId",
          "planId",
          "planVersionId",
          "planName",
          "selectionRevision",
          "assessmentDefinitionId",
          "selectionBasis",
          "publicationIds",
          "questions",
          "sources",
          "currentAttribution",
          "rubricVersion",
          "planVersionNumber"
        ],
        "type": "object"
      },
      "CallComparisonMapping": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "actorId": {
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "leftQuestionId": {
            "type": "string"
          },
          "previousId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "rightQuestionId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "leftQuestionId",
          "rightQuestionId",
          "active",
          "actorId",
          "reason",
          "createdAt"
        ],
        "type": "object"
      },
      "CallComparisonMappingHistory": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonMapping"
            },
            "type": "array",
            "maxItems": 30
          },
          "nextCursor": {
            "type": "string"
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          },
          "questionContexts": {
            "type": "object",
            "readOnly": true,
            "additionalProperties": {
              "$ref": "#/components/schemas/CallPlanQuestionContext"
            }
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CallComparisonMappingInput": {
        "additionalProperties": false,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "commandKey": {
            "type": "string"
          },
          "expectedRevisionId": {
            "type": "string"
          },
          "leftQuestionId": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "rightQuestionId": {
            "type": "string"
          }
        },
        "required": [
          "commandKey",
          "expectedRevisionId",
          "leftQuestionId",
          "rightQuestionId",
          "active",
          "reason"
        ],
        "type": "object"
      },
      "CallComparisonMetadata": {
        "additionalProperties": false,
        "properties": {
          "actorId": {
            "format": "int64",
            "type": "integer"
          },
          "attribution": {
            "$ref": "#/components/schemas/CallComparisonAttribution"
          },
          "id": {
            "type": "string"
          },
          "limitations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "meetingId": {
            "type": "string"
          },
          "previousId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "recordedAt": {
            "format": "date-time",
            "type": "string"
          },
          "time": {
            "$ref": "#/components/schemas/CallComparisonFactTime"
          }
        },
        "required": [
          "id",
          "time",
          "attribution",
          "limitations",
          "actorId",
          "recordedAt"
        ],
        "type": "object",
        "description": "Immutable source metadata. Scheduled meeting ID and valid source timezone are retained when known. A scheduled organizer is historical recruiter only when actual transcript recruiter-role participation corroborates it. Historical department stays unknown without source evidence. Tombstone metadata uses unknown time/attribution and an evidence_withdrawn limitation."
      },
      "CallComparisonMetadataInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string"
          },
          "expectedMetadataRevisionId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/CallComparisonMetadata"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          }
        },
        "required": [
          "commandKey",
          "expectedMetadataRevisionId",
          "metadata",
          "reason"
        ],
        "type": "object"
      },
      "CallComparisonObservation": {
        "additionalProperties": false,
        "properties": {
          "actorId": {
            "format": "int64",
            "type": "integer"
          },
          "contextSourceId": {
            "type": "string"
          },
          "coverage": {
            "type": "string"
          },
          "criterionFingerprint": {
            "type": "string"
          },
          "criterionId": {
            "type": "string"
          },
          "dependsOn": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "evidence": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonEvidence"
            },
            "type": "array"
          },
          "factTime": {
            "$ref": "#/components/schemas/CallComparisonFactTime"
          },
          "id": {
            "type": "string",
            "maxLength": 100
          },
          "key": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "answer",
              "discussion",
              "skip",
              "correction"
            ]
          },
          "provenance": {
            "type": "string",
            "enum": [
              "transcript",
              "human_confirmation"
            ]
          },
          "questionId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "recordedAt": {
            "format": "date-time",
            "type": "string"
          },
          "statement": {
            "type": "string"
          },
          "supersedes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "withdraws": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reasonRedacted": {
            "type": "boolean",
            "readOnly": true,
            "description": "Server-owned privacy provenance: the original required reason was erased after source deletion. The original author and recordedAt remain. A new human confirmation still requires an explicit reason; this flag cannot replace it."
          }
        },
        "required": [
          "id",
          "key",
          "questionId",
          "kind",
          "statement",
          "provenance",
          "evidence",
          "dependsOn",
          "supersedes",
          "withdraws",
          "factTime",
          "recordedAt"
        ],
        "type": "object",
        "description": "Atomic criterion fact with stable evidence and semantic keys. Cross-source compound facts require explicit dependsOn observations. Human confirmations require statement, covered criteria, actor/reason, claimed fact time or explicit unknown, and separate server recordedAt. Transcript evidence uses exact continuous single-segment Unicode code-point spans."
      },
      "CallComparisonPreparation": {
        "additionalProperties": false,
        "properties": {
          "planId": {
            "type": "string"
          },
          "planVersionId": {
            "type": "string"
          },
          "selectionRevision": {
            "format": "int64",
            "type": "integer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonSourceChoice"
            },
            "type": "array",
            "maxItems": 20
          },
          "nextCursor": {
            "type": "string",
            "description": "Present when further source choices are available. Pass as cursor to continue."
          },
          "record": {
            "$ref": "#/components/schemas/CallComparisonRecordContext"
          }
        },
        "required": [
          "selectionRevision",
          "sources"
        ],
        "type": "object",
        "description": "No persistent plan/default/source versions are created by GET. Empty source ticket means the current source cannot be selected. Metadata IDs can be empty before first use. A source version is materialized only by an authorized command."
      },
      "CallComparisonQuestion": {
        "additionalProperties": false,
        "properties": {
          "criteria": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonCriterion"
            },
            "type": "array"
          },
          "hint": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "planQuestionId": {
            "type": "string"
          },
          "planVersionId": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "rootId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "planQuestionId",
          "planVersionId",
          "rootId",
          "text",
          "required",
          "criteria"
        ],
        "type": "object"
      },
      "CallComparisonQuestionResult": {
        "additionalProperties": false,
        "properties": {
          "applicability": {
            "type": "string",
            "enum": [
              "applicable",
              "not_applicable"
            ]
          },
          "applicabilityActorId": {
            "format": "int64",
            "type": "integer"
          },
          "applicabilityReason": {
            "type": "string"
          },
          "evidenceKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "limitations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "missing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "questionId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "full",
              "partial",
              "discussed",
              "not_found",
              "skipped",
              "unassessable"
            ]
          },
          "summary": {
            "type": "string"
          },
          "applicabilityReasonRedacted": {
            "type": "boolean",
            "readOnly": true,
            "description": "Server-owned privacy provenance for a retained human N/A decision whose original reason was erased. The original applicability actor remains. New N/A decisions require an explicit reason."
          }
        },
        "required": [
          "questionId",
          "status",
          "summary",
          "missing",
          "applicability",
          "limitations",
          "evidenceKeys"
        ],
        "type": "object"
      },
      "CallComparisonResult": {
        "additionalProperties": false,
        "properties": {
          "contradictions": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonContradiction"
            },
            "type": "array"
          },
          "coverage": {
            "$ref": "#/components/schemas/CallComparisonSearchCoverage"
          },
          "limitations": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "observations": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonObservation"
            },
            "type": "array"
          },
          "questions": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonQuestionResult"
            },
            "type": "array"
          },
          "reportVersion": {
            "type": "integer",
            "enum": [
              1
            ],
            "description": "Absent on older reports. Never infer an assessment for older reports."
          },
          "assessmentState": {
            "type": "string",
            "enum": [
              "available",
              "unavailable",
              "evidence_withdrawn",
              "human_edited"
            ]
          },
          "assessment": {
            "$ref": "#/components/schemas/CallComparisonAssessment"
          },
          "recommendations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CallComparisonRecommendation"
            },
            "maxItems": 10
          }
        },
        "required": [
          "questions",
          "observations",
          "contradictions",
          "coverage",
          "limitations"
        ],
        "type": "object"
      },
      "CallComparisonRetryInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string"
          },
          "expectedRevisionId": {
            "type": "string"
          }
        },
        "required": [
          "commandKey",
          "expectedRevisionId"
        ],
        "type": "object"
      },
      "CallComparisonRevision": {
        "additionalProperties": false,
        "properties": {
          "actorId": {
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ai",
              "manual",
              "sanitation"
            ]
          },
          "mappingRevisionId": {
            "type": "string"
          },
          "originalAiRevisionId": {
            "type": "string"
          },
          "previousId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "result": {
            "$ref": "#/components/schemas/CallComparisonResult"
          },
          "withdrawnKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "restoredKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "id",
          "kind",
          "actorId",
          "createdAt",
          "result",
          "withdrawnKeys",
          "restoredKeys"
        ],
        "type": "object"
      },
      "CallComparisonRevisionHistory": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonRevisionSummary"
            },
            "type": "array",
            "maxItems": 30
          },
          "nextCursor": {
            "type": "string"
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CallComparisonRevisionInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string"
          },
          "expectedRevisionId": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16000
          },
          "result": {
            "$ref": "#/components/schemas/CallComparisonResult"
          },
          "withdrawnKeys": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "commandKey",
          "expectedRevisionId",
          "reason",
          "result",
          "withdrawnKeys"
        ],
        "type": "object",
        "description": "CAS against expected effective revision. Keep existing observations byte-for-byte or explicitly withdraw their stable keys; replacement creates new observation IDs and supersedes/withdraws links. Positive status must match all effective criteria. N/A is human-only. Human actor, reason and recordedAt are assigned by server. Manual confirmations never invent a transcript span or use save time as fact time."
      },
      "CallComparisonRevisionSummary": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ai",
              "manual",
              "sanitation"
            ]
          },
          "previousId": {
            "type": "string"
          },
          "actorId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "readOnly": true,
            "description": "Автор события, когда он известен; системное или прежнее событие может не содержать автора."
          }
        },
        "required": [
          "id",
          "kind",
          "createdAt"
        ],
        "type": "object"
      },
      "CallComparisonSearchCoverage": {
        "additionalProperties": false,
        "properties": {
          "complete": {
            "type": "boolean"
          },
          "questionIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sourceVersionIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "complete",
          "sourceVersionIds",
          "questionIds"
        ],
        "type": "object"
      },
      "CallComparisonSegment": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "start": {
            "format": "int64",
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "start",
          "id",
          "text"
        ],
        "type": "object"
      },
      "CallComparisonSelectedSource": {
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string"
          },
          "ticket": {
            "type": "string"
          }
        },
        "required": [
          "sourceId",
          "ticket"
        ],
        "type": "object"
      },
      "CallComparisonSource": {
        "additionalProperties": false,
        "properties": {
          "contentVersionId": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "knownAt": {
            "format": "date-time",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/CallComparisonMetadata"
          },
          "metadataRevisionId": {
            "type": "string"
          },
          "normalization": {
            "type": "string"
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonSegment"
            },
            "type": "array"
          },
          "sourceId": {
            "type": "string"
          },
          "supersedesContentVersionId": {
            "type": "string"
          },
          "tombstone": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sourceId",
          "type",
          "contentVersionId",
          "metadataRevisionId",
          "knownAt",
          "normalization",
          "hash",
          "metadata",
          "tombstone"
        ],
        "type": "object"
      },
      "CallComparisonSourceChoice": {
        "additionalProperties": false,
        "properties": {
          "durationSeconds": {
            "format": "int64",
            "type": "integer"
          },
          "metadata": {
            "$ref": "#/components/schemas/CallComparisonMetadata"
          },
          "sourceId": {
            "type": "string"
          },
          "ticket": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "sourceId",
          "type",
          "ticket",
          "metadata",
          "durationSeconds"
        ],
        "type": "object"
      },
      "CallComparisonSourceEvent": {
        "additionalProperties": false,
        "properties": {
          "contentVersionId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "knownAt": {
            "format": "date-time",
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/CallComparisonMetadata"
          },
          "metadataRevisionId": {
            "type": "string"
          },
          "sourceId": {
            "type": "string"
          },
          "tombstone": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "sourceId",
          "contentVersionId",
          "metadataRevisionId",
          "knownAt",
          "tombstone"
        ],
        "type": "object"
      },
      "CallComparisonSourceHistory": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonSourceEvent"
            },
            "type": "array",
            "maxItems": 30
          },
          "nextCursor": {
            "type": "string"
          },
          "actorLabels": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "readOnly": true,
            "description": "Текущие имена только упомянутых в доступном ответе авторов своего портала. Ключи — их переданные actorId/createdBy/changedBy. Нет имени — клиент показывает неизвестного автора. Не часть неизменяемых фактов и отпечатков."
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "CallComparisonStartInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "planVersionId": {
            "type": "string"
          },
          "selectionRevision": {
            "format": "int64",
            "type": "integer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/CallComparisonSelectedSource"
            },
            "type": "array",
            "minItems": 1,
            "maxItems": 20
          }
        },
        "required": [
          "commandKey",
          "planId",
          "planVersionId",
          "selectionRevision",
          "sources"
        ],
        "type": "object",
        "description": "Freeze exactly the selected current plan and source tickets. 1–20 physical sources, at most 100 questions, normalized source UTF-8 at most 2 MiB plus plan JSON at most 512 KiB. No truncation. GET preparation issues opaque fingerprints without materializing content versions. A stale selection/version/ticket returns conflict before AI."
      },
      "CallPlanQuestionContext": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string"
          },
          "section": {
            "type": "string"
          },
          "planName": {
            "type": "string"
          },
          "versionNumber": {
            "type": "integer",
            "minimum": 1
          },
          "versionId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "text",
          "section",
          "planName",
          "versionNumber",
          "versionId"
        ]
      },
      "MailTemplateType": {
        "type": "string",
        "enum": [
          "interview_invite",
          "interview_cancelled",
          "offer_link",
          "documents_link",
          "portal_invite",
          "rejection"
        ],
        "description": "Существующее действие отправки. Шаблон не создаёт новых триггеров отправки."
      },
      "MailTemplateSource": {
        "type": "object",
        "required": [
          "lang",
          "syntaxVersion",
          "subject",
          "body"
        ],
        "properties": {
          "lang": {
            "type": "string",
            "enum": [
              "ru",
              "en"
            ],
            "description": "Язык авторинга исходника. Смена языка интерфейса не переводит текст и токены."
          },
          "syntaxVersion": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "subject": {
            "type": "string",
            "maxLength": 512,
            "description": "Не больше 512 байт UTF-8. Тема без управляющих символов и переносов строк."
          },
          "body": {
            "type": "string",
            "maxLength": 8192,
            "description": "Обычный текст, не больше 8192 байт UTF-8. Подстановки — точные токены из fields; {{ и }} обозначают буквальные скобки. Ссылка обязательна в теле для типов со ссылкой. Полный зашифрованный payload дополнительно ограничен 16384 байтами."
          },
          "requiresEmailSuccess": {
            "type": "boolean",
            "description": "Only for platform rejection/offer_link; not permitted for email. An explicit dependency on the corresponding successful email action, never inferred from text. Omitted means false."
          }
        },
        "additionalProperties": false
      },
      "MailTemplateField": {
        "type": "object",
        "required": [
          "id",
          "token",
          "description",
          "inSubject",
          "inBody",
          "required",
          "missingPolicy",
          "valueType",
          "insertable"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "inSubject": {
            "type": "boolean"
          },
          "inBody": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          },
          "missingPolicy": {
            "type": "string",
            "enum": [
              "error",
              "neutral"
            ]
          },
          "valueType": {
            "type": "string",
            "enum": [
              "text",
              "integer",
              "date",
              "time",
              "url"
            ]
          },
          "insertable": {
            "type": "boolean"
          }
        }
      },
      "MailTemplateVariant": {
        "type": "object",
        "required": [
          "id",
          "name",
          "authorId",
          "authorName",
          "source",
          "fields",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/MailTemplateSource"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateField"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "string",
            "description": "Opaque mtr1 revision of persisted ciphertext, scoped to this portal/event/channel/variant. New or legacy writer saves change it even for an A→B→A edit. Builtin has no persisted revision."
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateIssue"
            },
            "description": "Policy issues on a structurally readable pre-policy variant. Such a variant cannot be freshly selected or used in a prepared send."
          }
        },
        "description": "default — виртуальный неизменяемый вариант. fields получены из серверного реестра в сохранённом source.lang этого варианта. Смена языка интерфейса не переписывает исходник."
      },
      "MailTemplateSummary": {
        "type": "object",
        "required": [
          "type",
          "folder",
          "channel",
          "selectedId",
          "selectedName",
          "authorId",
          "authorName",
          "updatedAt",
          "variantCount"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MailTemplateType"
          },
          "folder": {
            "type": "string",
            "enum": [
              "hiring",
              "onboarding"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "email"
            ]
          },
          "selectedId": {
            "type": "string"
          },
          "selectedName": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "variantCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          }
        },
        "description": "Метаданные типа без текста писем. Выбор один на портал, тип и канал."
      },
      "MailTemplateFamily": {
        "type": "object",
        "required": [
          "type",
          "channel",
          "revision",
          "selectedId",
          "default",
          "variants",
          "fields"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MailTemplateType"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email"
            ]
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "selectedId": {
            "type": "string"
          },
          "default": {
            "$ref": "#/components/schemas/MailTemplateVariant"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateVariant"
            },
            "maxItems": 50
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateField"
            }
          }
        }
      },
      "MailTemplateVariantDraft": {
        "type": "object",
        "required": [
          "name",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "source": {
            "$ref": "#/components/schemas/MailTemplateSource"
          }
        },
        "additionalProperties": false,
        "description": "Существующий вариант задаётся id; новый — clientId. Указывается ровно одно поле. clientId — UUID локальной копии, публичный id создаёт сервер."
      },
      "MailTemplateVariantRef": {
        "type": "object",
        "required": [],
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "Ровно одно поле: id существующего варианта или default; clientId нового варианта из changed."
      },
      "MailTemplateSaveCommand": {
        "type": "object",
        "required": [
          "commandId",
          "expectedRevision",
          "changed",
          "selected"
        ],
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "changed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateVariantDraft"
            },
            "maxItems": 50
          },
          "selected": {
            "$ref": "#/components/schemas/MailTemplateVariantRef"
          }
        },
        "additionalProperties": false,
        "description": "Fresh edits with nonempty changed must preserve the current selected ID; selecting a new clientId is rejected. With empty changed this legacy email operation selects a version. Exact historical receipts replay before the new content-policy/selection checks and CAS. Same commandId with changed actor/body conflicts; only the latest 100 receipts are retained. See ADR 2026-11-20-message-template-source-policy."
      },
      "MailTemplateSaveResult": {
        "type": "object",
        "required": [
          "revision",
          "selectedId",
          "ids"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "selectedId": {
            "type": "string"
          },
          "ids": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Сопоставление clientId с публичным UUID нового варианта."
          }
        }
      },
      "MailTemplateIssue": {
        "type": "object",
        "required": [
          "field",
          "code",
          "offset"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "tokenId": {
            "type": "string"
          },
          "offset": {
            "type": "integer",
            "minimum": 0
          }
        },
        "description": "offset — позиция в Unicode code points внутри поля; tokenId содержит только известный внутренний ID поля, без исходного свободного текста."
      },
      "MailTemplatePart": {
        "type": "object",
        "required": [
          "text",
          "serviceLink"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "serviceLink": {
            "type": "boolean"
          }
        }
      },
      "MailTemplatePreview": {
        "type": "object",
        "required": [
          "subject",
          "parts"
        ],
        "properties": {
          "subject": {
            "type": "string"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplatePart"
            }
          }
        },
        "description": "Демонстрация с синтетическими значениями и https://example.test/preview. Действующие ссылки и данные кандидатов не выпускаются и не читаются. Текст частей выводится как текст, не как HTML."
      },
      "MailTemplateGroup": {
        "type": "object",
        "required": [
          "id",
          "types"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "hiring",
              "onboarding"
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateSummary"
            }
          }
        }
      },
      "MailTemplateCatalog": {
        "type": "object",
        "required": [
          "channel",
          "groups"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "email"
            ]
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateGroup"
            }
          }
        }
      },
      "OfferApprovalOutcome": {
        "type": "object",
        "description": "Исход согласования оффера, отправленного из подготовленного: согласован согласующим или отправлен кандидату без согласования.",
        "required": [
          "kind",
          "at",
          "by",
          "reason",
          "selfApproved"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "approved",
              "bypassed"
            ],
            "description": "approved — согласующий согласовал отправленную версию условий; bypassed — рекрутер отправил без согласования с причиной."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "Момент решения согласующего (approved) или отправки без согласования (bypassed), UTC."
          },
          "by": {
            "$ref": "#/components/schemas/AppPerson",
            "description": "Решивший согласующий (approved) или отправивший рекрутер (bypassed)."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Причина отправки без согласования; null у approved."
          },
          "selfApproved": {
            "type": "boolean",
            "description": "Согласовал автор запроса: решивший согласующий — тот же человек, что запросил согласование. true только у approved; у bypassed — false."
          }
        }
      },
      "ApplicationOfferApproval": {
        "type": "object",
        "description": "Отметка подготовленного оффера в строке отклика.",
        "required": [
          "state",
          "revision",
          "bypassClosed"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "prepared",
              "pending",
              "approved",
              "rejected",
              "failed"
            ],
            "description": "prepared — подготовлен, запроса по текущей версии условий нет; pending — ждёт решения согласующего; approved — согласован; rejected — согласующий отклонил; failed — ждёт решения, но запрос не доставлен."
          },
          "revision": {
            "type": "integer",
            "description": "Ревизия подготовленного оффера: её несёт ручной отказ отклика из списка и с доски (offerDraftRevision)."
          },
          "bypassClosed": {
            "type": "boolean",
            "description": "Отправить кандидату без согласования нельзя: согласующий отклонил оффер этого отклика после последней отправки."
          }
        }
      },
      "CandidateB24EmailDecision": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "saved",
              "provide",
              "skip"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 255
          }
        },
        "description": "Explicit outbound email decision. Omitted mode uses saved. Only a user who can prepare this candidate's chat (the inviter with a personal Bitrix24 webhook and rights on the candidate and the application) may send skip or provide (any mode other than saved): provide additionally requires candidate edit and a unique normalized email, and skip persists the candidate's refusal of Bitrix24. Anyone else may send only saved; any other mode is refused with 403 authorization_unproven before any effect. A candidate refusal of Bitrix24 recorded earlier is honoured. When the chat is known to be blocked, the server sends through the chosen channel itself, so skip is not needed to bypass it."
      },
      "CandidateB24OutboundReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "destinationId": {
            "type": "string",
            "format": "uuid"
          },
          "prepareCode": {
            "type": "string",
            "description": "Почему подготовка остановилась в attention — машинным кодом (invite_forbidden — у отправителя нет права приглашать пользователей на портал, и учётку кандидата модуль не завёл; набор расширяется: неизвестное значение клиент показывает общим текстом). В skipped — почему старт отправки документов или быстрой отправки встречи пропустил чат из-за известного препятствия: та же причина, что окно отдало в состоянии чата (LinkChatReason, например chat_not_ready); у отказа кандидата от Битрикс24 поля нет. В других состояниях поля нет; без права видеть причины — тоже нет, как у chatCode."
          },
          "chatState": {
            "type": "string"
          },
          "chatCode": {
            "type": "string"
          },
          "chatMessageId": {
            "type": "string"
          },
          "unknownOutcome": {
            "type": "boolean"
          },
          "prepareNextAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сохранённое время следующей автоматической попытки соответствующего этапа; только для ожидания повтора."
          },
          "chatNextAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сохранённое время следующей автоматической попытки соответствующего этапа; только для ожидания повтора."
          }
        },
        "description": "Durable B24 result of the explicit outbound command, independent of the external delivery receipt. destinationId is a nonsecret routing ID."
      },
      "VacationExclusionRequest": {
        "type": "object",
        "required": [
          "people",
          "reason"
        ],
        "properties": {
          "people": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "type": "string"
            },
            "description": "Люди: public_id или b24-<номер в Битрикс24> участника, не входившего в сервис. От 1 до 500."
          },
          "reason": {
            "type": "string",
            "enum": [
              "maternity",
              "childcare",
              "dismissal",
              "other"
            ],
            "description": "Причина: декрет, уход за ребёнком, увольнение, другое. В «Примечании» Т-7 печатается словом."
          },
          "note": {
            "type": "string",
            "nullable": true,
            "maxLength": 255,
            "description": "Пояснение, по желанию; печатается в Т-7 только у причины other."
          }
        }
      },
      "VacationExclusionSkip": {
        "type": "object",
        "required": [
          "person",
          "reason"
        ],
        "properties": {
          "person": {
            "type": "string",
            "description": "Ссылка на человека — как прислана в people."
          },
          "reason": {
            "type": "string",
            "enum": [
              "has_dates",
              "out_of_area",
              "not_participant"
            ],
            "description": "has_dates — у человека есть даты; out_of_area — человека нет в области пишущего или в портале; not_participant — не участник сбора графика."
          }
        }
      },
      "VacationExclusionResult": {
        "type": "object",
        "required": [
          "marked",
          "skipped"
        ],
        "properties": {
          "marked": {
            "type": "integer",
            "description": "Сколько людей отмечено, включая отмеченных раньше: повтор меняет причину."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationExclusionSkip"
            },
            "description": "Кого пропустили и почему. Имён в ответе нет — только присланные ссылки."
          }
        }
      },
      "VacationMoveRequest": {
        "type": "object",
        "required": [
          "to",
          "basis"
        ],
        "properties": {
          "to": {
            "type": "string",
            "format": "date",
            "description": "Новая дата начала, графа 9 Т-7: не раньше «сегодня» юрлица и не позже 31 декабря следующего за графиком года."
          },
          "basis": {
            "type": "string",
            "maxLength": 255,
            "description": "Основание переноса, графа 8 Т-7: приказ, заявление, больничный. Обязательно."
          },
          "movedOrder": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Приказ переноса из книги ТОГО ЖЕ юрлица, что и график: графа 8 печатает его реквизиты. Поля нет — ссылка не меняется; пустая строка отвязывает."
          }
        }
      },
      "AppChatIntent": {
        "type": "object",
        "required": [
          "intent",
          "b24"
        ],
        "properties": {
          "intent": {
            "type": "string",
            "enum": [
              "new",
              "replay"
            ]
          },
          "b24": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LinkChatState"
              },
              {
                "type": "null"
              }
            ]
          },
          "supersedesManualLink": {
            "type": "boolean",
            "description": "For a new documents action only: this command invalidates the current package marked as manually shared. Independent of chat delivery."
          }
        },
        "description": "Read-only preflight of this action. new describes the next command; replay refers to the exact saved key and has b24=null. The subject returns its saved receipt separately."
      },
      "InterviewRescheduleReplay": {
        "type": "object",
        "required": [
          "operation",
          "receipt"
        ],
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/InterviewCalendarOperation"
          },
          "receipt": {
            "$ref": "#/components/schemas/CandidateB24CommandReceipt"
          }
        },
        "description": "The exact submitted operation and its saved receipt; the latest calendarOperation may belong to another request."
      },
      "OrderCan": {
        "type": "object",
        "description": "Что вызывающий может сделать с этим приказом сейчас. Считает сервер тем же правилом, что проверяет исправление и отмену: приказ попадает и в уровень personnel_order · edit, и в уровень personnel_order · view вызывающего. Признак стоит ровно там, где PATCH и отмена пройдут по правам, — экран пункт меню без признака не показывает. У отменённого приказа оба false: отмена конечна.",
        "required": [
          "correct",
          "cancel"
        ],
        "properties": {
          "correct": {
            "type": "boolean",
            "description": "Вправе исправить номер или дату (PATCH /api/v1/orders/{id})."
          },
          "cancel": {
            "type": "boolean",
            "description": "Вправе отменить приказ (POST /api/v1/orders/{id}/cancel)."
          }
        }
      },
      "VacationDepartmentNode": {
        "type": "object",
        "required": [
          "id",
          "parent",
          "path",
          "name",
          "people",
          "noHead",
          "approverName"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "Идентификатор подразделения в Битрикс24."
          },
          "parent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ближайший предок по пути, сам входящий в дерево; null — корень видимого дерева."
          },
          "path": {
            "type": "string",
            "description": "Материализованный путь снимка оргструктуры вида /1/12/45/."
          },
          "name": {
            "type": "string"
          },
          "people": {
            "type": "integer",
            "description": "Людей области в поддереве узла; человек из двух отделов поддерева — один раз."
          },
          "noHead": {
            "type": "boolean",
            "description": "У самого подразделения нет руководителя. Согласующий тогда — первый руководитель выше (approverName) или кадровик (approverName null)."
          },
          "approverName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто согласует даты людей подразделения: свой руководитель, без него — первый руководитель выше; имя не входившего в сервис — из снимка Битрикс24. null — выше никого, согласует кадровик."
          }
        }
      },
      "VacationDepartmentTree": {
        "type": "object",
        "required": [
          "departments",
          "noDepartment"
        ],
        "properties": {
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VacationDepartmentNode"
            },
            "description": "Отделы людей области в порядке пути."
          },
          "noDepartment": {
            "type": "integer",
            "description": "Людей области без единого непропавшего отдела — узел «Без подразделения», фильтр department=none."
          }
        }
      },
      "CandidateB24CommandReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "destinationId": {
            "type": "string",
            "format": "uuid"
          },
          "prepareCode": {
            "type": "string",
            "description": "Почему подготовка остановилась в attention — машинным кодом (invite_forbidden — у отправителя нет права приглашать пользователей на портал, и учётку кандидата модуль не завёл; набор расширяется: неизвестное значение клиент показывает общим текстом). В skipped — почему старт отправки документов или быстрой отправки встречи пропустил чат из-за известного препятствия: та же причина, что окно отдало в состоянии чата (LinkChatReason, например chat_not_ready); у отказа кандидата от Битрикс24 поля нет. В других состояниях поля нет; без права видеть причины — тоже нет, как у chatCode."
          },
          "chatState": {
            "type": "string"
          },
          "chatCode": {
            "type": "string"
          },
          "chatMessageId": {
            "type": "string"
          },
          "unknownOutcome": {
            "type": "boolean"
          }
        },
        "description": "Result of an existing signing or reschedule command. Retry scheduling belongs to the current operation read."
      },
      "SurveyResults": {
        "additionalProperties": false,
        "description": "Сводка по анкете. Итоговые блоки — суммы по runs; анонимные опросы — в anonymousRuns, в итоговые блоки не входят. Пустая сводка — нули, runs: [], anonymousRuns: [], truncated: false.",
        "properties": {
          "assessment": {
            "$ref": "#/components/schemas/SurveyResultsAssessment"
          },
          "anonymousRuns": {
            "description": "Анонимные опросы выборки — только охват, без оценок и сигналов; по старту от поздних, как runs.",
            "items": {
              "$ref": "#/components/schemas/SurveyResultsAnonymousRun"
            },
            "maxItems": 100,
            "type": "array"
          },
          "coverage": {
            "$ref": "#/components/schemas/SurveyResultsCoverage"
          },
          "runs": {
            "items": {
              "$ref": "#/components/schemas/SurveyResultsRun"
            },
            "maxItems": 100,
            "type": "array"
          },
          "signals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyResultsSignals"
              },
              {
                "type": "null"
              }
            ],
            "description": "Сумма по runs; null у ключа API без потолка survey_signal.view=all."
          },
          "truncated": {
            "description": "Опросов больше 100: в runs и anonymousRuns вместе — 100 самых поздних по старту, итог — по именным из них.",
            "type": "boolean"
          }
        },
        "required": [
          "coverage",
          "assessment",
          "signals",
          "runs",
          "anonymousRuns",
          "truncated"
        ],
        "type": "object"
      },
      "SurveyResultsAssessment": {
        "additionalProperties": false,
        "description": "Итог ИИ по отправленным ответам: good + attention + insufficient + pending = submitted.",
        "properties": {
          "attention": {
            "description": "Итог ИИ «нужно внимание».",
            "minimum": 0,
            "type": "integer"
          },
          "good": {
            "description": "Итог ИИ «хорошо» по текущему анализу.",
            "minimum": 0,
            "type": "integer"
          },
          "insufficient": {
            "description": "Итог ИИ «недостаточно данных».",
            "minimum": 0,
            "type": "integer"
          },
          "pending": {
            "description": "Отправленные ответы без текущего анализа, в каком бы состоянии ни был разбор.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "good",
          "attention",
          "insufficient",
          "pending"
        ],
        "type": "object"
      },
      "SurveyResultsCoverage": {
        "additionalProperties": false,
        "description": "Охват: участники из снимка опроса и отправленные ими ответы.",
        "properties": {
          "participants": {
            "description": "Участники из снимка опроса.",
            "minimum": 0,
            "type": "integer"
          },
          "submitted": {
            "description": "Отправленные ответы.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "participants",
          "submitted"
        ],
        "type": "object"
      },
      "SurveyResultsFilterOptions": {
        "additionalProperties": false,
        "description": "Варианты отбора сводки.",
        "properties": {
          "forms": {
            "items": {
              "$ref": "#/components/schemas/SurveyResultsForm"
            },
            "maxItems": 100,
            "type": "array"
          },
          "truncated": {
            "description": "Анкет больше 100: в forms — 100 с самыми свежими опросами.",
            "type": "boolean"
          }
        },
        "required": [
          "forms",
          "truncated"
        ],
        "type": "object"
      },
      "SurveyResultsForm": {
        "additionalProperties": false,
        "description": "Анкета для отбора сводки.",
        "properties": {
          "id": {
            "description": "Публичный UUID анкеты.",
            "format": "uuid",
            "type": "string"
          },
          "title": {
            "description": "Текущее название анкеты.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title"
        ],
        "type": "object"
      },
      "SurveyResultsRun": {
        "additionalProperties": false,
        "description": "Строка опроса сводки.",
        "properties": {
          "assessment": {
            "$ref": "#/components/schemas/SurveyResultsAssessment"
          },
          "coverage": {
            "$ref": "#/components/schemas/SurveyResultsCoverage"
          },
          "endsAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "Публичный UUID опроса.",
            "format": "uuid",
            "type": "string"
          },
          "signals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyResultsSignals"
              },
              {
                "type": "null"
              }
            ],
            "description": "null у ключа API без потолка survey_signal.view=all."
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "description": "Состояние опроса, как в списке опросов.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "state",
          "startsAt",
          "endsAt",
          "coverage",
          "assessment",
          "signals"
        ],
        "type": "object"
      },
      "SurveyResultsSignals": {
        "additionalProperties": false,
        "description": "Сигналы опроса по состояниям — и ИИ, и ручные, в тех же числах, что у списка сигналов.",
        "properties": {
          "inProgress": {
            "description": "Сигналы в работе (in_progress).",
            "minimum": 0,
            "type": "integer"
          },
          "new": {
            "description": "Сигналы в состоянии new.",
            "minimum": 0,
            "type": "integer"
          },
          "processed": {
            "description": "Обработанные сигналы (processed).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "new",
          "inProgress",
          "processed"
        ],
        "type": "object"
      },
      "SurveyAnalyticsOptionsPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyFrozenDepartment"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "SurveyAnalyticsPersonalHistory": {
        "type": "object",
        "additionalProperties": false,
        "description": "История выбранного сотрудника по одной анкете.",
        "properties": {
          "runs": {
            "type": "array",
            "maxItems": 100,
            "description": "Запуски с разрешённым участием сотрудника, свежие первыми: startsAt DESC, id DESC.",
            "items": {
              "$ref": "#/components/schemas/SurveyAnalyticsPersonalRun"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "Подходящих запусков больше 100: в runs — 100 самых свежих."
          }
        },
        "required": [
          "runs",
          "truncated"
        ]
      },
      "SurveyAnalyticsPersonalRun": {
        "type": "object",
        "additionalProperties": false,
        "description": "Участие выбранного сотрудника в одном запуске анкеты.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный UUID опроса."
          },
          "title": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "Состояние опроса, как в списке опросов."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "description": "Имя сотрудника из снимка участия этого запуска."
          },
          "submitted": {
            "type": "boolean",
            "description": "Есть отправленная версия ответа. Черновик не считается."
          },
          "submittedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Время отправки текущей версии ответа; null, если ответ не отправлен."
          },
          "answerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Публичный UUID отправленного ответа; null, если ответ не отправлен. ID черновика не раскрывается. Карточка ответа проверяет право заново."
          },
          "assessment": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "good",
                  "attention",
                  "insufficient",
                  "pending"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Текущая оценка ИИ отправленного ответа: good, attention или insufficient — общий итог опубликованного анализа нынешней версии ответа; pending — такого анализа нет (очередь, ошибка, нехватка лимита, повторный разбор), прежний не подставляется; null — ответ не отправлен."
          },
          "outdated": {
            "type": "boolean",
            "description": "true только у текущего опубликованного анализа, проведённого по прежней ревизии критериев опроса; оценка при этом остаётся. При pending и без отправки — false. Не признак отсутствия ответа и не состояние очереди; переанализ чтение не запускает."
          },
          "signal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyAnalyticsPersonalSignal"
              },
              {
                "type": "null"
              }
            ],
            "description": "Один разрешённый сигнал участия: связанный с ответом, иначе с наибольшим публичным ID. null — сигнала нет, он закрыт правилами сигналов или у ключа нет потолка survey_signal.view=all. Прочие сигналы — в списке сигналов."
          }
        },
        "required": [
          "id",
          "title",
          "state",
          "startsAt",
          "endsAt",
          "name",
          "submitted",
          "submittedAt",
          "answerId",
          "assessment",
          "outdated",
          "signal"
        ]
      },
      "SurveyAnalyticsPersonalSignal": {
        "type": "object",
        "additionalProperties": false,
        "description": "Сигнал участия сотрудника.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Публичный UUID сигнала."
          },
          "state": {
            "type": "string",
            "enum": [
              "new",
              "in_progress",
              "processed"
            ]
          }
        },
        "required": [
          "id",
          "state"
        ]
      },
      "SurveyAnalyticsPersonalEmployeePage": {
        "type": "object",
        "additionalProperties": false,
        "description": "Страница сотрудников персонального режима.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurveyAnalyticsPersonalEmployee"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Курсор следующей страницы; пустая строка — страниц больше нет."
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "SurveyAnalyticsPersonalEmployee": {
        "type": "object",
        "additionalProperties": false,
        "description": "Сотрудник с разрешённым участием.",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "description": "Номер сотрудника Битрикс24 — значение employeeId."
          },
          "name": {
            "type": "string",
            "description": "Имя из последнего разрешённого снимка участия."
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "SurveyNormStatus": {
        "type": "string",
        "enum": [
          "norm",
          "below",
          "critical"
        ],
        "description": "Статус по норме."
      },
      "SurveyScaleMean": {
        "type": "object",
        "additionalProperties": false,
        "description": "Средний ответа по одной шкале. Поля status нет, если статуса нет.",
        "properties": {
          "min": {
            "type": "integer",
            "format": "int64"
          },
          "max": {
            "type": "integer",
            "format": "int64"
          },
          "mean": {
            "type": "number",
            "nullable": true,
            "description": "Средний, число с одним знаком после запятой; null — оценок нет."
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          }
        },
        "required": [
          "min",
          "max",
          "mean"
        ]
      },
      "SurveyBlockNorm": {
        "type": "object",
        "additionalProperties": false,
        "description": "Средние блока анкеты по его шкалам и статус блока. Вопрос eNPS в статус блока ответа не входит.",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "Номер блока в порядке первого появления."
          },
          "title": {
            "type": "string"
          },
          "scales": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyScaleMean"
            }
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          }
        },
        "required": [
          "index",
          "title",
          "scales"
        ]
      },
      "SurveyAnswerNorm": {
        "type": "object",
        "additionalProperties": false,
        "description": "Блок «По норме» карточки ответа. Считается по значениям этого ответа, поэтому его статус может не совпасть с normStatus: тот остаётся для фильтра и сортировки.",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          },
          "scales": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyScaleMean"
            }
          },
          "flaggedKeys": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string"
            },
            "description": "Ключи вопросов с красным флагом."
          },
          "blocks": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyBlockNorm"
            }
          }
        },
        "required": [
          "scales",
          "flaggedKeys",
          "blocks"
        ]
      },
      "SurveyValueCount": {
        "type": "object",
        "additionalProperties": false,
        "description": "Сколько ответов дали это значение шкалы.",
        "properties": {
          "value": {
            "type": "integer",
            "format": "int64"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "value",
          "count"
        ]
      },
      "SurveyOptionCount": {
        "type": "object",
        "additionalProperties": false,
        "description": "Сколько ответов выбрали вариант. У вопроса «да/нет» ключи true и false.",
        "properties": {
          "key": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "key",
          "count"
        ]
      },
      "SurveyENPSNumbers": {
        "type": "object",
        "additionalProperties": false,
        "description": "Числа вопроса eNPS: промоутеры, нейтральные и критики, их доли в процентах и индекс. Поля status нет, если нормы нет или ответов ещё нет.",
        "properties": {
          "promoters": {
            "type": "integer",
            "minimum": 0
          },
          "passives": {
            "type": "integer",
            "minimum": 0
          },
          "critics": {
            "type": "integer",
            "minimum": 0
          },
          "promotersPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "passivesPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "criticsPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "index": {
            "type": "integer",
            "minimum": -100,
            "maximum": 100,
            "description": "Доля промоутеров минус доля критиков. Пока на вопрос никто не ответил, равен нулю: смотрите answered вопроса."
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          }
        },
        "required": [
          "promoters",
          "passives",
          "critics",
          "promotersPercent",
          "passivesPercent",
          "criticsPercent",
          "index"
        ]
      },
      "SurveyQuestionNumbers": {
        "type": "object",
        "additionalProperties": false,
        "description": "Числа одного вопроса. Какие поля есть, зависит от вида вопроса: у шкалы — mean, status и распределение, у eNPS — enps, у выбора и «да/нет» — options, у числа — numberMean.",
        "properties": {
          "key": {
            "type": "string",
            "description": "Ключ вопроса анкеты."
          },
          "answered": {
            "type": "integer",
            "minimum": 0,
            "description": "Число ответов на вопрос. У текстового вопроса — только непустые."
          },
          "mean": {
            "type": "number",
            "description": "Средний по шкале, число с одним знаком после запятой. Поля нет, пока нет оценок."
          },
          "numberMean": {
            "type": "number",
            "description": "Средний у вопроса-числа; нормы у него нет."
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          },
          "distribution": {
            "type": "array",
            "maxItems": 11,
            "items": {
              "$ref": "#/components/schemas/SurveyValueCount"
            },
            "description": "Распределение по значениям, от меньшего к большему, с нулями. Только у шкалы не длиннее 11 значений; у вопроса eNPS его нет."
          },
          "options": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyOptionCount"
            },
            "description": "Ответы по вариантам, в порядке анкеты."
          },
          "enps": {
            "$ref": "#/components/schemas/SurveyENPSNumbers"
          },
          "hidden": {
            "type": "boolean",
            "description": "Вопрос скрыт порогом малой группы; остальные числа вопроса, в том числе answered, ничего не значат."
          }
        },
        "required": [
          "key",
          "answered"
        ]
      },
      "SurveyScopeNumbers": {
        "type": "object",
        "additionalProperties": false,
        "description": "Средние по шкалам и статус всего опроса. В статус входит и индекс eNPS.",
        "properties": {
          "scales": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyScaleMean"
            }
          },
          "status": {
            "$ref": "#/components/schemas/SurveyNormStatus"
          }
        },
        "required": [
          "scales"
        ]
      },
      "SurveyStatusCounts": {
        "type": "object",
        "additionalProperties": false,
        "description": "Сколько ответов в каждом статусе; none — без статуса.",
        "properties": {
          "norm": {
            "type": "integer",
            "minimum": 0
          },
          "below": {
            "type": "integer",
            "minimum": 0
          },
          "critical": {
            "type": "integer",
            "minimum": 0
          },
          "none": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "norm",
          "below",
          "critical",
          "none"
        ]
      },
      "SurveyNumbers": {
        "type": "object",
        "additionalProperties": false,
        "description": "Числа опроса по текущим версиям ответов.",
        "properties": {
          "participants": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько участников у опроса."
          },
          "answered": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько из них ответили."
          },
          "norm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyNorm"
              },
              {
                "type": "null"
              }
            ],
            "description": "Норма, по которой всё посчитано; null — у опроса её нет."
          },
          "questions": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyQuestionNumbers"
            },
            "description": "Вопросы в порядке анкеты."
          },
          "blocks": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SurveyBlockNorm"
            },
            "description": "Блоки анкеты. Здесь в статус блока входит и индекс eNPS, если вопрос в этом блоке."
          },
          "survey": {
            "$ref": "#/components/schemas/SurveyScopeNumbers"
          },
          "statuses": {
            "$ref": "#/components/schemas/SurveyStatusCounts"
          },
          "redFlagged": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько ответов с красными флагами."
          }
        },
        "required": [
          "participants",
          "answered",
          "norm",
          "questions",
          "blocks",
          "survey",
          "statuses",
          "redFlagged"
        ]
      },
      "ResponseViewTarget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ref",
          "revision"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "maxLength": 512,
            "description": "Opaque rcr1 reference from the first channel-responses DTO of this opened card. Does not grant authority."
          },
          "revision": {
            "type": "string",
            "minLength": 43,
            "maxLength": 43,
            "description": "Current server target revision from response-views or explicit read-only verification."
          }
        }
      },
      "ResponseViewCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "commandId",
          "targets",
          "trigger",
          "modeRevision"
        ],
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid",
            "description": "New UUID for an explicit card-opening/manual command. Exact normalized replay returns the same attempts; changed body conflicts."
          },
          "targets": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ResponseViewTarget"
            }
          },
          "trigger": {
            "type": "string",
            "enum": [
              "card_open",
              "manual"
            ]
          },
          "modeRevision": {
            "type": "integer",
            "minimum": 0,
            "description": "Exact monotonic settings revision; an ABA change invalidates the command."
          }
        }
      },
      "ResponseViewItem": {
        "type": "object",
        "required": [
          "ref",
          "provider",
          "available",
          "observed"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "maxLength": 512
          },
          "provider": {
            "type": "string",
            "enum": [
              "hh",
              "avito"
            ]
          },
          "revision": {
            "type": "string",
            "maxLength": 43
          },
          "available": {
            "type": "boolean",
            "description": "Current target/account capability and same application view+edit predicate; read-only users receive false."
          },
          "reason": {
            "type": "string",
            "description": "Machine code for an unavailable target, pending/terminal outcome or read-only reconciliation."
          },
          "observed": {
            "type": "string",
            "enum": [
              "unknown",
              "unviewed",
              "viewed"
            ],
            "description": "Known provider view fact. Unknown operations are never projected as confirmed viewed."
          },
          "attemptId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "in_flight",
              "accepted",
              "failed_no_effect",
              "unknown",
              "cancelled"
            ]
          },
          "confirmedAt": {
            "type": "string",
            "format": "date-time",
            "description": "First locally confirmed recruiter mark, if known. A read-back of an already viewed response invents no actor/time."
          }
        }
      },
      "ResponseViewBatch": {
        "type": "object",
        "required": [
          "mode",
          "modeRevision",
          "items"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "on_open",
              "manual"
            ]
          },
          "modeRevision": {
            "type": "integer",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ResponseViewItem"
            }
          }
        }
      },
      "ResponseViewVerification": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ref"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "maxLength": 512
          }
        }
      },
      "MessageTemplateChannel": {
        "type": "string",
        "enum": [
          "email",
          "hh",
          "avito"
        ]
      },
      "MessageTemplateSource": {
        "type": "object",
        "required": [
          "lang",
          "syntaxVersion",
          "subject",
          "body"
        ],
        "properties": {
          "lang": {
            "type": "string",
            "enum": [
              "ru",
              "en"
            ],
            "description": "Язык авторинга исходника. Смена языка интерфейса не переводит текст и токены."
          },
          "syntaxVersion": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "subject": {
            "type": "string",
            "maxLength": 512,
            "description": "Email subject only (512 UTF-8 bytes). Must be exactly empty for hh/Avito."
          },
          "body": {
            "type": "string",
            "maxLength": 12000,
            "description": "Plain text source. Email retains 8192 UTF-8 bytes; hh 12000 UTF-8 bytes; Avito 1000 Unicode code points. Provider bounds are also checked after substitution, without truncation. Email literals cannot contain user-authored links/contacts; trusted service placeholders remain supported. Preview/submit additionally validate the prepared payload budget."
          },
          "requiresEmailSuccess": {
            "type": "boolean",
            "description": "Only for platform rejection/offer_link; not permitted for email. An explicit dependency on the corresponding successful email action, never inferred from text. Omitted means false."
          }
        },
        "additionalProperties": false
      },
      "MessageTemplateVariant": {
        "type": "object",
        "required": [
          "id",
          "name",
          "authorId",
          "authorName",
          "source",
          "fields",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/MessageTemplateSource"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateField"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "string",
            "description": "Opaque mtr1 revision of persisted ciphertext, scoped to this portal/event/channel/variant. New or legacy writer saves change it even for an A→B→A edit. Builtin has no persisted revision."
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateIssue"
            },
            "description": "Policy issues on a structurally readable pre-policy variant. Such a variant cannot be freshly selected or used in a prepared send."
          }
        },
        "description": "default — виртуальный неизменяемый вариант. fields получены из серверного реестра в сохранённом source.lang этого варианта. Смена языка интерфейса не переписывает исходник."
      },
      "MessageTemplateVariantDraft": {
        "type": "object",
        "required": [
          "name",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "source": {
            "$ref": "#/components/schemas/MessageTemplateSource"
          }
        },
        "additionalProperties": false,
        "description": "Существующий вариант задаётся id; новый — clientId. Указывается ровно одно поле. clientId — UUID локальной копии, публичный id создаёт сервер."
      },
      "MessageTemplateFamily": {
        "type": "object",
        "required": [
          "type",
          "channel",
          "revision",
          "selectedId",
          "default",
          "variants",
          "fields"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MailTemplateType"
          },
          "channel": {
            "$ref": "#/components/schemas/MessageTemplateChannel"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "selectedId": {
            "type": "string"
          },
          "default": {
            "$ref": "#/components/schemas/MessageTemplateVariant"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplateVariant"
            },
            "maxItems": 50
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MailTemplateField"
            }
          }
        }
      },
      "MessageTemplateSummary": {
        "type": "object",
        "required": [
          "type",
          "folder",
          "channel",
          "selectedId",
          "selectedName",
          "authorId",
          "authorName",
          "updatedAt",
          "variantCount"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/MailTemplateType"
          },
          "folder": {
            "type": "string",
            "enum": [
              "hiring",
              "onboarding"
            ]
          },
          "channel": {
            "$ref": "#/components/schemas/MessageTemplateChannel"
          },
          "selectedId": {
            "type": "string"
          },
          "selectedName": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "variantCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          }
        },
        "description": "Метаданные типа без текста писем. Выбор один на портал, тип и канал."
      },
      "MessageTemplateGroup": {
        "type": "object",
        "required": [
          "id",
          "types"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "hiring",
              "onboarding"
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplateSummary"
            }
          }
        }
      },
      "MessageTemplateCatalog": {
        "type": "object",
        "required": [
          "groups"
        ],
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplateGroup"
            }
          }
        }
      },
      "MessageTemplateSaveVariantsCommand": {
        "type": "object",
        "required": [
          "commandId",
          "expectedRevision",
          "changed"
        ],
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "changed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplateVariantDraft"
            },
            "maxItems": 50
          }
        },
        "additionalProperties": false,
        "description": "Only saves variants; never changes the default selection. A selected field is rejected. Command, CAS and scoped receipt semantics are shared with the catalogue engine."
      },
      "MessageTemplateSelectCommand": {
        "type": "object",
        "required": [
          "commandId",
          "expectedRevision",
          "variantId"
        ],
        "properties": {
          "commandId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "variantId": {
            "type": "string",
            "description": "default or an existing variant UUID in this exact family"
          }
        },
        "additionalProperties": false
      },
      "CommunicationEvent": {
        "type": "string",
        "enum": [
          "rejection",
          "offer_link",
          "interview_invite"
        ]
      },
      "CommunicationEventKey": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event",
          "eventId",
          "generation"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/CommunicationEvent"
          },
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "CommunicationActionKey": {
        "type": "string",
        "enum": [
          "cabinet",
          "email",
          "hh_message",
          "hh_transition_message",
          "avito_message",
          "avito_state"
        ]
      },
      "CommunicationActionState": {
        "type": "string",
        "enum": [
          "queued",
          "in_flight",
          "accepted",
          "failed_no_effect",
          "unknown",
          "cancelled"
        ]
      },
      "CommunicationSource": {
        "type": "object",
        "required": [
          "lang",
          "syntaxVersion",
          "subject",
          "body"
        ],
        "properties": {
          "lang": {
            "type": "string",
            "enum": [
              "ru",
              "en"
            ],
            "description": "Язык авторинга исходника. Смена языка интерфейса не переводит текст и токены."
          },
          "syntaxVersion": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "subject": {
            "type": "string",
            "maxLength": 512,
            "description": "Не больше 512 байт UTF-8. Тема без управляющих символов и переносов строк."
          },
          "body": {
            "type": "string",
            "maxLength": 12000,
            "description": "Authored source with the shared supported substitutions. Limits are checked for its event/channel and again after rendering: email <=8192 UTF-8 bytes, hh <=12000 UTF-8 bytes, Avito <=1000 Unicode codepoints. Platform subject must be empty; text is never truncated. Email content policy applies to one-off source as well as stored variants."
          },
          "requiresEmailSuccess": {
            "type": "boolean",
            "description": "Only for platform rejection/offer_link; not permitted for email. An explicit dependency on the corresponding successful email action, never inferred from text. Omitted means false."
          }
        },
        "additionalProperties": false
      },
      "CommunicationSourceChoice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/CommunicationSource"
          },
          "variantId": {
            "type": "string",
            "maxLength": 36,
            "description": "Stored variant UUID, default, or omitted for one-off source."
          },
          "variantRevision": {
            "type": "string",
            "maxLength": 128
          },
          "definitionVersion": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CommunicationProviderSelection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ref",
          "revision",
          "message",
          "state"
        ],
        "properties": {
          "ref": {
            "type": "string",
            "maxLength": 512
          },
          "revision": {
            "type": "string",
            "maxLength": 256
          },
          "message": {
            "type": "boolean"
          },
          "state": {
            "type": "boolean"
          }
        }
      },
      "CommunicationSelections": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "cabinet",
          "email",
          "hh",
          "avito"
        ],
        "properties": {
          "cabinet": {
            "type": "boolean"
          },
          "email": {
            "type": "boolean"
          },
          "hh": {
            "$ref": "#/components/schemas/CommunicationProviderSelection"
          },
          "avito": {
            "$ref": "#/components/schemas/CommunicationProviderSelection"
          }
        }
      },
      "CommunicationCabinetInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedRevision",
          "mode",
          "literal"
        ],
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "enum": [
              "email",
              "literal"
            ]
          },
          "literal": {
            "type": "string",
            "maxLength": 262144
          }
        }
      },
      "CommunicationCabinetDraft": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedRevision",
          "mode",
          "literal",
          "frozenBody",
          "frozenDigest",
          "hasFrozen"
        ],
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "enum": [
              "email",
              "literal"
            ]
          },
          "literal": {
            "type": "string",
            "maxLength": 262144
          },
          "frozenBody": {
            "type": "string",
            "readOnly": true
          },
          "frozenDigest": {
            "type": "string",
            "readOnly": true
          },
          "hasFrozen": {
            "type": "boolean",
            "readOnly": true
          }
        }
      },
      "CommunicationDraftInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "selections",
          "emailSource",
          "hhSource",
          "avitoSource",
          "cabinet"
        ],
        "properties": {
          "selections": {
            "$ref": "#/components/schemas/CommunicationSelections"
          },
          "emailSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "hhSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "avitoSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "cabinet": {
            "$ref": "#/components/schemas/CommunicationCabinetInput"
          }
        }
      },
      "CommunicationDraft": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "selections",
          "emailSource",
          "hhSource",
          "avitoSource",
          "cabinet"
        ],
        "properties": {
          "selections": {
            "$ref": "#/components/schemas/CommunicationSelections"
          },
          "emailSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "hhSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "avitoSource": {
            "$ref": "#/components/schemas/CommunicationSourceChoice"
          },
          "cabinet": {
            "$ref": "#/components/schemas/CommunicationCabinetDraft"
          }
        }
      },
      "CommunicationDraftCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eventId",
          "generation",
          "expectedRevision",
          "draft",
          "prepareSourceIfMissing"
        ],
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 0
          },
          "draft": {
            "$ref": "#/components/schemas/CommunicationDraftInput"
          },
          "prepareSourceIfMissing": {
            "type": "boolean",
            "default": false,
            "description": "Explicit selected-part preparation write. Only the initiating user open/create-offer/select/edit gesture may request first native source issuance; mount/reload/GET/preview/polling/Later do not. Reuses exact live source without TTL extension or silent reissue. Does not publish, enqueue/send or apply an external stage/view."
          }
        }
      },
      "CommunicationDraftResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event",
          "revision",
          "draft",
          "sourcePrepared"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/CommunicationEventKey"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "draft": {
            "$ref": "#/components/schemas/CommunicationDraft"
          },
          "sourcePrepared": {
            "type": "boolean"
          }
        }
      },
      "CommunicationPreviewCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eventId",
          "generation",
          "expectedRevision"
        ],
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "CommunicationConfirmCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "eventId",
          "generation",
          "intentId",
          "expectedRevision",
          "previewToken"
        ],
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedRevision": {
            "type": "integer",
            "minimum": 1
          },
          "previewToken": {
            "type": "string",
            "maxLength": 16384
          }
        }
      },
      "CommunicationEmailCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "available"
        ],
        "properties": {
          "available": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "recipient": {
            "type": "string",
            "maxLength": 255
          }
        }
      },
      "CommunicationTarget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "ref",
          "revision",
          "messageAvailable",
          "stateAvailable",
          "combinedAvailable"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "hh",
              "avito"
            ]
          },
          "ref": {
            "type": "string",
            "maxLength": 512
          },
          "revision": {
            "type": "string",
            "maxLength": 256
          },
          "messageAvailable": {
            "type": "boolean"
          },
          "stateAvailable": {
            "type": "boolean"
          },
          "combinedAvailable": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "accountTitle": {
            "type": "string",
            "description": "Display title of the response account; no credential or recipient identity is exposed."
          },
          "respondedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Original response time for explicit target selection."
          }
        }
      },
      "CommunicationRenderedMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subject",
          "body",
          "digest"
        ],
        "properties": {
          "subject": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "maxLength": 262144
          },
          "digest": {
            "type": "string",
            "maxLength": 128
          }
        }
      },
      "CommunicationActionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "event",
          "key",
          "channel",
          "state",
          "textMissing",
          "canReconcile"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "$ref": "#/components/schemas/CommunicationEventKey"
          },
          "key": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          },
          "channel": {
            "type": "string",
            "enum": [
              "",
              "email",
              "hh",
              "avito"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/CommunicationActionState"
          },
          "rendered": {
            "$ref": "#/components/schemas/CommunicationRenderedMessage"
          },
          "acceptedAt": {
            "type": "string",
            "format": "date-time"
          },
          "failureCode": {
            "type": "string",
            "maxLength": 64
          },
          "textMissing": {
            "type": "boolean"
          },
          "canReconcile": {
            "type": "boolean"
          },
          "dependsOnId": {
            "type": "string",
            "format": "uuid",
            "description": "Exact immutable parent action UUID, when this action has a dependency. It does not grant access or authorize retry. A queued child of an unknown parent stays held; clients pause its automatic polling until that parent changes."
          }
        }
      },
      "CommunicationOwnerReference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "requested",
          "id",
          "formatVersion",
          "provider",
          "state",
          "created",
          "digest",
          "updatedAt"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "offer_operation"
            ]
          },
          "requested": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "formatVersion": {
            "type": "integer",
            "enum": [
              1,
              2
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "hh",
              "avito"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "in_flight",
              "unknown",
              "accepted",
              "verified_no_effect"
            ]
          },
          "created": {
            "type": "boolean",
            "const": false
          },
          "digest": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "acceptedAt": {
            "type": "string",
            "format": "date-time"
          },
          "communicationId": {
            "type": "string",
            "format": "uuid"
          },
          "actionId": {
            "type": "string",
            "format": "uuid"
          },
          "actionRevision": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CommunicationContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event",
          "revision",
          "draft",
          "cabinetAvailable",
          "cabinetRevision",
          "email",
          "targets",
          "families",
          "actions",
          "ownerRefs",
          "sourcePrepared"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/CommunicationEventKey"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "draft": {
            "$ref": "#/components/schemas/CommunicationDraft"
          },
          "cabinetAvailable": {
            "type": "boolean"
          },
          "cabinetComment": {
            "type": "string"
          },
          "cabinetRevision": {
            "type": "integer",
            "minimum": 0
          },
          "email": {
            "$ref": "#/components/schemas/CommunicationEmailCapability"
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationTarget"
            },
            "maxItems": 50
          },
          "families": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageTemplateFamily"
            },
            "maxItems": 3
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationActionResult"
            }
          },
          "ownerRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationOwnerReference"
            }
          },
          "sourcePrepared": {
            "type": "boolean"
          },
          "sourceChat": {
            "type": "boolean"
          },
          "sourceChatReason": {
            "type": "string"
          },
          "ownerMessages": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/CommunicationOwnerMessage"
            },
            "description": "Authorized, bounded original owner history. Transport only; command receipts retain metadata without message plaintext."
          }
        }
      },
      "CommunicationPreviewAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "channel"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          },
          "channel": {
            "type": "string",
            "enum": [
              "",
              "email",
              "hh",
              "avito"
            ]
          },
          "recipient": {
            "type": "string",
            "description": "Адрес получателя из предпросмотра письма с оффером."
          },
          "rendered": {
            "$ref": "#/components/schemas/CommunicationRenderedMessage"
          },
          "dependsOn": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          }
        }
      },
      "CommunicationPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event",
          "revision",
          "previewToken",
          "actions"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/CommunicationEventKey"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "previewToken": {
            "type": "string",
            "maxLength": 16384
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationPreviewAction"
            },
            "maxItems": 5
          }
        }
      },
      "CommunicationActionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requested",
          "id",
          "key",
          "state",
          "created"
        ],
        "properties": {
          "requested": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "$ref": "#/components/schemas/CommunicationActionKey"
          },
          "state": {
            "$ref": "#/components/schemas/CommunicationActionState"
          },
          "created": {
            "type": "boolean"
          }
        }
      },
      "CommunicationConfirmReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "communicationId",
          "intentId",
          "revision",
          "actions"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "communicationId": {
            "type": "string",
            "format": "uuid"
          },
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationActionReceipt"
            },
            "maxItems": 5
          },
          "ownerRefs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunicationOwnerReference"
            },
            "maxItems": 5
          }
        }
      },
      "SurveyResultsAnonymousRun": {
        "additionalProperties": false,
        "description": "Строка анонимного опроса сводки: только охват, где submitted — прошедшие опрос по отметке. Оценок и сигналов у анонимного опроса нет, в итоговые блоки он не входит.",
        "properties": {
          "coverage": {
            "$ref": "#/components/schemas/SurveyResultsCoverage"
          },
          "endsAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "Публичный UUID опроса.",
            "format": "uuid",
            "type": "string"
          },
          "startsAt": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "description": "Состояние опроса, как в списке опросов.",
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "state",
          "startsAt",
          "endsAt",
          "coverage"
        ],
        "type": "object"
      },
      "SurveyPicture": {
        "type": "object",
        "additionalProperties": false,
        "description": "Картина анонимного опроса. Экран выводит из participants и answered только «прошли N из M»: N может быть больше M, если участие прошедшего новичка стёрто, а его ответ остался.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "below_threshold",
              "error"
            ],
            "description": "pending — снимка ещё нет, картина готовится; ready — числа снимка; below_threshold — ответили меньше smallGroupMin человек (порог малой группы — поле smallGroupMin карточки опроса), чисел нет; error — посчитать не удалось, чисел нет."
          },
          "participants": {
            "type": "integer",
            "minimum": 0,
            "description": "M — участники. У ready и below_threshold — на момент снимка, у pending и error — сейчас, как на Ходе."
          },
          "answered": {
            "type": "integer",
            "minimum": 0,
            "description": "N — прошедшие. У ready и below_threshold — ответы в снимке, у pending и error — отметки прохождения сейчас."
          },
          "numbers": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyNumbers"
              },
              {
                "type": "null"
              }
            ],
            "description": "Числа снимка только у ready; их participants и answered равны M и N. Иначе null."
          }
        },
        "required": [
          "state",
          "participants",
          "answered",
          "numbers"
        ]
      },
      "SurveyPictureTexts": {
        "type": "object",
        "additionalProperties": false,
        "description": "Страница свободных ответов одного вопроса картины.",
        "properties": {
          "texts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Тексты страницы в порядке картины."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько текстов у вопроса в снимке — «Показаны 8 из 19»."
          },
          "cursor": {
            "type": "string",
            "description": "Курсор следующей страницы; нет — страница последняя."
          }
        },
        "required": [
          "texts",
          "total"
        ]
      },
      "VacationChangeMark": {
        "type": "object",
        "description": "Отметка чужой правки своего периода на «Моём отпуске»: кто-то другой сменил даты, перенёс, убрал период или внёс его за сотрудника. Отметку считает сервер из истории дат периода; она живёт до дня начала периода (перенос, если он есть; у убранного — начало дат на момент удаления) в сутках юрлица или до «Понятно» (POST …/changes/seen).",
        "required": [
          "kind",
          "entry",
          "event",
          "wasStartsOn",
          "wasEndsOn",
          "wasMovedTo",
          "startsOn",
          "endsOn",
          "movedTo",
          "byName",
          "at",
          "originByName",
          "originAt"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "changed",
              "moved",
              "removed",
              "added"
            ],
            "description": "changed — плановые даты изменили; moved — план прежний, период перенесли; removed — период убрали; added — период внесли за сотрудника, и он этого ещё не видел."
          },
          "entry": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "public_id строки периода; null у removed — строки больше нет."
          },
          "event": {
            "type": "string",
            "nullable": true,
            "description": "Событие, которое подтверждает «Понятно»: номер записи истории дат десятичным числом. null — внесение без записей, его подтверждают адресом строки (entry)."
          },
          "wasStartsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Начало дат «было» — дат, которые сотрудник видел. null у added и когда «было» неизвестно: тогда отметка показывает только «стало»."
          },
          "wasEndsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Конец дат «было»; null — как у wasStartsOn."
          },
          "wasMovedTo": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Прежний перенос «было»; null — переноса не было или «было» неизвестно."
          },
          "startsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Начало дат «стало». У removed — даты на момент удаления, только если «было» неизвестно, иначе null."
          },
          "endsOn": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Конец дат «стало»; null — как у startsOn."
          },
          "movedTo": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Дата переноса «стало» (перенесён на); null — переноса нет."
          },
          "byName": {
            "type": "string",
            "description": "Кто правил последним — фамилия и имя; у added без правок — кто внёс."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "Когда правили последним, RFC 3339 в UTC; у added без правок — когда внесли."
          },
          "originByName": {
            "type": "string",
            "nullable": true,
            "description": "Кто внёс период — только у added, у остальных null."
          },
          "originAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Когда период внесли, RFC 3339 в UTC — только у added, у остальных null."
          }
        }
      },
      "SurveySummaryQuote": {
        "type": "object",
        "additionalProperties": false,
        "description": "Цитата пункта сводки анонимного опроса: вопрос и точная подстрока одного текста картины, без ссылки на ответ.",
        "properties": {
          "questionKey": {
            "type": "string"
          },
          "quote": {
            "type": "string"
          }
        },
        "required": [
          "questionKey",
          "quote"
        ]
      },
      "CommunicationOwnerMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ownerId",
          "textMissing"
        ],
        "properties": {
          "ownerId": {
            "type": "string",
            "format": "uuid"
          },
          "rendered": {
            "$ref": "#/components/schemas/CommunicationRenderedMessage"
          },
          "action": {
            "$ref": "#/components/schemas/CommunicationActionResult"
          },
          "textMissing": {
            "type": "boolean"
          }
        },
        "description": "Original stored V1 text or the verified original V2 action snapshot. Current templates are never used to recreate history; action is present only for a verified common action."
      },
      "VacationRemindPerson": {
        "type": "object",
        "required": [
          "user",
          "b24User",
          "userName",
          "email"
        ],
        "properties": {
          "user": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "public_id человека; null — человек не входил в сервис."
          },
          "b24User": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "Номер человека в Битрикс24; null — учётки Битрикс24 нет."
          },
          "userName": {
            "type": "string",
            "description": "Фамилия и имя одной строкой; пусто — имени нет: показывают почту email, а без неё — номер b24User."
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "Почта из Битрикс24 — только у человека без имени; иначе null."
          }
        },
        "description": "Человек итога напоминания."
      },
      "ApprovalProcessParticipant": {
        "type": "object",
        "required": [
          "person",
          "state",
          "decidedAt"
        ],
        "properties": {
          "person": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "pending",
              "approved",
              "rejected",
              "skipped"
            ]
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "description": "Actual actor state; identity is null when portal_user:view does not authorize it. Repeated actors on different steps keep their separate coordinates."
      },
      "ApprovalProcessStep": {
        "type": "object",
        "required": [
          "position",
          "rule",
          "title",
          "state",
          "subject",
          "members",
          "pendingSince",
          "pendingSinceEstimated",
          "decidedAt",
          "skipReason",
          "participants"
        ],
        "properties": {
          "position": {
            "type": "integer"
          },
          "rule": {
            "type": "string",
            "enum": [
              "any",
              "all"
            ]
          },
          "title": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "subject": {
            "$ref": "#/components/schemas/ApprovalSubject"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalStepMember"
            },
            "maxItems": 20
          },
          "pendingSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "pendingSinceEstimated": {
            "type": "boolean"
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "skipReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalProcessParticipant"
            },
            "maxItems": 64
          }
        },
        "description": "Compact step facts, without conditions or decision comments. Pending-time fallback is explicitly estimated. Future roles do not invent a person."
      },
      "ApprovalProcessGroup": {
        "type": "object",
        "required": [
          "number",
          "state",
          "representativePosition",
          "representativeActor",
          "steps"
        ],
        "properties": {
          "number": {
            "type": "integer"
          },
          "state": {
            "type": "string"
          },
          "representativePosition": {
            "type": "integer"
          },
          "representativeActor": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalProcessStep"
            },
            "maxItems": 32
          }
        },
        "description": "A whole parallel block. The representative actor index belongs to the specified step position, is zero-based and prefers the pending viewer, then the first pending actor in stable server order. A partial block is not a completed block."
      },
      "ApprovalProcess": {
        "type": "object",
        "required": [
          "mode",
          "initiator",
          "activityAt",
          "activitySource",
          "startedAt",
          "finishedAt",
          "outcome",
          "pendingSince",
          "pendingSinceEstimated",
          "lastCompletedGroup",
          "currentGroup",
          "nextGroup",
          "totalGroups",
          "groups"
        ],
        "properties": {
          "round": {
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "initiator": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "activityAt": {
            "type": "string",
            "format": "date-time"
          },
          "activitySource": {
            "type": "string",
            "enum": [
              "started",
              "step_decided",
              "actor_decided",
              "finished",
              "request_updated",
              "requested",
              "decided"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "pendingSince": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "pendingSinceEstimated": {
            "type": "boolean"
          },
          "lastCompletedGroup": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentGroup": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextGroup": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalGroups": {
            "type": "integer"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalProcessGroup"
            },
            "maxItems": 3
          }
        },
        "description": "Authorized page projection: real initiator and at most the last fully completed, current and known next groups. Group numbers and totalGroups identify omitted groups for a protocol ellipsis; clients show at most three inline avatars, prioritizing initiator, last completed and current. Read the full protocol lazily through the existing vacancy round or offer approval endpoint. A draft without a launch has a null process. An approved round does not archive the vacancy; a viewer decision does not finish a pending block. Offer projections have one actual approver and no vacancy route or round."
      },
      "RequestCreateContextResponse": {
        "type": "object",
        "required": [
          "currency",
          "departments"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "description": "Валюта портала."
          },
          "departments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestDepartment"
            },
            "description": "Только живые отделы членства вызывающего, [] при отсутствии."
          }
        }
      },
      "InterviewCompanyContact": {
        "type": "object",
        "description": "Есть ли у профиля компании вакансии публичная почта или телефон — без него приглашение не создаётся (409 company_contact_required).",
        "required": [
          "available",
          "companyId"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "true — у профиля есть непустая публичная почта или телефон."
          },
          "companyId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "public_id профиля вакансии или, если своего у вакансии нет, профиля портала по умолчанию — его открывают, чтобы заполнить контакт; null — профиля нет. Тот же ключ, что details.companyId отказа company_contact_required."
          }
        }
      },
      "ApplicationProcessStep": {
        "type": "string",
        "enum": [
          "application",
          "interview",
          "decision",
          "mass_screening",
          "mass_registered",
          "mass_attended",
          "offer",
          "onboarding",
          "hired"
        ],
        "description": "Шаг процесса отклика у рекрутера: шаги пути кандидата (journey.steps) тем же порядком и onboarding — «Оформление» — перед выходом. onboarding — шаг процесса, а не этап отклика: в journey.steps его нет."
      },
      "ApplicationStepStatus": {
        "type": "string",
        "enum": [
          "done",
          "outside",
          "skipped",
          "current",
          "ahead"
        ],
        "description": "Статус шага процесса: done — системный факт (встреча прошла, заказчик решил, оффер принят, оформление завершено, выход, уход массового этапа вперёд); outside — шаг внесён записью «вне системы»; skipped — ни того ни другого; current — текущий шаг идущего процесса; ahead — правее текущего (у идущего процесса свёрнут, действия доступны; у концовок — без действий). Левее текущего факты считаются от последнего отката этапа назад, если шаг стоит не раньше этапа, куда откатили."
      },
      "ApplicationHireAction": {
        "type": "string",
        "enum": [
          "primary",
          "secondary",
          "menu"
        ],
        "description": "Где «Отметить выход»: primary — главной кнопкой следующего действия (с дня выхода и после завершения оформления); secondary — второй кнопкой (массовый подбор); menu — только пунктом «Стадия → Выход…»."
      },
      "ApplicationProcessCode": {
        "type": "string",
        "enum": [
          "review",
          "need_invite",
          "need_another",
          "invite_expired",
          "await_slot",
          "meeting_scheduled",
          "await_customer",
          "prepare_offer",
          "no_decision",
          "await_offer_answer",
          "remake_offer",
          "send_offer",
          "await_offer_approval",
          "offer_approval_turn",
          "await_start",
          "mark_start",
          "hired",
          "rejected",
          "closed",
          "confirm_offer_answer",
          "prepare_documents"
        ],
        "description": "Код следующего действия процесса: коды состояния (ApplicationStateCode) и два кода, которые даёт только процесс: confirm_offer_answer — оффер отдан вне системы, ответа кандидата нет («Кандидат принял?»); prepare_documents — оффер принят или оформление идёт («Оформить документы»). Код процесса заменяет код состояния по текущему шагу: no_decision — от записи «Собеседование было», prepare_offer — от «Заказчик одобрил» и у этапа «Оффер» без оффера и черновика, mark_start — после завершения оформления до выхода."
      },
      "StepRecordKind": {
        "type": "string",
        "enum": [
          "interview_held",
          "customer_approved",
          "offer_given"
        ],
        "description": "Вид записи шага «вне системы»: interview_held — «Собеседование было»; customer_approved — «Заказчик одобрил (со слов)»; offer_given — «Оффер отдан вне системы»."
      },
      "StepRecordFormat": {
        "type": "string",
        "enum": [
          "office",
          "video",
          "phone"
        ],
        "description": "Формат собеседования «вне системы»: office — в офисе, video — видеозвонок, phone — телефон."
      },
      "ApplicationProcessNext": {
        "type": "object",
        "description": "Следующее действие процесса.",
        "required": [
          "code",
          "kind",
          "since"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ApplicationProcessCode"
          },
          "kind": {
            "$ref": "#/components/schemas/ApplicationStateKind"
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "С какого момента действие стоит, UTC."
          }
        }
      },
      "ApplicationStepRecordScan": {
        "type": "object",
        "description": "Скан записи. Сам файл — по подписанной ссылке GET /api/v1/applications/{id}/step-records/{recordId}/scan.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Ручка файла."
          },
          "name": {
            "type": "string",
            "description": "Исходное имя файла."
          }
        }
      },
      "ApplicationStepRecord": {
        "type": "object",
        "description": "Запись шага отклика «вне системы»: что было, со слов рекрутера, без встречи, решения или оффера в системе. Системные встречи, решения, офферы, счётчики и аналитика её не видят.",
        "required": [
          "id",
          "kind",
          "occurredOn",
          "author",
          "canEdit",
          "comment",
          "interviewers",
          "format",
          "customer",
          "withoutApproval",
          "acceptedOn",
          "scan",
          "withdrawn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Адрес записи."
          },
          "kind": {
            "$ref": "#/components/schemas/StepRecordKind"
          },
          "occurredOn": {
            "type": "string",
            "format": "date",
            "description": "День события со слов рекрутера."
          },
          "author": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто внёс запись; null — человек вне видимости вызывающего."
          },
          "canEdit": {
            "type": "boolean",
            "description": "Вызывающий может править описание и скан: запись живая, отклик в работе, вызывающий внёс её или он рекрутер вакансии."
          },
          "comment": {
            "type": "string",
            "description": "Комментарий; пусто — его нет или данные отклика стёрты."
          },
          "interviewers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationInterviewAttendee"
            },
            "description": "Кто проводил собеседование (interview_held); у прочих видов пусто. name — null и тогда, когда пользователь сервиса с этим b24UserId вне видимости вызывающего, как у author и customer; b24UserId остаётся."
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepRecordFormat"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат собеседования; null — не указан или вид не interview_held."
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppPerson"
              },
              {
                "type": "null"
              }
            ],
            "description": "Заказчик вакансии у customer_approved (нет заказчика — автор вакансии); null у прочих видов и вне видимости вызывающего."
          },
          "withoutApproval": {
            "type": "boolean",
            "description": "Оффер отдан вне системы у вакансии, где оффер требует согласования: «без согласования в HR AI», а не «Согласовано»."
          },
          "acceptedOn": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "description": "День «Кандидат принял» у offer_given; null — ответа нет."
          },
          "scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStepRecordScan"
              },
              {
                "type": "null"
              }
            ],
            "description": "Скан; null — скана нет."
          },
          "withdrawn": {
            "type": "boolean",
            "description": "Запись снята откатом этапа назад или возвратом из отказа: остаётся в истории, статуса шага не даёт, и вместо неё можно внести новую."
          }
        }
      },
      "ApplicationProcessStepState": {
        "type": "object",
        "description": "Шаг процесса и его статус.",
        "required": [
          "step",
          "status",
          "record"
        ],
        "properties": {
          "step": {
            "$ref": "#/components/schemas/ApplicationProcessStep"
          },
          "status": {
            "$ref": "#/components/schemas/ApplicationStepStatus"
          },
          "record": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStepRecord"
              },
              {
                "type": "null"
              }
            ],
            "description": "Запись шага «вне системы»: живая, а без живой — последняя снятая (withdrawn: true); null — записей шага нет."
          }
        }
      },
      "ApplicationProcess": {
        "type": "object",
        "description": "Шаги процесса отклика у рекрутера, посчитанные сервером по фактам: встречам, решениям заказчика, офферу, оформлению, записям «вне системы» и откатам этапа. Не хранится.",
        "required": [
          "steps",
          "current",
          "live",
          "next",
          "hire"
        ],
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApplicationProcessStepState"
            },
            "description": "Шаги сценария по порядку."
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationProcessStep"
              },
              {
                "type": "null"
              }
            ],
            "description": "Текущий шаг; null — концовка: отказ, вакансия завершена, выход без идущего оформления."
          },
          "live": {
            "type": "boolean",
            "description": "Процесс идёт: есть текущий шаг."
          },
          "next": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationProcessNext"
              },
              {
                "type": "null"
              }
            ],
            "description": "Следующее действие; null — массовый подбор: его действие — по фазе journey, как прежде."
          },
          "hire": {
            "$ref": "#/components/schemas/ApplicationHireAction"
          }
        }
      },
      "StepRecordCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "kind",
          "occurredOn"
        ],
        "description": "Новая запись шага «вне системы».",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/StepRecordKind"
          },
          "occurredOn": {
            "type": "string",
            "format": "date",
            "description": "День события, не позже сегодняшнего."
          },
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий, до 4000 символов."
          },
          "interviewers": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто проводил — номера пользователей Битрикс24, до 20; только у interview_held. Повторы схлопываются."
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepRecordFormat"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат собеседования; только у interview_held."
          },
          "scanFileId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ручка подтверждённой загрузки скана (POST /api/v1/applications/{id}/step-records/scan-intent и scan-complete) — загрузка самого вызывающего, ещё ни к чему не привязанная."
          },
          "acceptedNow": {
            "type": "boolean",
            "description": "«Кандидат принял» сразу, днём события; только у offer_given."
          }
        }
      },
      "StepRecordEditRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Правка живой записи: описание целиком (непереданное поле очищается) и скан. Вид, день события и ответ кандидата не меняются — ошибку исправляет откат этапа.",
        "properties": {
          "comment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Комментарий, до 4000 символов."
          },
          "interviewers": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int64"
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Кто проводил — номера пользователей Битрикс24, до 20; только у interview_held."
          },
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StepRecordFormat"
              },
              {
                "type": "null"
              }
            ],
            "description": "Формат собеседования; только у interview_held."
          },
          "scanFileId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Новый скан; null или нет поля — скан прежний. Снять скан правка не умеет."
          }
        }
      },
      "StepRecordAcceptRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "acceptedOn"
        ],
        "description": "«Кандидат принял».",
        "properties": {
          "acceptedOn": {
            "type": "string",
            "format": "date",
            "description": "День ответа: не раньше дня события и не позже сегодняшнего."
          }
        }
      },
      "VacationRecipients": {
        "type": "object",
        "required": [
          "kind",
          "from",
          "recipients"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "collection_open",
              "reopened"
            ],
            "description": "Какая рассылка уйдёт при переводе в сбор: collection_open — объявление сбора, reopened — повторное открытие."
          },
          "from": {
            "type": "string",
            "enum": [
              "draft",
              "review",
              "approved"
            ],
            "description": "Состояние графика, из которого он уйдёт в сбор."
          },
          "recipients": {
            "type": "integer",
            "minimum": 0,
            "description": "Сколько сотрудников получат уведомление в Битрикс24. Ноль допустим."
          }
        }
      },
      "VacationReopenRequest": {
        "type": "object",
        "required": [],
        "properties": {
          "expectedRecipients": {
            "type": "integer",
            "minimum": 0,
            "description": "Число адресатов повторного открытия, подтверждённое по GET /api/v1/vacation-schedules/{id}/recipients. Разошлось с пересчётом — 409 vacation_recipients_changed; без поля — без сверки."
          }
        }
      },
      "CustomerCallRecordParticipant": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "organizer",
              "customer"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "role"
        ]
      },
      "CustomerCallRecord": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "calendar",
              "manual"
            ]
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "titleUnavailable": {
            "type": "boolean"
          },
          "planId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "string",
                "enum": [
                  ""
                ]
              }
            ]
          },
          "planName": {
            "type": "string"
          },
          "selectionRevision": {
            "type": "integer",
            "minimum": 0
          },
          "startsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "callDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string"
          },
          "pollState": {
            "type": "string"
          },
          "manualCount": {
            "type": "integer",
            "minimum": 0
          },
          "followupCount": {
            "type": "integer",
            "minimum": 0
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallRecordParticipant"
            },
            "maxItems": 2
          },
          "plan": {
            "$ref": "#/components/schemas/CallPlan"
          },
          "analysis": {
            "$ref": "#/components/schemas/CustomerCallRecordAnalysisCard"
          },
          "comparison": {
            "$ref": "#/components/schemas/CustomerCallRecordComparisonCard"
          },
          "calendarState": {
            "$ref": "#/components/schemas/CustomerCallRecordCalendarState"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "incomplete_response",
              "ambiguous_event",
              "access_denied",
              "scope_missing",
              "credential_changed",
              "owner_unavailable",
              "rate_limit",
              "temporary_failure",
              "unsupported_calendar"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "scheduled",
              "failed"
            ]
          },
          "creationState": {
            "type": "string",
            "enum": [
              "not_started",
              "event_started",
              "chat_started",
              "unknown",
              "confirmed"
            ]
          },
          "participantDelivery": {
            "$ref": "#/components/schemas/CustomerCallParticipantStatus"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "titleUnavailable",
          "planId",
          "planName",
          "selectionRevision",
          "startsAt",
          "endsAt",
          "callDate",
          "timezone",
          "pollState",
          "manualCount",
          "followupCount",
          "participants"
        ]
      },
      "CustomerCallRecordList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallRecord"
            },
            "maxItems": 50
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "items",
          "count",
          "nextCursor"
        ]
      },
      "CustomerCallRecordScheduleRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "durationMin": {
            "type": "integer",
            "minimum": 15,
            "maximum": 240
          },
          "tz": {
            "type": "string",
            "maxLength": 255
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "planId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "string",
                "enum": [
                  ""
                ]
              }
            ]
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "startsAt",
          "durationMin",
          "tz",
          "commandKey"
        ]
      },
      "CustomerCallRecordTranscriptRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "planId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "string",
                "enum": [
                  ""
                ]
              }
            ]
          },
          "recordId": {
            "type": "string",
            "format": "uuid"
          },
          "callDate": {
            "type": "string",
            "format": "date"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60000
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "expectedSelectionRevision": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "text",
          "commandKey"
        ]
      },
      "CustomerCallRecordPlanRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedSelectionRevision": {
            "type": "integer",
            "minimum": 0
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "planId",
          "expectedSelectionRevision",
          "commandKey"
        ]
      },
      "CustomerCallRecordSelection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "selectionRevision": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "planId",
          "selectionRevision"
        ]
      },
      "CustomerCallRecordTranscriptResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recordId": {
            "type": "string",
            "format": "uuid"
          },
          "transcript": {
            "$ref": "#/components/schemas/TranscriptItem"
          }
        },
        "required": [
          "recordId",
          "transcript"
        ]
      },
      "CustomerCallRecordSource": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "manual",
              "followup"
            ]
          }
        },
        "required": [
          "sourceId",
          "type"
        ]
      },
      "CustomerCallAnalysisEvidence": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "segmentId": {
            "type": "string",
            "maxLength": 500
          },
          "quote": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "sourceId",
          "segmentId",
          "quote"
        ]
      },
      "CustomerCallAnalysisThesis": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 500
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisEvidence"
            },
            "maxItems": 5,
            "minItems": 1
          }
        },
        "required": [
          "text",
          "evidence"
        ]
      },
      "CustomerCallAnalysisTopic": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "tasks",
              "result",
              "requirements",
              "team",
              "conditions",
              "selection"
            ]
          },
          "theses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisThesis"
            },
            "maxItems": 5,
            "minItems": 1
          }
        },
        "required": [
          "code",
          "theses"
        ]
      },
      "CustomerCallAnalysisInsight": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "conclusion": {
            "type": "string",
            "maxLength": 500
          },
          "basis": {
            "$ref": "#/components/schemas/CustomerCallAnalysisThesis"
          },
          "suggestion": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "conclusion",
          "basis",
          "suggestion"
        ]
      },
      "CustomerCallAnalysisItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "tasks",
              "conditions",
              "schedule",
              "hiringSteps",
              "experience",
              "skills",
              "education",
              "stoppers"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 500
          },
          "quote": {
            "type": "string",
            "maxLength": 500
          },
          "at": {
            "type": "string",
            "maxLength": 500
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "segmentId": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "field",
          "text",
          "quote",
          "at",
          "sourceId",
          "segmentId"
        ]
      },
      "CustomerCallAnalysisReport": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "schemaVersion": {
            "type": "string",
            "enum": [
              "call-analysis-v1"
            ]
          },
          "summary": {
            "type": "string",
            "maxLength": 500
          },
          "topics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisTopic"
            },
            "maxItems": 6
          },
          "insights": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisInsight"
            },
            "maxItems": 5
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 500
            },
            "maxItems": 10
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "insufficient_data",
                "input_truncated",
                "incomplete_source"
              ]
            },
            "maxItems": 3
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisItem"
            },
            "maxItems": 40
          }
        },
        "required": [
          "schemaVersion",
          "summary",
          "topics",
          "insights",
          "gaps",
          "limitations",
          "items"
        ],
        "description": "Versioned saved report. Topic theses and insight bases are evidence-backed facts; summary, insight conclusions and suggestions are interpretation. Each quote is exact text from one accepted segment of its named source. Legacy field items never apply themselves to documents. An empty report explicitly declares insufficient_data. Old Follow-up items are not converted to invented report sections."
      },
      "CustomerCallAnalysisSourceChoice": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "manual",
              "followup"
            ]
          },
          "ticket": {
            "type": "string",
            "maxLength": 64,
            "description": "Server-signed version ticket bound to portal, vacancy, record and source content. Empty when this source cannot currently be read."
          }
        },
        "required": [
          "sourceId",
          "type",
          "ticket"
        ]
      },
      "CustomerCallAnalysisPreparation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisSourceChoice"
            },
            "maxItems": 20
          },
          "nextCursor": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "sources"
        ]
      },
      "CustomerCallAnalysisSourceInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "ticket": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          }
        },
        "required": [
          "sourceId",
          "ticket"
        ]
      },
      "CustomerCallAnalysisStartInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisSourceInput"
            },
            "maxItems": 20,
            "minItems": 1
          },
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "language": {
            "type": "string",
            "enum": [
              "ru",
              "en"
            ]
          }
        },
        "required": [
          "sources",
          "commandKey",
          "language"
        ]
      },
      "CustomerCallAnalysisManifest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "manual",
              "followup"
            ]
          },
          "hash": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          }
        },
        "required": [
          "sourceId",
          "type",
          "hash"
        ]
      },
      "CustomerCallAnalysisAttempt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "recordId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "timeout",
              "inputs_unavailable",
              "invalid_output",
              "ai_quota",
              "ai_not_connected",
              "ai_key_dead",
              "ai_scope_missing",
              "ai_unavailable",
              "forbidden",
              "vacancy_archived",
              "lease_lost",
              "evidence_withdrawn"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "schemaVersion": {
            "type": "string",
            "enum": [
              "call-analysis-v1"
            ]
          },
          "promptVersion": {
            "type": "string",
            "enum": [
              "call-analysis-v1"
            ]
          },
          "parserVersion": {
            "type": "string",
            "enum": [
              "exact-evidence-v1"
            ]
          },
          "manifest": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallAnalysisManifest"
            },
            "maxItems": 20
          },
          "report": {
            "$ref": "#/components/schemas/CustomerCallAnalysisReport"
          }
        },
        "required": [
          "id",
          "recordId",
          "state",
          "createdAt",
          "schemaVersion",
          "promptVersion",
          "parserVersion",
          "manifest"
        ],
        "description": "Attempt metadata is separate from the last successful report. errorCode explains a failed/cancelled or unreadable attempt. A queued/running refresh leaves the previous report available. Exact history rechecks current source access and fails closed after removal, key changes or unreadable input. Source removal cancels active work and erases input/result ciphertexts from all dependent historical attempts."
      },
      "CustomerCallAnalysisStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "current": {
            "$ref": "#/components/schemas/CustomerCallAnalysisAttempt"
          },
          "lastSuccess": {
            "$ref": "#/components/schemas/CustomerCallAnalysisAttempt"
          },
          "hasNewSources": {
            "type": "boolean"
          },
          "legacy": {
            "$ref": "#/components/schemas/CustomerCallLegacyAnalysisPage"
          }
        },
        "required": [
          "hasNewSources"
        ]
      },
      "CustomerCallRecordAnalysisCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "currentAttemptId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "errorCode": {
            "type": "string",
            "maxLength": 32
          },
          "lastSuccessId": {
            "type": "string",
            "format": "uuid"
          },
          "hasNewSources": {
            "type": "boolean"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallRecordSource"
            },
            "maxItems": 1000
          },
          "hasLegacyReport": {
            "type": "boolean",
            "description": "A metadata-qualified saved old Follow-up report exists and no modern last_success_id is stored. Detailed reading still verifies ciphertext and current source membership. Opens the existing analysis GET; never an attempt ID or an AI command."
          }
        },
        "required": [
          "hasNewSources",
          "sources"
        ]
      },
      "CallComparisonRecordContext": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recordId": {
            "type": "string",
            "format": "uuid"
          },
          "selectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "recordId",
          "selectionRevision"
        ]
      },
      "CallComparisonAssessment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grade": {
            "type": "string",
            "enum": [
              "excellent",
              "normal",
              "off_plan"
            ]
          },
          "verdict": {
            "type": "string",
            "maxLength": 500
          },
          "explanation": {
            "type": "string",
            "maxLength": 4000
          },
          "questionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true
          },
          "evidenceKeys": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "maxItems": 100,
            "uniqueItems": true
          }
        },
        "required": [
          "grade",
          "verdict",
          "explanation",
          "questionIds",
          "evidenceKeys"
        ]
      },
      "CallComparisonRecommendation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 1000
          },
          "questionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 100,
            "uniqueItems": true
          },
          "evidenceKeys": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "maxItems": 100,
            "uniqueItems": true
          }
        },
        "required": [
          "text",
          "questionIds",
          "evidenceKeys"
        ]
      },
      "CustomerCallRecordComparison": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "current": {
            "$ref": "#/components/schemas/CallComparisonAttempt"
          },
          "lastSuccess": {
            "$ref": "#/components/schemas/CallComparisonDetail"
          }
        }
      },
      "CustomerCallRecordComparisonCard": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "currentAttemptId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string",
            "maxLength": 16
          },
          "errorCode": {
            "type": "string",
            "maxLength": 64
          },
          "lastSuccessId": {
            "type": "string",
            "format": "uuid"
          },
          "hasNewSources": {
            "type": "boolean"
          }
        },
        "required": [
          "hasNewSources"
        ]
      },
      "CustomerCallComparisonStartInput": {
        "additionalProperties": false,
        "properties": {
          "commandKey": {
            "type": "string",
            "format": "uuid"
          },
          "planId": {
            "type": "string",
            "format": "uuid"
          },
          "planVersionId": {
            "type": "string",
            "format": "uuid"
          },
          "selectionRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/CallComparisonSelectedSource"
            }
          }
        },
        "required": [
          "commandKey",
          "planId",
          "planVersionId",
          "selectionRevision",
          "sources"
        ],
        "type": "object",
        "description": "Freeze exactly the selected current plan and source tickets. 1–20 physical sources, at most 100 questions, normalized source UTF-8 at most 2 MiB plus plan JSON at most 512 KiB. No truncation. GET preparation issues opaque fingerprints without materializing content versions. A stale selection/version/ticket returns conflict before AI."
      },
      "CustomerCallRecordCalendarState": {
        "type": "string",
        "enum": [
          "unknown",
          "active",
          "cancelled"
        ]
      },
      "CustomerCallSuggestion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string",
            "minLength": 64,
            "maxLength": 64
          },
          "recordId": {
            "type": "string",
            "format": "uuid"
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "analysisId": {
            "type": "string",
            "format": "uuid"
          },
          "field": {
            "type": "string",
            "enum": [
              "tasks",
              "conditions",
              "schedule",
              "hiringSteps",
              "experience",
              "skills",
              "education",
              "stoppers"
            ],
            "description": "Поле: tasks, conditions, schedule, hiringSteps — брифа; experience, skills, education, stoppers — профиля кандидата."
          },
          "text": {
            "type": "string",
            "maxLength": 500
          },
          "quote": {
            "type": "string",
            "maxLength": 500
          },
          "at": {
            "type": "string",
            "maxLength": 8
          },
          "callStartedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "recordId",
          "sourceId",
          "field",
          "text",
          "quote",
          "at",
          "callStartedAt"
        ]
      },
      "CustomerCallSuggestionsPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallSuggestion"
            },
            "maxItems": 800
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 4096
          }
        },
        "required": [
          "items"
        ]
      },
      "CustomerCallCalendarHistoryItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "active",
              "cancelled"
            ]
          },
          "changedAt": {
            "type": "string",
            "format": "date-time"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "state",
          "changedAt",
          "checkedAt"
        ]
      },
      "CustomerCallCalendarHistoryPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallCalendarHistoryItem"
            },
            "maxItems": 50
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 4096
          }
        },
        "required": [
          "items"
        ]
      },
      "CustomerCallLegacyAnalysisItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "tasks",
              "conditions",
              "schedule",
              "hiringSteps",
              "experience",
              "skills",
              "education",
              "stoppers"
            ],
            "description": "Поле: tasks, conditions, schedule, hiringSteps — брифа; experience, skills, education, stoppers — профиля кандидата."
          },
          "text": {
            "type": "string",
            "maxLength": 500
          },
          "quote": {
            "type": "string",
            "maxLength": 500
          },
          "at": {
            "type": "string",
            "maxLength": 8
          }
        },
        "required": [
          "field",
          "text",
          "quote",
          "at"
        ]
      },
      "CustomerCallLegacyAnalysisReport": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "legacy_followup_items"
            ],
            "description": "Transport discriminator; no persisted schema, prompt or parser version is claimed."
          },
          "sourceId": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallLegacyAnalysisItem"
            },
            "maxItems": 40
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "sourceId",
          "items",
          "truncated"
        ],
        "description": "Actual saved factual field items of one old Follow-up report, including a legitimate empty result and the original truncation fact. No modern attempt ID, timestamp, summary, topics, insights or gaps is synthesized."
      },
      "CustomerCallLegacyAnalysisPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "reports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerCallLegacyAnalysisReport"
            },
            "maxItems": 20
          },
          "nextCursor": {
            "type": "string",
            "maxLength": 4096
          }
        },
        "required": [
          "reports"
        ],
        "description": "At most twenty physical source slots are visited per page from a bounded inventory of at most 1000. A page with no reports can still have a nextCursor. Continue through the same analysis GET with legacyCursor. The cursor binds portal, vacancy, record and current source membership/order. A changed inventory or a newly saved modern success refuses continuation with conflict. Each page reads the current preserved old success; no immutable multi-page report snapshot is claimed."
      },
      "CustomerCallParticipantStatus": {
        "type": "object",
        "required": [
          "state",
          "calendarState",
          "chatState",
          "unfinished"
        ],
        "additionalProperties": false,
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "synced",
              "partial",
              "blocked"
            ]
          },
          "calendarState": {
            "type": "string",
            "enum": [
              "pending",
              "synced",
              "blocked"
            ]
          },
          "chatState": {
            "type": "string",
            "enum": [
              "pending",
              "synced",
              "blocked"
            ]
          },
          "safeReason": {
            "type": "string"
          },
          "unfinished": {
            "type": "boolean",
            "description": "Есть устойчивая очередь доставки: назначен следующий проход либо работу держит исполнитель. Не выводится из агрегированной причины отказа."
          }
        }
      },
      "TelegramScenariosVersion": {
        "type": "string",
        "pattern": "^(0|[1-9][0-9]{0,18}|1[0-7][0-9]{18}|18[0-3][0-9]{17}|184[0-3][0-9]{16}|1844[0-5][0-9]{15}|18446[0-6][0-9]{14}|184467[0-3][0-9]{13}|1844674[0-3][0-9]{12}|184467440[0-6][0-9]{10}|1844674407[0-2][0-9]{9}|18446744073[0-6][0-9]{8}|1844674407370[0-8][0-9]{6}|18446744073709[0-4][0-9]{5}|184467440737095[0-4][0-9]{4}|18446744073709550[0-9]{3}|18446744073709551[0-5][0-9]{2}|1844674407370955160[0-9]{1}|1844674407370955161[0-4]|18446744073709551615)$",
        "maxLength": 20,
        "description": "Каноническая десятичная строка uint64 от 0 до 18446744073709551615 включительно."
      }
    },
    "responses": {
      "SurveyForbidden": {
        "description": "Чтение форм: forbidden — право отсутствует; access_restricted — портал закрыт политикой доступа; survey_personal_session_required — операция требует личной сессии. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "forbidden",
          "survey_personal_session_required",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              }
            },
            "examples": {
              "access_restricted": {
                "summary": "Доступ к порталу ограничен",
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "Доступ к порталу ограничен",
                    "retryable": false
                  }
                }
              },
              "forbidden": {
                "summary": "Недостаточно прав на операцию",
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "Недостаточно прав на операцию",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "summary": "Нужна личная сессия",
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "Нужна личная сессия",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyWriteForbidden": {
        "description": "Запись форм: нужны view и edit над строкой; forbidden — права недостаточны. bad_origin — браузерный запрос вне кабинета. access_restricted — портал закрыт политикой доступа. survey_personal_session_required — нужна личная сессия. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "survey_personal_session_required",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              }
            },
            "examples": {
              "access_restricted": {
                "summary": "Доступ к порталу ограничен",
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "Доступ к порталу ограничен",
                    "retryable": false
                  }
                }
              },
              "bad_origin": {
                "summary": "Запись разрешена со страницы кабинета",
                "value": {
                  "error": {
                    "code": "bad_origin",
                    "message": "Запись разрешена со страницы кабинета",
                    "retryable": false
                  }
                }
              },
              "forbidden": {
                "summary": "Недостаточно прав на операцию",
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "Недостаточно прав на операцию",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "summary": "Нужна личная сессия",
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "Нужна личная сессия",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameAwardWriteForbidden": {
        "description": "Код forbidden: права game_award · edit нет. Код self_award: вручить самому себе нельзя. Код recipient_out_of_scope: получатель вне охвата вручающего. Код achievement_out_of_scope: ачивка чужого отдела — вручают ачивки компании и те, что вручающий может править. details.index — номер элемента. Код bad_origin: запрос записи пришёл не со страницы кабинета без ключа. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: геймификация выключена для портала вызывающего (флаг gamification); операция не выполняется, и права здесь ни при чём. Код game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет.",
        "x-error-codes": [
          "access_restricted",
          "achievement_out_of_scope",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "recipient_out_of_scope",
          "self_award",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameAwardRevokeForbidden": {
        "description": "Код forbidden: права game_award · edit нет. Код recipient_out_of_scope: получатель вручения вне охвата отзывающего. Код self_award: своё вручение не отзывают. Код bad_origin: запрос записи пришёл не со страницы кабинета без ключа. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: геймификация выключена для портала вызывающего (флаг gamification); операция не выполняется, и права здесь ни при чём. Код game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "recipient_out_of_scope",
          "self_award",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameScenarioWriteForbidden": {
        "description": "Код forbidden: права game_scenario · edit нет или запрос записи пришёл не со страницы кабинета без ключа (тогда код bad_origin). Код achievement_out_of_scope: ссылка на ачивку отдела, которую вызывающий не вправе править (game_achievement · edit), — ссылаться можно на ачивку компании и на ту, что вручил бы руками; details.field называет поле. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: геймификация выключена для портала вызывающего (флаг gamification); операция не выполняется, и права здесь ни при чём. Код game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет. Связей сценария с наградами ключ не меняет — тот же game_scope_denied: другое множество ачивок-наград в любой роли (ачивка сезона, награды заданий, уровней и вех), смена или снятие сохранённой награды задания (и у задания в архиве, и вместе с архивом в одном запросе) и возврат из архива задания с наградой, которой среди наград живых (не в архиве) заданий нет; награды заданий в архиве в набор не входят. Разрешены повтор того же набора (например, правка только порогов уровней), задания без награды, archived: true и удаление черновика. Ключ проверяется раньше сверки ссылок: новая ссылка по ключу отвечает 403 game_scope_denied, а не 404/422 или achievement_source_mismatch.",
        "x-error-codes": [
          "access_restricted",
          "achievement_out_of_scope",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameCreditWriteForbidden": {
        "description": "Код forbidden: права game_scenario · edit нет. Код self_credit: засчитать или подтвердить зачёт самому себе нельзя; details.index — номер элемента вызова. Код bad_origin: запрос записи пришёл не со страницы кабинета без ключа. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: геймификация выключена для портала вызывающего (флаг gamification); операция не выполняется, и права здесь ни при чём. Код game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "self_credit",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "Unauthenticated": {
        "description": "Нужен вход.",
        "x-error-codes": [
          "unauthenticated"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "AccessRestricted": {
        "description": "Код access_restricted: вход в сервис закрыт для портала вызывающего. Платформенный администратор ограничил доступ по режиму или по списку разрешённых порталов. Обратитесь к администратору сервиса. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Код forbidden или access_restricted: причины разные, исправляются по-разному.\n\nforbidden — недостаточно прав. У вызывающего нет права на эту операцию ни в каком объёме: отказ про операцию целиком, а не про отдельную запись. Ключ действует правами выпустившего его человека, и выдают их в кабинете. Какие права у вызывающего, отдаёт GET /api/v1/me в поле grants — по нему решают до вызова.\n\naccess_restricted — вход в сервис закрыт для портала вызывающего политикой доступа. Обратитесь к платформенному администратору. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "WriteForbidden": {
        "description": "Код forbidden, bad_origin или access_restricted: причины разные, и исправляются они по-разному.\n\nforbidden — права на эту операцию у вызывающего нет ни в каком объёме, и дело не в конкретной записи. Ключ действует правами выпустившего его человека: их выдают в кабинете, а до вызова они видны в поле grants ответа GET /api/v1/me.\n\nbad_origin — запрос пришёл не со страницы кабинета, а ключа в нём нет или к ключу приложена кука сессии кабинета. Ключ предъявлен, только когда заголовок Authorization: Bearer <ключ> несёт непустой токен: без заголовка, с другой схемой, с ключом без слова Bearer или с пустым токеном запрос проверяется как браузерный, а запись из браузера принимается только со страницы кабинета. Проверьте заголовок: читающие операции тому же клиенту отвечают 401. Если заголовок верен, уберите из запроса куку сессии кабинета.\n\naccess_restricted — вход в сервис закрыт для портала вызывающего политикой доступа. Обратитесь к платформенному администратору. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacationForbidden": {
        "description": "vacation_schedule_disabled — график отпусков у компании выключен настройкой vacation.schedule_enabled (состояние для вызывающего отдаёт GET /api/v1/me в поле features.vacationSchedule). Включает его администратор портала в настройках кабинета, ключом API настройка не пишется. Этот код получает только вызывающий с правом на операцию: без права — forbidden, и состояние настройки не раскрывается.\n\nОбщие отказы чтения: forbidden, access_restricted, service_access_required — см. Forbidden.",
        "x-error-codes": [
          "access_restricted",
          "forbidden",
          "service_access_required",
          "vacation_schedule_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacationWriteForbidden": {
        "description": "vacation_schedule_disabled — график отпусков у компании выключен настройкой vacation.schedule_enabled (состояние для вызывающего отдаёт GET /api/v1/me в поле features.vacationSchedule). Включает его администратор портала в настройках кабинета, ключом API настройка не пишется. Этот код получает только вызывающий с правом на операцию: без права — forbidden, и состояние настройки не раскрывается.\n\nОбщие отказы записи: forbidden, bad_origin, access_restricted, service_access_required — см. WriteForbidden.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "vacation_schedule_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacancyCreateForbidden": {
        "description": "Код forbidden по одной из двух причин: права vacancy · edit у вызывающего нет ни в каком объёме — тогда отказ приходит до разбора тела; или в теле без templateId указан этап вне черновика (поле stage), а правка вакансий у вызывающего ниже уровня «все» — тогда details.field = stage, и черновик заводится тем же запросом без stage и closeReasonTitle (с templateId этап вне черновика — не 403, а 400 invalid_value на любом уровне). У ключа уровень считается после его потолка. Код bad_origin — запрос пришёл не со страницы кабинета, а ключа в нём нет или к ключу приложена кука сессии кабинета. Код access_restricted — вход в сервис закрыт для портала вызывающего политикой доступа; обратитесь к платформенному администратору. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "bad_origin",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacancyArchiveForbidden": {
        "description": "Код archive_requires_vacancy_edit — строку открыло право своей заявки (vacancy_request · edit), а этап ему не по силам: своей заявкой в архив убираются и возвращаются только черновик (draft) и отклонённая заявка (rejected), прочие этапы — правом vacancy · edit. Право судится раньше холостого повтора, поэтому повтор автором над уже архивной завершённой — тот же отказ. Код forbidden — нет ни vacancy · edit, ни vacancy_request · edit ни в каком объёме; выданные права видны в поле grants ответа GET /api/v1/me. Код bad_origin — запрос пришёл не со страницы кабинета, а ключа в нём нет или к ключу приложена кука сессии кабинета. Код access_restricted — вход в сервис закрыт для портала вызывающего политикой доступа; обратитесь к платформенному администратору. Код service_access_required — порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "archive_requires_vacancy_edit"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "BatchForbidden": {
        "description": "Код bad_origin или access_restricted. Отказа по праву у пакета нет: права проверяет каждый вызов, и такой отказ приходит в errors, а не здесь.\n\nbad_origin — запрос без ключа пришёл не со страницы кабинета, или к ключу приложена кука сессии кабинета. Предъявите ключ заголовком Authorization: Bearer <ключ> и уберите куку.\n\naccess_restricted — вход в сервис закрыт для портала вызывающего политикой доступа; решает платформенный администратор. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "Предел частоты — код rate_limited. Ведро одно на ключ и сразу на весь контур /api/v1, а не на ручку: агент в цикле одинаково успешно займёт пул одной ручкой и пятью.\n\nТем же отказом сервис отвечает на одновременные запросы: запросов с ключом в работе у него не больше потолка — общего на сервис и своего у портала, одного на все ключи людей портала. Место освобождает чужой ответ, а не окно ведра, поэтому срок у такого отказа — секунда.\n\nСколько ждать, сказано дважды — заголовком Retry-After и полем error.details.retryAfterSec. Это целое число секунд, и оно не меньше единицы.\n\nЕдинственный отказ контура, у которого retryable истинно: его положено ПЕРЕЖИТЬ, а не разобрать, — подождать названный срок и повторить тот же запрос.",
        "x-error-codes": [
          "rate_limited"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "Internal": {
        "description": "Внутренняя ошибка — код internal.",
        "x-error-codes": [
          "internal"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "AbsenceLaunchForbidden": {
        "description": "Четыре разные причины отказа, и исправляются они по-разному.\n\nscenario_closed — ради него этот ответ и назван отдельно. Права на запуск у вызывающего есть, но сценарий на портале открыт с другим уровнем доступа: настройка говорит, с какого уровня его запускают (own — и работник на себя, dept — и руководитель на своих, all — кадровая служба), и уровень вызывающего ниже. Лечится настройкой сценария, а не выдачей прав.\n\nforbidden — права absence_process · launch нет ни в каком объёме; выдаются они в кабинете и видны в поле grants ответа GET /api/v1/me.\n\nbad_origin — запись пришла не со страницы кабинета и без годного ключа; разбор заголовка Authorization — в общем ответе #/components/responses/WriteForbidden.\n\naccess_restricted — вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "scenario_closed",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacationActualForbidden": {
        "description": "Код forbidden, bad_origin или access_restricted.\n\nforbidden — уровень vacation_schedule_entry · edit ниже all: факт и перенос отмечает кадровик. Отказ приходит до поиска строки. Права вызывающего — в поле grants ответа GET /api/v1/me.\n\nbad_origin — запрос пришёл не со страницы кабинета, а ключа в нём нет или к ключу приложена кука сессии кабинета: проверьте заголовок Authorization: Bearer <ключ> и уберите куку.\n\naccess_restricted — вход в сервис закрыт для портала вызывающего политикой доступа. Обратитесь к платформенному администратору. Код service_access_required: порталу нужен допуск к сервису.\n\nvacation_schedule_disabled — график отпусков у компании выключен настройкой vacation.schedule_enabled (состояние для вызывающего отдаёт GET /api/v1/me в поле features.vacationSchedule). Включает его администратор портала в настройках кабинета, ключом API настройка не пишется. Этот код получает только вызывающий с правом на операцию: без права — forbidden, и состояние настройки не раскрывается.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "vacation_schedule_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "TimesheetPrintForbidden": {
        "description": "Код forbidden, access_restricted или print_masked.\n\nforbidden — права timesheet · view нет ни в каком объёме. Тот же код — печати со следом (timesheet · view и edit на уровне all), пришедшей не со страницы сервиса: заголовок Sec-Fetch-Site cross-site или same-site, Origin не сервиса или метод HEAD. Номер документа при этом не выдаётся; копии без следа проверка не касается — это обычное чтение. Какие права у вызывающего, отдаёт GET /api/v1/me в поле grants.\n\naccess_restricted — вход в сервис закрыт для портала вызывающего политикой доступа. Обратитесь к платформенному администратору.\n\nprint_masked — в бланке были бы скрытые от вызывающего сведения о здоровье: клетка Б, Р или ОЖ чужого человека. Бланк печатает тот, кому вид открыт. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "forbidden",
          "print_masked",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "SurveyRunForbidden": {
        "description": "Коды отказа: forbidden, survey_personal_session_required, embed_forbidden, access_restricted. Ответ не включает отправленные значения. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "survey_personal_session_required",
          "embed_forbidden",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyRunWriteForbidden": {
        "description": "Коды отказа: forbidden, survey_personal_session_required, embed_forbidden, access_restricted, bad_origin. Ответ не включает отправленные значения. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "survey_personal_session_required",
          "embed_forbidden",
          "access_restricted",
          "bad_origin",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "bad_origin": {
                "value": {
                  "error": {
                    "code": "bad_origin",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyRunSettingsForbidden": {
        "description": "Коды отказа: forbidden, survey_personal_session_required, embed_forbidden, access_restricted, bad_origin, survey_newcomers_forbidden, survey_automatic_forbidden. survey_newcomers_forbidden — в набор новичков аудитории добавлен номер без просмотра оформления на уровне «все» (ключу API нужен ещё явный потолок). survey_automatic_forbidden — автоматический платный анализ ответов не разрешён: у включающего, копирующего или запускающего, либо у сохранённого инициатора режима нет права запускать анализ этого опроса (survey_answer · view и назначение контролирующим или ведение опроса); режим не переключается на ручной молча. Ответ не включает отправленные значения. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "survey_personal_session_required",
          "embed_forbidden",
          "access_restricted",
          "bad_origin",
          "service_access_required",
          "survey_newcomers_forbidden",
          "survey_automatic_forbidden"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "bad_origin": {
                "value": {
                  "error": {
                    "code": "bad_origin",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              },
              "survey_newcomers_forbidden": {
                "summary": "Нет права добавлять новичков",
                "value": {
                  "error": {
                    "code": "survey_newcomers_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_automatic_forbidden": {
                "summary": "Автоматический анализ не разрешён",
                "value": {
                  "error": {
                    "code": "survey_automatic_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyAutomaticForbidden": {
        "description": "Коды отказа: forbidden, survey_personal_session_required, embed_forbidden, access_restricted, bad_origin, survey_automatic_forbidden. Ответ не включает отправленные значения. service_access_required — нужен допуск к сервису. survey_automatic_forbidden — автоматический платный анализ ответов не разрешён: у включающего, копирующего или запускающего, либо у сохранённого инициатора режима нет права запускать анализ этого опроса (survey_answer · view и назначение контролирующим или ведение опроса); режим не переключается на ручной молча. Право запускать анализ: у запущенного опроса — доступ к ответам и назначение контролирующим или право править опрос (survey · edit); у черновика — survey_answer · view = own при будущем назначении контролирующим по выбору аудитории или all при будущем назначении либо праве править опрос. Ключу нужны явный потолок с клеткой survey_answer · view и право править опрос; под эмуляцией — отказ. Режим automatic без инициатора (automaticNeedsConfirm) — тоже отказ: такой опрос не запускается, пока режим не включит заново тот, кому это разрешено.",
        "x-error-codes": [
          "forbidden",
          "survey_personal_session_required",
          "embed_forbidden",
          "access_restricted",
          "bad_origin",
          "service_access_required",
          "survey_automatic_forbidden"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "bad_origin": {
                "value": {
                  "error": {
                    "code": "bad_origin",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              },
              "survey_automatic_forbidden": {
                "summary": "Автоматический анализ не разрешён",
                "value": {
                  "error": {
                    "code": "survey_automatic_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveySignalForbidden": {
        "description": "Коды отказа: forbidden, embed_forbidden, access_restricted. forbidden — ответы опроса сигнала смотрящему не открыты (survey_answer · view) или он под эмуляцией; ключу нужен явный потолок с survey_signal.view=all и клеткой survey_answer · view и суженные права опроса. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveySignalWriteForbidden": {
        "description": "Коды отказа: forbidden, embed_forbidden, access_restricted, bad_origin. forbidden — ответы опроса сигнала смотрящему не открыты (survey_answer · view) или он под эмуляцией; у команд работы с сигналом — завести, взять, назначить, комментировать, поставить срок, закрыть — ещё и когда работа ему закрыта: она только у контролирующего опроса с доступом к ответам, держатель all без назначения сигнал только читает. Отметке прочтения и закрепам в ленте сигнала хватает чтения. Ключу нужны явный потолок с survey_signal.view=all и клеткой survey_answer · view и суженные права опроса, для работы — также survey_signal.edit=all в потолке и survey.edit. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "bad_origin",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "bad_origin": {
                "value": {
                  "error": {
                    "code": "bad_origin",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "InterviewCreateRateLimited": {
        "description": "Предел частоты — код rate_limited. Ручка стоит под ведром ОТПРАВКИ ПИСЕМ (оно же у POST /api/v1/interviews/{id}/send): ведро считается на принципала и тратится ЛЮБЫМ созданием — оно стоит выше обработчика и тела запроса не видит, поэтому создание без sendInvite расходует его наравне с отправляющим. Сверх него на пути стоят общеконтурные вёдра и потолки одновременных запросов (см. #/components/responses/RateLimited); все они складываются — отказать может любое. Запросы под кукой идут мимо ВСЕХ общеконтурных: каждое из них стоит под условием ключа или Bearer. Но не мимо всех вообще — ведро отказов резолвера сессии считается по адресу, стоит ВЫШЕ ведра отправки и отвечает тем же кодом (см. #/components/responses/RateLimitedRefusals). Код delivery_limit: исчерпан суточный предел СМС.",
        "x-error-codes": [
          "rate_limited",
          "delivery_limit"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "delivery_limit",
                "message": "исчерпан суточный предел СМС"
              }
            }
          }
        }
      },
      "InterviewSendRateLimited": {
        "description": "У 429 этой ручки два разных источника, и оба уходят под одним статусом. Код rate_limited приходит от вёдер частоты и потолков одновременных запросов: они стоят на пути друг за другом и СКЛАДЫВАЮТСЯ — отказать может любое. Общеконтурные считаются не на отправку: у каждого свой ключ счёта — ключ, портал, адрес, сервис целиком (см. #/components/responses/RateLimited). Запросы под кукой идут мимо ВСЕХ общеконтурных: каждое из них стоит под условием ключа или Bearer. Но не мимо всех вообще — ведро отказов резолвера сессии считается по адресу, стоит ВЫШЕ ведра отправки и отвечает тем же кодом (см. #/components/responses/RateLimitedRefusals). Ведро отправки писем — своё: считается на принципала и стоит только у пары отправляющих ручек — создание приглашения (любое: ведро выше обработчика и тела запроса не видит, поэтому создание без письма тратит его наравне с отправляющим) и эта. Код resend_too_soon — предел одной СТРОКИ: следующая отправка того же приглашения раньше interview.ResendPause после предыдущей отвергается независимо от вёдер. Код delivery_limit: исчерпан суточный предел СМС.",
        "x-error-codes": [
          "rate_limited",
          "resend_too_soon",
          "delivery_limit"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "delivery_limit",
                "message": "исчерпан суточный предел СМС"
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "bad_request: неверные параметры.",
        "x-error-codes": [
          "bad_request"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "not_found: запись не найдена.",
        "x-error-codes": [
          "not_found"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "FeatureFlagsUnavailable": {
        "description": "Фича-флаги временно недоступны; повторите запрос.",
        "x-error-codes": [
          "feature_flags_unavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "feature_flags_unavailable",
                "message": "Фича-флаги временно недоступны; повторите запрос.",
                "retryable": true
              }
            }
          }
        }
      },
      "GameReadUnavailable": {
        "description": "Код feature_flags_unavailable: проверить флаг gamification портала сейчас не удалось; повторите запрос.\n\nКод game_reconciling: игры портала сверяют отмены событий HRM (отозванный принятый оффер, «Не вышел», возврат оформления в работу), записанные до включения игр, и чтения вручений ждут, пока эти отмены применятся, — иначе отменённое вручение показалось бы действующим. Повторите тот же запрос чуть позже; отмены внутри включённых игр чтений не держат.",
        "x-error-codes": [
          "feature_flags_unavailable",
          "game_reconciling"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "feature_flags_unavailable": {
                "value": {
                  "error": {
                    "code": "feature_flags_unavailable",
                    "message": "фича-флаги временно недоступны",
                    "retryable": true
                  }
                }
              },
              "game_reconciling": {
                "value": {
                  "error": {
                    "code": "game_reconciling",
                    "message": "Игры сверяют отменённые события HRM — повторите чуть позже",
                    "retryable": true
                  }
                }
              }
            }
          }
        }
      },
      "PlacementsCookieOnly": {
        "description": "Код forbidden: запрос предъявил ключ — сводка размещений отдаётся только кабинету (cookieOnly), — или у вызывающего нет права vacancy · view ни в каком объёме. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "сводка размещений вакансии доступна только из кабинета",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameForbidden": {
        "description": "Код feature_disabled: геймификация выключена для портала вызывающего (флаг gamification); операция не выполняется, и права здесь ни при чём.\n\nКод forbidden: у вызывающего нет права на эту игровую операцию ни в каком объёме. Ключ действует правами выпустившего его человека; их выдают в кабинете и видно в поле grants ответа GET /api/v1/me.\n\nКод access_restricted: вход в сервис закрыт для портала вызывающего политикой доступа — обратитесь к платформенному администратору. Код service_access_required: порталу нужен допуск к сервису.",
        "x-error-codes": [
          "access_restricted",
          "feature_disabled",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "OfferDeliveryForbidden": {
        "description": "Delivery authority refused (authorization_unproven or authority_scope_too_large), or this surface cannot deliver (embed_forbidden or offer_delivery_forbidden). The application edit permission is required (forbidden). Portal policy may refuse access (access_restricted or service_access_required); blocked sessions return blocked.",
        "x-error-codes": [
          "authorization_unproven",
          "authority_scope_too_large",
          "embed_forbidden",
          "offer_delivery_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required",
          "blocked"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "OfferDeliveryWriteForbidden": {
        "description": "Delivery authority refused (authorization_unproven or authority_scope_too_large), or this surface cannot deliver (embed_forbidden or offer_delivery_forbidden). The application edit permission is required (forbidden). Browser writes require a trusted origin (bad_origin). Portal policy may refuse access (access_restricted or service_access_required); blocked sessions return blocked.",
        "x-error-codes": [
          "authorization_unproven",
          "authority_scope_too_large",
          "embed_forbidden",
          "offer_delivery_forbidden",
          "forbidden",
          "bad_origin",
          "access_restricted",
          "service_access_required",
          "blocked"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "GameScopedWriteForbidden": {
        "description": "Код forbidden: у вызывающего нет права на эту операцию сценария ни в каком объёме; ключ API действует правами выпустившего его человека, суженными потолком ключа (их видно в поле grants ответа GET /api/v1/me).\n\nКод game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет.\n\nКод bad_origin: запрос записи без ключа пришёл не со страницы кабинета, или к ключу приложена кука сессии кабинета; ключ предъявляют заголовком Authorization: Bearer <ключ>.\n\nКод access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: игры выключены для портала вызывающего (флаг gamification), и операция не выполняется при любых правах.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "GameContractAddForbidden": {
        "description": "Код forbidden: права game_scenario · edit нет, или запрос записи пришёл не со страницы кабинета без ключа (тогда код bad_origin). Код catalog_only: включён строгий режим HR, а у вызывающего нет game_template · edit — задание добавляется только из библиотеки; details.field называет поле. Код achievement_out_of_scope: наградой задания названа ачивка отдела, которую вызывающий не вправе править (game_achievement · edit); details.field называет поле. Код game_scope_denied: запрос пришёл с ключом API, а объект операции не входит в gameScope ключа, у ключа нет gameScope или потолок ключа — «Все права» (без явного потолка); мутации игр по ключу требуют gameScope с этим объектом и явного потолка. Проверяется после 404 и прав на объект, до источника достижения и включённости, и ничего не меняет. Задание с наградой ключ добавляет, только если та же ачивка уже награда другого живого (не в архиве) задания этого сценария; награда задания в архиве не в счёт; ачивка сезона или уровня наградой задания по ключу не становится — связи сценария с наградами меняются из кабинета. Ключ проверяется раньше сверки ссылки: новая награда по ключу отвечает 403 game_scope_denied, а не 404/422 или achievement_source_mismatch. Код access_restricted: вход в сервис закрыт для портала политикой доступа. Код service_access_required: порталу нужен допуск к сервису. Код feature_disabled: игры выключены для портала вызывающего (флаг gamification), и операция не выполняется при любых правах.",
        "x-error-codes": [
          "access_restricted",
          "achievement_out_of_scope",
          "bad_origin",
          "catalog_only",
          "feature_disabled",
          "forbidden",
          "game_scope_denied",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "game_scope_denied": {
                "value": {
                  "error": {
                    "code": "game_scope_denied",
                    "message": "ключ API не открывает эту игровую операцию: ключу нужен игровой доступ к этому объекту и права, отмеченные по разделам, а не «Все права»",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "HHMetadataRateLimited": {
        "description": "Request rate limit reached: rate_limited. The request/session guard can reject any of the three HH metadata routes. The publication-context route does not consume the channel-call bucket. The publication-conditions and publication-tests routes also share a per-user channel-call limit with connection, publication and collection operations. Retry the same request after the number of seconds in Retry-After and error.details.retryAfterSec; this is a whole number rounded up, at least one. error.retryable is true.",
        "x-error-codes": [
          "rate_limited"
        ],
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying the same request; rounded up and at least one.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 1
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "rate_limited",
                "message": "слишком много запросов, повторите позже",
                "retryable": true,
                "details": {
                  "retryAfterSec": 1
                }
              }
            }
          }
        }
      },
      "HHConflict": {
        "description": "hh_context_stale; hh_context_required; hh_selection_invalid; hh_content_stale. State is unchanged; reload context/baseline before submitting a new selection.",
        "x-error-codes": [
          "hh_context_stale",
          "hh_context_required",
          "hh_selection_invalid",
          "hh_content_stale"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/HHError"
                }
              },
              "additionalProperties": false
            },
            "example": {
              "error": {
                "code": "hh_context_stale",
                "message": "HHConflict",
                "retryable": false
              }
            }
          }
        }
      },
      "AvitoCatalogWriteForbidden": {
        "description": "Catalog preparation writes require an enabled portal flag, current vacancy edit permission, service admission and a trusted browser origin.",
        "x-error-codes": [
          "feature_disabled",
          "forbidden",
          "service_access_required",
          "embed_forbidden",
          "bad_origin",
          "access_restricted"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "feature_disabled",
                "message": "The portal flag is disabled, current vacancy edit permission is missing, or service admission is denied.",
                "retryable": false
              }
            }
          }
        }
      },
      "AvitoCatalogForbidden": {
        "description": "The portal flag is disabled, current vacancy edit permission is missing, or service admission is denied.",
        "x-error-codes": [
          "feature_disabled",
          "forbidden",
          "service_access_required",
          "embed_forbidden",
          "access_restricted"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "feature_disabled",
                "message": "The portal flag is disabled, current vacancy edit permission is missing, or service admission is denied.",
                "retryable": false
              }
            }
          }
        }
      },
      "OfferActionWriteForbidden": {
        "description": "Write and current sender authority refusals",
        "x-error-codes": [
          "bad_origin",
          "authorization_unproven",
          "authority_scope_too_large",
          "embed_forbidden",
          "offer_delivery_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required",
          "blocked"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "bad_origin",
                "message": "Request refused"
              }
            }
          }
        }
      },
      "CallPlanInputInvalid": {
        "description": "Код bad_request: тело или параметры не разобрались. Код validation_error: нарушен предел либо принадлежность поля; details.field указывает поле команды (например content.sections[0].questions[0].text), details.reason=invalid.",
        "x-error-codes": [
          "bad_request",
          "validation_error"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "appMoveVacancyFeatureForbidden": {
        "description": "Operation refusal codes: access_restricted, bad_origin, feature_disabled, forbidden, service_access_required.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "feature_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "appRequestCreateFeatureUnavailable": {
        "description": "Operation refusal codes: blue_collar_disabled, feature_flags_unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-error-codes": [
          "blue_collar_disabled",
          "feature_flags_unavailable"
        ]
      },
      "appConfirmOfferChannelDeliveryFeatureForbidden": {
        "description": "Operation refusal codes: access_restricted, authority_scope_too_large, authorization_unproven, bad_origin, blocked, embed_forbidden, feature_disabled, forbidden, offer_delivery_forbidden, service_access_required.",
        "x-error-codes": [
          "authorization_unproven",
          "authority_scope_too_large",
          "embed_forbidden",
          "offer_delivery_forbidden",
          "forbidden",
          "bad_origin",
          "access_restricted",
          "service_access_required",
          "blocked",
          "feature_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "appConfirmOfferChannelDeliveryFeatureUnavailable": {
        "description": "Operation refusal codes: authority_unavailable, feature_flags_unavailable.",
        "x-error-codes": [
          "authority_unavailable",
          "feature_flags_unavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "authority_unavailable",
                "message": "Request refused"
              }
            }
          }
        }
      },
      "appOfferActionIssueFeatureUnavailable": {
        "description": "Operation refusal codes: authority_unavailable, dependency_unavailable, feature_flags_unavailable.",
        "x-error-codes": [
          "dependency_unavailable",
          "authority_unavailable",
          "feature_flags_unavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "authority_unavailable",
                "message": "Request refused"
              }
            }
          }
        },
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string",
              "const": "no-store"
            }
          },
          "Referrer-Policy": {
            "schema": {
              "type": "string",
              "const": "no-referrer"
            }
          }
        }
      },
      "appCreateInterviewFeatureForbidden": {
        "description": "Interview operation refusal codes: access_restricted, authorization_unproven, bad_origin, feature_disabled, forbidden, service_access_required.",
        "x-error-codes": [
          "access_restricted",
          "authorization_unproven",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "appCancelInterviewFeatureUnavailable": {
        "description": "Interview operation refusal codes: feature_flags_unavailable.",
        "x-error-codes": [
          "feature_flags_unavailable"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "feature_flags_unavailable",
                "message": "Фича-флаги временно недоступны; повторите запрос.",
                "retryable": true
              }
            }
          }
        }
      },
      "VacationReviewForbidden": {
        "description": "Решение по периоду недоступно: vacation_not_approver — вызывающий не согласующий владельца; vacation_self_review — период принадлежит вызывающему. Общие отказы записи: forbidden, bad_origin, access_restricted, service_access_required — см. WriteForbidden.\n\nvacation_schedule_disabled — график отпусков у компании выключен настройкой vacation.schedule_enabled (состояние для вызывающего отдаёт GET /api/v1/me в поле features.vacationSchedule). Включает его администратор портала в настройках кабинета, ключом API настройка не пишется. Этот код получает только вызывающий с правом на операцию: без права — forbidden, и состояние настройки не раскрывается.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "vacation_not_approver",
          "vacation_self_review",
          "vacation_schedule_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "VacationReplaceForbidden": {
        "description": "Флаг agree недоступен: vacation_not_approver — вызывающий не вправе согласовать период владельца. Общие отказы записи: forbidden, bad_origin, access_restricted, service_access_required — см. WriteForbidden.\n\nvacation_schedule_disabled — график отпусков у компании выключен настройкой vacation.schedule_enabled (состояние для вызывающего отдаёт GET /api/v1/me в поле features.vacationSchedule). Включает его администратор портала в настройках кабинета, ключом API настройка не пишется. Этот код получает только вызывающий с правом на операцию: без права — forbidden, и состояние настройки не раскрывается.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "vacation_not_approver",
          "vacation_schedule_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "SurveyResultsForbidden": {
        "content": {
          "application/json": {
            "examples": {
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция недоступна во встраивании",
                    "retryable": false
                  }
                }
              },
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "недостаточно прав",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            },
            "schema": {
              "additionalProperties": false,
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "type": "object"
            }
          }
        },
        "description": "Коды отказа: forbidden, embed_forbidden, access_restricted. forbidden — нет права survey_result.view (у ключа — в его потолке), ключ без явного потолка или ключ, выпустивший которого не привязан к сотруднику Битрикс24; проверяется до разбора параметров. embed_forbidden — во встраивании раздела нет. service_access_required — нужен допуск к сервису.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "service_access_required"
        ]
      },
      "SurveyAnalyticsForbidden": {
        "description": "Нет права survey_aggregate.view, явного потолка ключа или действующего читателя; эмуляция запрещена. Код forbidden.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "недостаточно прав",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция недоступна во встраивании",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyAnalyticsPersonalForbidden": {
        "description": "Нет права survey_answer.view (у ключа — в его потолке), явного потолка ключа или действующего читателя; ключ, выпустивший которого не привязан к сотруднику Битрикс24; эмуляция запрещена. survey_aggregate и survey_result эту операцию не открывают. Проверяется до разбора параметров и до запросов о сотруднике и анкете. Код forbidden.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ]
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "недостаточно прав",
                    "retryable": false
                  }
                }
              },
              "embed_forbidden": {
                "value": {
                  "error": {
                    "code": "embed_forbidden",
                    "message": "операция недоступна во встраивании",
                    "retryable": false
                  }
                }
              },
              "access_restricted": {
                "value": {
                  "error": {
                    "code": "access_restricted",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "service_access_required": {
                "summary": "Нужен допуск к сервису",
                "value": {
                  "error": {
                    "code": "service_access_required",
                    "message": "нужен допуск к сервису",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "CommunicationReadForbidden": {
        "description": "Communication access refusal: communication_forbidden, forbidden, access_restricted, service_access_required. Current row predicates and service admission apply; writes also require the configured request origin. Fresh mass-hiring work also requires the existing mass-hiring feature; exact durable receipt/history reads retain current permission checks.",
        "x-error-codes": [
          "communication_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required",
          "feature_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "CommunicationWriteForbidden": {
        "description": "Communication access refusal: communication_forbidden, forbidden, access_restricted, service_access_required, bad_origin. Current row predicates and service admission apply; writes also require the configured request origin. Fresh mass-hiring work also requires the existing mass-hiring feature; exact durable receipt/history reads retain current permission checks.",
        "x-error-codes": [
          "communication_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required",
          "bad_origin",
          "feature_disabled"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "ResponseViewReadForbidden": {
        "description": "ResponseView access refusal: authorization_unproven, response_view_forbidden, forbidden, access_restricted, service_access_required. Current row predicates and service admission apply; writes also require the configured request origin.",
        "x-error-codes": [
          "authorization_unproven",
          "response_view_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "ResponseViewWriteForbidden": {
        "description": "ResponseView access refusal: authorization_unproven, response_view_forbidden, forbidden, access_restricted, service_access_required, bad_origin. Current row predicates and service admission apply; writes also require the configured request origin.",
        "x-error-codes": [
          "authorization_unproven",
          "response_view_forbidden",
          "forbidden",
          "access_restricted",
          "service_access_required",
          "bad_origin"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "CommunicationRateLimited": {
        "description": "The shared API bucket returns rate_limited (see RateLimited). A connected provider may instead return channel_rate_limited; honor Retry-After before repeating the same command. Native interview preparation may return resend_too_soon for the existing resend pause, without enqueueing a message.",
        "x-error-codes": [
          "rate_limited",
          "channel_rate_limited",
          "resend_too_soon"
        ],
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "SurveyAnswersForbidden": {
        "description": "Коды forbidden, survey_personal_session_required, embed_forbidden, access_restricted и service_access_required — как в #/components/responses/SurveyRunForbidden. survey_anonymous_answers — опрос анонимный: ответов с именами, чисел из них и разборов у него нет ни у кого. Код получает только тот, кому открыта картина опроса, остальным — forbidden: отказ не выдаёт признак чужого опроса.",
        "x-error-codes": [
          "forbidden",
          "survey_personal_session_required",
          "embed_forbidden",
          "access_restricted",
          "service_access_required",
          "survey_anonymous_answers"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_personal_session_required": {
                "value": {
                  "error": {
                    "code": "survey_personal_session_required",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_anonymous_answers": {
                "value": {
                  "error": {
                    "code": "survey_anonymous_answers",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveyAnalyzeForbidden": {
        "description": "Коды forbidden, bad_origin, access_restricted и service_access_required — как в #/components/responses/WriteForbidden. survey_anonymous_answers — опрос анонимный: разбора ответов у него нет ни у кого. Код получает только тот, кому открыта картина опроса, остальным — forbidden: отказ не выдаёт признак чужого опроса.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "forbidden",
          "service_access_required",
          "survey_anonymous_answers"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_anonymous_answers": {
                "value": {
                  "error": {
                    "code": "survey_anonymous_answers",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "SurveySignalCreateForbidden": {
        "description": "Коды forbidden, embed_forbidden, access_restricted, bad_origin и service_access_required — как в #/components/responses/SurveySignalWriteForbidden. survey_anonymous_answers — опрос анонимный: сигнала по человеку и его ответу у него нет ни у кого. Код получает только тот, кому открыта картина опроса, остальным — forbidden: отказ не выдаёт признак чужого опроса.",
        "x-error-codes": [
          "forbidden",
          "embed_forbidden",
          "access_restricted",
          "bad_origin",
          "service_access_required",
          "survey_anonymous_answers"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/SurveyError"
                }
              },
              "required": [
                "error"
              ],
              "additionalProperties": false
            },
            "examples": {
              "forbidden": {
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              },
              "survey_anonymous_answers": {
                "value": {
                  "error": {
                    "code": "survey_anonymous_answers",
                    "message": "операция с опросом отклонена",
                    "retryable": false
                  }
                }
              }
            }
          }
        }
      },
      "StepRecordWriteForbidden": {
        "description": "Код forbidden, bad_origin, access_restricted или service_access_required — права на правку отклика нет, запрос пришёл не со страницы кабинета без ключа, портал ограничен политикой доступа или у человека нет доступа к сервису. Код step_record_not_owner — запись правит только внёсший её и рекрутер вакансии; у прочих с правом правки отклика запись только для чтения.",
        "x-error-codes": [
          "forbidden",
          "bad_origin",
          "access_restricted",
          "service_access_required",
          "step_record_not_owner"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "TelegramScenarioWriteForbidden": {
        "description": "Доступ к операции проверяется до её выполнения. Если ручка требует куку, ключ её не открывает. Записи нужен допустимый источник. Отключённый Telegram-сценарий возвращает feature_disabled. Коды: access_restricted, bad_origin, feature_disabled, forbidden, service_access_required.",
        "x-error-codes": [
          "access_restricted",
          "bad_origin",
          "feature_disabled",
          "forbidden",
          "service_access_required"
        ],
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "example": {
              "error": {
                "code": "forbidden",
                "message": "Запрос отклонён",
                "retryable": false
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Ключ API в заголовке «Authorization: Bearer <ключ>». Выпускается в кабинете, видит ровно один портал — тот, в котором выпущен, — и действует правами выпустившего."
      },
      "cookieSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "hrm_session",
        "description": "Только обычная кабинетная cookie-сессия; API-ключ и embed отклоняются."
      }
    }
  },
  "tags": [
    {
      "name": "Обратная связь сотрудников",
      "description": "Формы обратной связи: создание черновика, сохранение с проверкой ревизии, копирование с новыми UUID и архивирование. Портал и права survey_form · view/edit ограничивают каждую строку и ответ записи.",
      "x-slug": "employee-feedback"
    },
    {
      "name": "Кабинет",
      "description": "С чего начинается сеанс: кто вошёл, в каком портале и с какими ролями. Портал не передаётся параметром ни в одной операции — он берётся из предъявленного, и эта операция показывает, какой именно достался.",
      "x-slug": "account"
    },
    {
      "name": "Люди портала",
      "description": "Сотрудники ОДНОГО портала: справочник на чтение с фильтрами и курсорной страницей. Учётка в Битрикс24 есть не у всех, и это не пробел в данных: «синий воротничок» — полноправный сотрудник без неё, и таких большинство.",
      "x-slug": "people"
    },
    {
      "name": "План найма",
      "description": "Вакансии портала: завести, править поля, переводить по этапам. Этап меняется отдельной операцией, а не правкой поля: это переход с проверкой и записью в журнал. Куда вакансию можно перевести прямо сейчас, говорит поле allowedStages — правило переходов клиент не воспроизводит, а читает из ответа.",
      "x-slug": "hiring-plan"
    },
    {
      "name": "Справочники",
      "description": "Источники выпадающих списков плана найма: должности и причины. Адресуются ТЕКСТОМ, а не идентификатором: между названием и строкой справочника биекция. Должности ведёт человек с правом job_position · edit; заведение и правка вакансии берут только доступные строки и справочник не пополняют. Причины открытия и завершения заводятся той же транзакцией, что вакансия или её завершение, и остаются в справочнике портала навсегда. Подсказки ищут по подстроке без учёта регистра и отдают ограниченное число строк без курсора — предел назван в описании каждой.",
      "x-slug": "dictionaries"
    },
    {
      "name": "Отклики",
      "description": "Отклики на вакансии портала: кто претендует на какую вакансию и на каком он этапе. Отклик заводят руками, и кандидат находится по контакту — один телефон, одна почта или одно имя в Telegram означают одного человека во всех его откликах. Этап меняется отдельной операцией с проверкой исходного этапа; куда отклик можно перевести прямо сейчас, говорит поле allowedStages. В этапы со своими данными — offer — ведёт не смена этапа, а форма операции; какие такие этапы открыты отклику сейчас, говорит поле formStages.",
      "x-slug": "applications"
    },
    {
      "name": "Подключение",
      "description": "Протокол подключения Desktop к HRM по ключу API: device flow (RFC 8628) и auth-code flow (RFC 6749). Ручки контура не требуют аутентификации HRM — их вызывает Desktop до того, как у него есть ключ. Форма ответа отличается от кабинета: успех — голый объект без конверта data, отказ — {error, error_description} по RFC (спека § 14).",
      "x-slug": "connect"
    },
    {
      "name": "База кандидатов",
      "description": "Люди, откликавшиеся на вакансии портала: список со статусом по откликам, карточка с историей и заведение вручную.",
      "x-slug": "candidates"
    },
    {
      "name": "Собеседования",
      "description": "Свободное время собеседующих, приглашение кандидата и запись встречи в Б24. Раздел проверяет свою готовность ручкой readiness: скоуп calendar доходит до вебхука человека только с его следующим входом, и коробочные порталы им не обслуживаются вовсе.",
      "x-slug": "interviews"
    },
    {
      "name": "Пакет",
      "description": "Несколько вызовов одним запросом: по умолчанию до 50 операций по очереди, итог по id вызова и ссылки на id, заведённые прежними вызовами того же пакета. Так импорт укладывается в предел частоты: пакет по ключу стоит единицу ведра на каждые десять вызовов (умолчание; тариф или портал платформа может настроить иначе).",
      "x-slug": "batch"
    },
    {
      "name": "Производственный календарь",
      "description": "Справочник рабочих и нерабочих дней портала: календари регионов, загруженные годы и дни-исключения. Ручка resolve отвечает, рабочий ли день и сколько дней в периоде рабочих, праздничных и календарных — на неё опираются отпуска, командировки и табель.\n\nГода, которого нет в справочнике, не существует: расчёт по нему отвечает отказом, а не догадкой по правилу «понедельник—пятница».",
      "x-slug": "work-calendar"
    },
    {
      "name": "График отпусков",
      "description": "Единственный кадровый документ, который компания обязана утвердить до конца года и который собирается со всех сразу: завести график, внести периоды, увидеть пересечения, утвердить.\n\nДней у периода два: длина периода и дни отпуска — длина минус нерабочие праздничные (ст. 120 ТК). Второе считает производственный календарь, и по нему же проверяется порог статьи 125.",
      "x-slug": "vacation-schedule"
    },
    {
      "name": "Юрлица",
      "description": "Юридические лица портала: между ними переключается раздел отпусков, и по каждому ведётся своё — график на год, нормы, приказы и обмен с 1С. Т-7 подписывает руководитель юрлица, поэтому один документ на три юрлица не подпишет никто.\n\nСправочник — зеркало настроек CRM, оттуда же его берёт КЭДО для подписания; организация 1С связывается с ним отдельно. У портала всегда есть хотя бы одно юрлицо: оно заводится вместе с порталом, и пока оно единственное, переключателя на экране нет.",
      "x-slug": "legal-entities"
    },
    {
      "name": "Мероприятия",
      "description": "Мероприятия по отсутствиям — единица работы кадровика: отпуск, отзыв, перенос — это процессы с комплектом документов, подписями и сроком, а не записи. Мероприятие — единственное, что создаёт и меняет факт отсутствия; никакой экран не меняет даты в обход него.\n\nМаршрут один на все сценарии: комплект → подписание работником → подписание компанией → проведение в 1С:ЗУП. Срок — обещание, а не запрет: просроченное помечается и попадает в «горит», но не отменяется само.",
      "x-slug": "absence-processes"
    },
    {
      "name": "Геймификация",
      "description": "Игры отдела: «Сезон отдела» и слой челленджей. Сценарии с уровнями и заданиями, люди охвата, атомарный зачёт с идемпотентностью по externalId, решения по заявкам игроков и сторно, награды достигнутых уровней и очередь заявок. Право одно — game_scenario: задания, зачёты и награды своих прав не имеют. Мутации над объектами игр по ключу API — вручение и отзыв вручения, запись, подтверждение, отклонение и сторно зачёта, правка, удаление, старт и стоп сценария, его задания и выдача награды — требуют у ключа игровой scope (gameScope: snapshot точных ID собственных external-достижений и сценариев, который ключу задают в кабинете) с этим объектом и явного потолка прав; ключ без scope, с объектом вне scope или с потолком «все права» получает 403 game_scope_denied. Чтения по ключу не меняются.",
      "x-slug": "games"
    },
    {
      "name": "Процессы сотрудников",
      "description": "Шаблоны и самостоятельные процессы сотрудников, отдельно от оформления КЭДО.",
      "x-slug": "employee-processes"
    },
    {
      "name": "Шаблоны сообщений",
      "description": "Общие для портала варианты текста существующих почтовых сообщений.",
      "x-slug": "mail-templates"
    }
  ]
}
