{
 "openapi": "3.1.0",
 "info": {
  "title": "Корпоративные ИИ-агенты — API заявки",
  "version": "1.0.0",
  "description": "Заявка на аудит, пилот или внедрение ИИ-агентов от имени человека. Заявка договор не заключает (оферта, п. 3.1). Прайс-лист: https://corporate-agents.ru/price.json",
  "contact": {
   "email": "info@corporate-agents.ru"
  },
  "termsOfService": "https://corporate-agents.ru/oferta/"
 },
 "servers": [
  {
   "url": "https://corporate-agents.ru"
  }
 ],
 "paths": {
  "/api/v1/request": {
   "post": {
    "summary": "Оставить заявку",
    "operationId": "createRequest",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Request"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Заявка принята",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "id": {
           "type": "string",
           "example": "CA-20261104-120000-a1b2c3"
          },
          "message": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Ошибки полей: объект errors"
     },
     "429": {
      "description": "Больше 5 заявок с одного адреса за сутки"
     },
     "503": {
      "description": "Приём заявок временно недоступен"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Request": {
    "type": "object",
    "required": [
     "name",
     "email",
     "phone",
     "company",
     "consent"
    ],
    "properties": {
     "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 60
     },
     "email": {
      "type": "string",
      "format": "email"
     },
     "phone": {
      "type": "string",
      "description": "Номер без кода страны (для RU — 10 цифр) или с + и кодом при country=XX"
     },
     "country": {
      "type": "string",
      "default": "RU",
      "description": "ISO 3166-1 alpha-2"
     },
     "company": {
      "type": "string",
      "minLength": 2,
      "maxLength": 120
     },
     "department": {
      "type": "string",
      "enum": [
       "prodazhi",
       "zakupki",
       "podderzhka",
       "finansy",
       "hr",
       "rukovoditel",
       "drugoe"
      ],
      "default": "drugoe"
     },
     "package": {
      "type": "string",
      "enum": [
       "audit",
       "pilot",
       "vnedrenie",
       "konsult"
      ],
      "default": "konsult"
     },
     "message": {
      "type": "string",
      "maxLength": 2000
     },
     "consent": {
      "type": "boolean",
      "description": "Согласие человека на обработку персональных данных — должно быть true"
     }
    }
   }
  }
 }
}