{
  "openapi": "3.0.0",
  "info": {
    "title": "api/catalogs/organizations",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    },
    {
      "url": "https://api.ati.su"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1.2/catalogs/organizations": {
      "get": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение всех доступных организаций пользователя",
        "description": "Возвращает доступные вызывающему метод контакту организации",
        "operationId": "Organizations_GetOrganizations",
        "responses": {
          "200": {
            "description": "Организации",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Организации"
        ],
        "summary": "Добавление организации",
        "operationId": "Organizations_CreateOrganization",
        "requestBody": {
          "x-name": "dto",
          "description": "Данные организации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationEditDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленная организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations": {
      "get": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение всех доступных организаций пользователя",
        "description": "Возвращает доступные вызывающему метод контакту организации",
        "operationId": "Organizations_GetOrganizations2",
        "responses": {
          "200": {
            "description": "Организации",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Организации"
        ],
        "summary": "Добавление организации",
        "operationId": "Organizations_CreateOrganization2",
        "requestBody": {
          "x-name": "dto",
          "description": "Данные организации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationEditDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленная организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/filter": {
      "post": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение организаций пользователя по подразделениям",
        "description": "Позволяет получить все организации, доступные подразделению, указанному в запросе.\nЕсли организация доступна всем подразделениям, то она всегда будет присутствовать в ответе",
        "operationId": "Organizations_GetOrganizationsByDepartments",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель для фильтрации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilterOrganizationsDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Организации",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/filter": {
      "post": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение организаций пользователя по подразделениям",
        "description": "Позволяет получить все организации, доступные подразделению, указанному в запросе.\nЕсли организация доступна всем подразделениям, то она всегда будет присутствовать в ответе",
        "operationId": "Organizations_GetOrganizationsByDepartments2",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель для фильтрации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilterOrganizationsDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Организации",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/{organizationId}": {
      "get": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение организации пользователя по id",
        "operationId": "Organizations_GetOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Организации"
        ],
        "summary": "Изменение организации",
        "operationId": "Organizations_UpdateOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Данные организации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationEditDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененная организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Организации"
        ],
        "summary": "Удаление организации",
        "operationId": "Organizations_DeleteOrganization",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Успешное удаление организации"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/{organizationId}": {
      "get": {
        "tags": [
          "Организации"
        ],
        "summary": "Получение организации пользователя по id",
        "operationId": "Organizations_GetOrganization2",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Организации"
        ],
        "summary": "Изменение организации",
        "operationId": "Organizations_UpdateOrganization2",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Данные организации",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationEditDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененная организация",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Организации"
        ],
        "summary": "Удаление организации",
        "operationId": "Organizations_DeleteOrganization2",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "Id организации",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Успешное удаление организации"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/addresses": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение всех адресов пользователя",
        "operationId": "Addresses_GetAddresses",
        "responses": {
          "200": {
            "description": "Адреса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddressView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Добавление адреса",
        "operationId": "Addresses_CreateAddress",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель добавляемого адреса",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressUpsertDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленный адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/addresses": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение всех адресов пользователя",
        "operationId": "Addresses_GetAddresses2",
        "responses": {
          "200": {
            "description": "Адреса",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddressView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Добавление адреса",
        "operationId": "Addresses_CreateAddress2",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель добавляемого адреса",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressUpsertDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленный адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/addresses/{addressId}": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение адреса пользователя по id",
        "operationId": "Addresses_GetAddress",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Изменение адреса",
        "operationId": "Addresses_UpdateAddress",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id изменяемого адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Модель изменяемого адреса",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressUpsertDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененный адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Удаление адреса",
        "operationId": "Addresses_DeleteAddress",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id удаляемого адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Удаление адреса"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/addresses/{addressId}": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение адреса пользователя по id",
        "operationId": "Addresses_GetAddress2",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Изменение адреса",
        "operationId": "Addresses_UpdateAddress2",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id изменяемого адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Модель изменяемого адреса",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressUpsertDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененный адрес",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Удаление адреса",
        "operationId": "Addresses_DeleteAddress2",
        "parameters": [
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "Id удаляемого адреса",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Удаление адреса"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/addresses/types": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение типов адресов",
        "operationId": "Addresses_GetAddressTypes",
        "responses": {
          "200": {
            "description": "Типы адресов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RawAddressType"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/addresses/types": {
      "get": {
        "tags": [
          "Адреса организаций"
        ],
        "summary": "Получение типов адресов",
        "operationId": "Addresses_GetAddressTypes2",
        "responses": {
          "200": {
            "description": "Типы адресов",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RawAddressType"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/contactPersons": {
      "get": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Получение всех контактных лиц пользователя",
        "operationId": "ContactPerson_GetContactPersons",
        "responses": {
          "200": {
            "description": "Контактные лица",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactPersonView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Добавление контактного лица пользователя",
        "operationId": "ContactPerson_CreateContactPerson",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель контактного лица",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPersonSaveDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленное контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/contactPersons": {
      "get": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Получение всех контактных лиц пользователя",
        "operationId": "ContactPerson_GetContactPersons2",
        "responses": {
          "200": {
            "description": "Контактные лица",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ContactPersonView"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Добавление контактного лица пользователя",
        "operationId": "ContactPerson_CreateContactPerson2",
        "requestBody": {
          "x-name": "dto",
          "description": "Модель контактного лица",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPersonSaveDto"
              }
            }
          },
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Добавленное контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/v1.2/catalogs/organizations/contactPersons/{contactPersonId}": {
      "get": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Получение контактного лица пользователя по id",
        "operationId": "ContactPerson_GetContactPerson",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Изменение контактного лица пользователя",
        "operationId": "ContactPerson_UpdateContactPerson",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Модель контактного лица",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPersonSaveDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененное контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Удаление контактного лица пользователя",
        "operationId": "ContactPerson_DeleteContactPerson",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Удаление контактного лица пользователя"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    },
    "/gw/oauth2/catalogs/v1.2/organizations/contactPersons/{contactPersonId}": {
      "get": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Получение контактного лица пользователя по id",
        "operationId": "ContactPerson_GetContactPerson2",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "put": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Изменение контактного лица пользователя",
        "operationId": "ContactPerson_UpdateContactPerson2",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "requestBody": {
          "x-name": "dto",
          "description": "Модель контактного лица",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPersonSaveDto"
              }
            }
          },
          "x-position": 2
        },
        "responses": {
          "200": {
            "description": "Измененное контактное лицо",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPersonView"
                }
              }
            }
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Контактные лица организаций"
        ],
        "summary": "Удаление контактного лица пользователя",
        "operationId": "ContactPerson_DeleteContactPerson2",
        "parameters": [
          {
            "name": "contactPersonId",
            "in": "path",
            "required": true,
            "description": "Id контактного лица",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Удаление контактного лица пользователя"
          },
          "4XX": {
            "description": "Ошибка запроса. [Подробнее про ошибки API](https://ati.su/developers/documentation/errors/)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinalExceptionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWT": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "FinalExceptionView": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error_code": {
            "type": "string",
            "description": "Код ошибки"
          },
          "reason": {
            "type": "string",
            "description": "Причина ошибки"
          }
        }
      },
      "AddressType": {
        "type": "integer",
        "description": "Тип адреса\n            \n* `1` — Склад\n* `2` — Офис\n* `3` — Магазин",
        "x-enumNames": [
          "Stock",
          "Office",
          "Store"
        ],
        "enum": [
          1,
          2,
          3
        ]
      },
      "Residency": {
        "type": "integer",
        "description": "Резидентство\n            \n* `1` — Россия\n* `2` — Украина\n* `3` — Беларусь\n* `10` — Казахстан\n* `200` — Международное (другое)",
        "x-enumNames": [
          "Russia",
          "Ukraine",
          "Belarus",
          "Kazakhstan",
          "International"
        ],
        "enum": [
          1,
          2,
          3,
          10,
          200
        ]
      },
      "AddressView": {
        "type": "object",
        "description": "Адрес",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "ID адреса",
            "format": "guid"
          },
          "address": {
            "type": "string",
            "description": "Адрес"
          },
          "address_city_id": {
            "type": "integer",
            "description": "ID города.\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/geo/)",
            "format": "int32"
          },
          "address_latitude": {
            "type": "number",
            "description": "Координаты адреса: широта",
            "format": "double"
          },
          "address_longitude": {
            "type": "number",
            "description": "Координаты адреса: долгота",
            "format": "double"
          },
          "note": {
            "type": "string",
            "description": "Примечание"
          },
          "contact_persons": {
            "type": "array",
            "description": "Контакты адреса",
            "items": {
              "$ref": "#/components/schemas/ContactPersonView"
            }
          },
          "schedule_summary": {
            "type": "string",
            "description": "Текстовое описание времени работы"
          },
          "address_type": {
            "$ref": "#/components/schemas/AddressType"
          }
        }
      },
      "ContactPersonView": {
        "type": "object",
        "description": "Контактное лицо",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "ID контакного лица",
            "format": "guid"
          },
          "name": {
            "type": "string",
            "description": "ФИО"
          },
          "phone": {
            "type": "string",
            "description": "Телефон"
          },
          "extra_phone": {
            "type": "integer",
            "description": "Добавочный номер",
            "format": "int32",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Электронная почта"
          }
        }
      },
      "RawAddressType": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AddressType"
          },
          "name": {
            "type": "string"
          },
          "name_eng": {
            "type": "string"
          }
        }
      },
      "AddressUpsertDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "description": "Адрес",
            "nullable": true
          },
          "address_city_id": {
            "type": "integer",
            "description": "ID города.\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/geo/)",
            "format": "int32"
          },
          "address_latitude": {
            "type": "number",
            "description": "Координаты адреса: широта",
            "format": "double",
            "nullable": true
          },
          "address_longitude": {
            "type": "number",
            "description": "Координаты адреса: долгота",
            "format": "double",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Примечание",
            "nullable": true
          },
          "schedule_summary": {
            "type": "string",
            "description": "Текстовое описание времени работы",
            "nullable": true
          },
          "address_type": {
            "$ref": "#/components/schemas/AddressType"
          },
          "contact_person_ids": {
            "type": "array",
            "description": "ID контактных лиц",
            "items": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      },
      "ContactPersonSaveDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "ФИО",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Телефон",
            "nullable": true
          },
          "extra_phone": {
            "type": "integer",
            "description": "Добавочный номер",
            "format": "int32",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Электронная почта",
            "nullable": true
          }
        }
      },
      "OrganizationView": {
        "type": "object",
        "description": "Организация",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": "ID организации",
            "format": "guid"
          },
          "name": {
            "type": "string",
            "description": "Название"
          },
          "ownership": {
            "type": "integer",
            "description": "Организационно-правовая форма собственности.\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/firms/#get-v1.0-dictionaries-ownerships)",
            "format": "int32"
          },
          "residency": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/Residency"
              }
            ]
          },
          "inn": {
            "type": "string",
            "description": "Регистрационный номер (ИНН, ЕДРПОУ, УНП, БИН или их аналоги)",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Номер телефона организации",
            "nullable": true
          },
          "extra_phone": {
            "type": "integer",
            "description": "Добавочный номер",
            "format": "int32",
            "nullable": true
          },
          "docs_address": {
            "description": "Адрес местонахождения для документов",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganizationDocsAddressView2"
              }
            ]
          },
          "addresses": {
            "type": "array",
            "description": "Адреса",
            "items": {
              "$ref": "#/components/schemas/AddressView"
            }
          },
          "contact_persons": {
            "type": "array",
            "description": "Контакты организации",
            "items": {
              "$ref": "#/components/schemas/ContactPersonView"
            }
          },
          "all_departments_allowed": {
            "type": "boolean",
            "description": "Организация доступна всем подразделениям"
          },
          "department_ids": {
            "type": "array",
            "description": "Подразделения, которым доступна организация",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "OrganizationDocsAddressView2": {
        "type": "object",
        "description": "Адрес местонахождения для документов",
        "additionalProperties": false,
        "properties": {
          "postcode": {
            "type": "string",
            "description": "Почтовый индекс",
            "nullable": true
          },
          "city_id": {
            "type": "integer",
            "description": "Id населенного пункта\\\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/geo/)",
            "format": "int32",
            "nullable": true
          },
          "street_name": {
            "type": "string",
            "description": "Улица, проспект, переулок, бульвар и пр.",
            "nullable": true
          },
          "house_no": {
            "type": "string",
            "description": "Дом, строение, корпус, литера",
            "nullable": true
          },
          "office_no": {
            "type": "string",
            "description": "Офис, помещение и пр.",
            "nullable": true
          }
        }
      },
      "FilterOrganizationsDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "departments": {
            "type": "array",
            "description": "Список подразделений, по которым необходимо отфильтровать организации",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "OrganizationEditDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OrganizationDto"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "address_ids": {
                "type": "array",
                "description": "Адреса организации, id",
                "nullable": true,
                "items": {
                  "type": "string",
                  "format": "guid"
                }
              },
              "contact_person_ids": {
                "type": "array",
                "description": "Контактные лица организации, id",
                "nullable": true,
                "items": {
                  "type": "string",
                  "format": "guid"
                }
              }
            }
          }
        ]
      },
      "OrganizationDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Название",
            "nullable": true
          },
          "ownership": {
            "type": "integer",
            "description": "Организационно-правовая форма собственности.\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/firms/#get-v1.0-dictionaries-ownerships)",
            "format": "int32"
          },
          "all_departments_allowed": {
            "type": "boolean",
            "description": "Организация доступна всем подразделениям?\nЕсли нет, то в параметре department_ids необходимо указать, каким подразделениям доступна "
          },
          "department_ids": {
            "type": "array",
            "description": "Подразделения, которым доступна организация",
            "nullable": true,
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "residency": {
            "$ref": "#/components/schemas/Residency"
          },
          "inn": {
            "type": "string",
            "description": "Регистрационный номер (ИНН, ЕДРПОУ, УНП, БИН или их аналоги).\nИспользуйте номер в соответствии со своим резидентством",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Номер телефона организации",
            "nullable": true
          },
          "extra_phone": {
            "type": "integer",
            "description": "Добавочный номер",
            "format": "int32",
            "nullable": true
          },
          "docs_address": {
            "description": "Адрес местонахождения для документов",
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganizationDocsAddressDto"
              }
            ]
          }
        }
      },
      "OrganizationDocsAddressDto": {
        "type": "object",
        "description": "Адрес местонахождения для документов",
        "additionalProperties": false,
        "properties": {
          "postcode": {
            "type": "string",
            "description": "Почтовый индекс"
          },
          "city_id": {
            "type": "integer",
            "description": "Id населенного пункта\\\nЗначение из [словаря](https://ati.su/developers/api/dictionaries/geo/)",
            "format": "int32"
          },
          "street_name": {
            "type": "string",
            "description": "Улица, проспект, переулок, бульвар и пр."
          },
          "house_no": {
            "type": "string",
            "description": "Дом, строение, корпус, литера"
          },
          "office_no": {
            "type": "string",
            "description": "Офис, помещение и пр."
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Authorization: Bearer {authorizationToken}"
      },
      "JWT": {
        "type": "apiKey",
        "description": "Bearer {access_token}",
        "name": "Authorization",
        "in": "header"
      }
    }
  }
}