{
  "openapi": "3.1.0",
  "info": {
    "title": "Проверка клиента",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.x-hub.online/api/v1"
    }
  ],
  "paths": {
    "/kyc/register": {
      "post": {
        "operationId": "registerKyc",
        "summary": "Подать данные клиента",
        "security": [
          {
            "apiKey": [],
            "apiSecret": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestBody"
              }
            }
          }
        }
      }
    },
    "/kyc/check": {
      "post": {
        "operationId": "checkKyc",
        "summary": "Проверить статус",
        "security": [
          {
            "apiKey": [],
            "apiSecret": []
          }
        ]
      }
    },
    "/kyc/upload-url": {
      "post": {
        "operationId": "kycUploadUrl",
        "summary": "Получить адрес для загрузки файла",
        "security": [
          {
            "apiKey": [],
            "apiSecret": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      },
      "apiSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Secret"
      }
    },
    "schemas": {
      "RequestBody": {
        "type": "object",
        "properties": {
          "phone": {
            "type": "string",
            "pattern": "^\\+7\\d{10}$"
          },
          "selfie_key": {
            "type": "string",
            "minLength": 1
          },
          "document_key": {
            "type": "string",
            "minLength": 1
          },
          "address_key": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "user_type": {
            "type": "string",
            "enum": [
              "individual",
              "legal_entity"
            ]
          },
          "telegram_username": {
            "type": "string",
            "maxLength": 64
          },
          "telegram_user_id": {
            "type": "integer",
            "exclusiveMinimum": true,
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "phone"
        ],
        "additionalProperties": false
      }
    }
  }
}
