{
  "openapi": "3.0.0",
  "info": {
    "title": "api/catalogs/geo-lists",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/scrolls/v1/geo": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "GeoLists"
        ],
        "summary": "Метод получения списка Гео списков пользователя"
      },
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "GeoLists"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/GeoListElementPublicGeoListPublic"
        },
        "summary": "Метод добавления Гео списка"
      },
      "put": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "GeoLists"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/GeoListElementPublicGeoListPublic"
        },
        "summary": "Метод изменения Гео списка"
      }
    },
    "/scrolls/v1/geo/{listId}": {
      "get": {
        "parameters": [
          {
            "description": "Идентификатор Гео списка",
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "GeoLists"
        ],
        "summary": "Метод получения Гео списка по идентификатору"
      },
      "delete": {
        "parameters": [
          {
            "description": "Идентификатор списка",
            "in": "path",
            "name": "listId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "CommonList"
        ],
        "summary": "Метод удаляет список заданной фирмы"
      }
    },
    "/scrolls/v1/geo/ids": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "GeoLists"
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "description": "Идентификаторы Гео списка",
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              }
            },
            "application/json": {
              "schema": {
                "description": "Идентификаторы Гео списка",
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              }
            },
            "application/json-patch+json": {
              "schema": {
                "description": "Идентификаторы Гео списка",
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              }
            },
            "text/json": {
              "schema": {
                "description": "Идентификаторы Гео списка",
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              }
            }
          },
          "description": "Идентификаторы Гео списка"
        },
        "summary": "Публичный метод получения Гео списков по идентификаторам"
      }
    },
    "/scrolls/v1/geo/elements": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GeoListElementPublicBatchResultItem"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "ListElementsBatch"
        ],
        "requestBody": {
          "content": {
            "application/*+json": {
              "schema": {
                "description": "\"Элементы списка",
                "items": {
                  "$ref": "#/components/schemas/GeoListElementPublic"
                },
                "type": "array"
              }
            },
            "application/json": {
              "schema": {
                "description": "\"Элементы списка",
                "items": {
                  "$ref": "#/components/schemas/GeoListElementPublic"
                },
                "type": "array"
              }
            },
            "application/json-patch+json": {
              "schema": {
                "description": "\"Элементы списка",
                "items": {
                  "$ref": "#/components/schemas/GeoListElementPublic"
                },
                "type": "array"
              }
            },
            "text/json": {
              "schema": {
                "description": "\"Элементы списка",
                "items": {
                  "$ref": "#/components/schemas/GeoListElementPublic"
                },
                "type": "array"
              }
            }
          },
          "description": "\"Элементы списка"
        },
        "summary": "Метод добавления элементов в Гео список"
      },
      "delete": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GuidBatchResultItem"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client Error"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Server Error"
          }
        },
        "tags": [
          "ListElementsBatch"
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/Body"
        },
        "summary": "Метод удаления элементов из списков по их идентификаторам"
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "GeoListElementPublic": {
        "properties": {
          "city_id": {
            "description": "Идентификатор города",
            "format": "int32",
            "type": "integer"
          },
          "city_name": {
            "description": "Название города",
            "type": "string"
          },
          "country_id": {
            "description": "Идентификатор страны",
            "format": "int32",
            "type": "integer"
          },
          "country_name": {
            "description": "Название страны",
            "type": "string"
          },
          "id": {
            "description": "Идентификатор элемента Гео списка",
            "format": "uuid",
            "type": "string"
          },
          "list_id": {
            "description": "Идентификатор Гео списка",
            "format": "uuid",
            "type": "string"
          },
          "owner_ati_id": {
            "type": "string"
          },
          "region_id": {
            "description": "Идентификатор региона",
            "format": "int32",
            "type": "integer"
          },
          "region_name": {
            "description": "Название региона",
            "type": "string"
          }
        },
        "type": "object"
      },
      "GeoListElementPublicBatchResultItem": {
        "properties": {
          "status": {
            "description": "Статус: \r\n0 - успешно; \r\n2 - у вас нет прав на редактирование этого персонального списка, владелец другой контакт вашей фирмы; \r\n4 - такой список не найден; \r\n6 - такой элемент уже есть в этом списке",
            "format": "int32",
            "type": "integer"
          },
          "value": {
            "$ref": "#/components/schemas/GeoListElementPublic"
          }
        },
        "type": "object"
      },
      "GeoListElementPublicGeoListPublic": {
        "properties": {
          "ati_id": {
            "description": "Идентификатор фирмы",
            "type": "string"
          },
          "contact_id": {
            "description": "Идентификатор контакта",
            "format": "int32",
            "type": "integer"
          },
          "description": {
            "description": "Описание списка",
            "type": "string"
          },
          "elements": {
            "description": "Элементы списка",
            "items": {
              "$ref": "#/components/schemas/GeoListElementPublic"
            },
            "type": "array"
          },
          "emoji": {
            "description": "Эмодзи (html-entity)",
            "type": "string"
          },
          "fixed": {
            "type": "boolean"
          },
          "id": {
            "description": "Идентификатор списка",
            "format": "uuid",
            "type": "string"
          },
          "is_global": {
            "description": "Глобальный ли список",
            "type": "boolean"
          },
          "name": {
            "description": "Название списка",
            "type": "string"
          },
          "personal": {
            "description": "Персональный ли список",
            "type": "boolean"
          },
          "type": {
            "description": "Тип списка",
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "GuidBatchResultItem": {
        "properties": {
          "status": {
            "description": "Статус: \r\n0 - успешно; \r\n2 - у вас нет прав на редактирование этого персонального списка, владелец другой контакт вашей фирмы; \r\n4 - такой список не найден; \r\n6 - такой элемент уже есть в этом списке",
            "format": "int32",
            "type": "integer"
          },
          "value": {
            "description": "Значение",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "requestBodies": {
      "Body": {
        "content": {
          "application/*+json": {
            "schema": {
              "description": "Идентификаторы элементов",
              "items": {
                "format": "uuid",
                "type": "string"
              },
              "type": "array"
            }
          },
          "application/json": {
            "schema": {
              "description": "Идентификаторы элементов",
              "items": {
                "format": "uuid",
                "type": "string"
              },
              "type": "array"
            }
          },
          "application/json-patch+json": {
            "schema": {
              "description": "Идентификаторы элементов",
              "items": {
                "format": "uuid",
                "type": "string"
              },
              "type": "array"
            }
          },
          "text/json": {
            "schema": {
              "description": "Идентификаторы элементов",
              "items": {
                "format": "uuid",
                "type": "string"
              },
              "type": "array"
            }
          }
        },
        "description": "Идентификаторы элементов"
      },
      "GeoListElementPublicGeoListPublic": {
        "content": {
          "application/*+json": {
            "schema": {
              "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
            }
          },
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
            }
          },
          "application/json-patch+json": {
            "schema": {
              "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
            }
          },
          "text/json": {
            "schema": {
              "$ref": "#/components/schemas/GeoListElementPublicGeoListPublic"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      }
    }
  }
}