{
  "openapi": "3.0.3",
  "info": {
    "description": "API раздела \"Список компаний с выявленными признаками нелегальной деятельности на финансовом рынке\"",
    "version": "1.0",
    "title": "Warning list API"
  },
  "servers": [
    {
      "url": "http://www.cbr.ru/warninglistapi/",
      "description": "Bank of Russia"
    }
  ],
  "paths": {
    "/Search": {
      "get": {
        "parameters": [
          {
            "name": "sphrase",
            "in": "query",
            "explode": true,
            "description": "Фраза для поиска (поиск по названию, адресу или сайту, ИНН)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thema",
            "in": "query",
            "explode": true,
            "description": "Идентификатор признака нелегальной деятельности, установленного Банком России",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "okato",
            "in": "query",
            "explode": true,
            "description": "Код ОКАТО субъекта Российской Федерации (из Lib/Regions)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "explode": true,
            "description": "Дата внесения (начало периода фильтрации)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "explode": true,
            "description": "Дата внесения (окончание периода фильтрации)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "explode": true,
            "description": "Номер страницы (0 - первая страница)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "description": "Поиск организаций по параметрам",
        "responses": {
          "200": {
            "description": "dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Search"
                }
              }
            }
          }
        }
      }
    },
    "/lib": {
      "get": {
        "parameters": [],
        "description": "Справочники",
        "responses": {
          "200": {
            "description": "dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/lib"
                }
              }
            }
          }
        }
      }
    },
    "/DetailInfo": {
      "get": {
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "explode": true,
            "description": "Идентификатор организации",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "description": "Данные по организации (полная информация)",
        "responses": {
          "200": {
            "description": "dataset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetailInfo"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Search": {
        "type": "object",
        "properties": {
          "Data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Идентификатор организации",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                },
                "dt": {
                  "description": "Дата внесения",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "nameOrg": {
                  "description": "Название организации",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "comment": {
                  "description": "Комментарий",
                  "type": "string",
                  "format": "",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "lib": {
        "type": "object",
        "properties": {
          "Themas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Идентификатор признака нелегальной деятельности, установленного Банком России",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                },
                "signRus": {
                  "description": "Наименование  (рус.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "signEng": {
                  "description": "Наименование (англ.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                }
              }
            }
          },
          "Regions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "reg_name": {
                  "description": "Наименование субъекта Российской Федерации (рус.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "reg_eng_name": {
                  "description": "Наименование субъекта Российской Федерации (англ.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "okato": {
                  "description": "Код ОКАТО",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "DetailInfo": {
        "type": "object",
        "properties": {
          "Info": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Идентификатор организации",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                },
                "dt": {
                  "description": "Дата внесения",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "nameOrg": {
                  "description": "Название организации",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "inn": {
                  "description": "ИНН",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "addr": {
                  "description": "Адрес",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "site": {
                  "description": "Список сайтов",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "info": {
                  "description": "Дополнительная информация",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "dateUpdate": {
                  "description": "Дата последнего обновления данных",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "isLikvid": {
                  "description": "Организация ликвидирована",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "comment": {
                  "description": "Комментарий",
                  "type": "string",
                  "format": "",
                  "nullable": true
                }
              }
            }
          },
          "Signs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Идентификатор  признака нелегальной деятельности, установленного Банком России",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                },
                "signRus": {
                  "description": "Название (рус.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "signEng": {
                  "description": "Название (eng.)",
                  "type": "string",
                  "format": "",
                  "nullable": true
                }
              }
            }
          },
          "Regions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "Наименование субъекта Российской Федерации",
                  "type": "string",
                  "format": "",
                  "nullable": true
                },
                "okato": {
                  "description": "Код ОКАТО",
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                }
              }
            }
          }
        }
      }
    }
  }
}