openapi: 3.0.0 info: contact: email: supportautoload@avito.ru description: 'API для взаимодействия с иерархией аккаунтов в Авито **Авито API для бизнеса предоставляется согласно [Условиям использования](https://www.avito.ru/legal/pro_tools/public-api).** ' title: Иерархия Аккаунтов Access GetAhInfoV1 API version: '1' servers: - url: https://api.avito.ru/ tags: - name: GetAhInfoV1 paths: /getAhInfoV1: parameters: - description: Токен для авторизации in: header name: Authorization required: true schema: example: Bearer ACCESS_TOKEN type: string - description: список зон доступа, полученных приложением example: ah:access in: header name: X-Oauth-Scopes schema: type: string - description: выбранный флоу авторизации по протоколу OAuth 2.0 (client_credentials/authorization_code) example: authorization_code in: header name: X-Oauth-Flow schema: type: string get: description: 'Ручка для получения информации по ИА для пользователя. Если запрос делается от имени сотрудника, то будет возвращён список компаний, которым он принадлежит. ' operationId: getAhInfoV1 responses: '200': content: application/json: schema: description: Данные пользователя о статусе в иерархии аккаунтов properties: company: properties: isCompany: description: Является ли пользователь компанией type: boolean required: - isCompany type: object employees: items: properties: avitoCompanyId: description: Идентификатор компании nullable: true type: integer employeeId: description: Идентификатор сотрудника nullable: true type: integer isChief: description: Является ли пользователь руководителем type: boolean required: - isChief type: object type: array required: - employees - company type: object description: Успешный ответ '401': content: application/json: schema: $ref: '#/components/schemas/OpenApiError' description: Требуется аутентификация '500': content: application/json: schema: $ref: '#/components/schemas/OpenApiError' description: Внутренняя ошибка метода API security: - AuthorizationCode: - ah:access - ClientCredentials: [] summary: Получение полной информации о статусе пользователя в ИА tags: - GetAhInfoV1 components: schemas: OpenApiError: properties: error: properties: message: description: Текст ошибки example: Пользователь не авторизован type: string slug: description: Кодовое название ошибки example: user_unauthorized type: string type: description: Тип ошибки example: authorization_error type: string required: - message - slug type: object required: - error type: object securitySchemes: AuthorizationCode: description: Это API использует OAuth 2 с механизмом authorization_code. Используйте его для доступа к данным других пользователей при разработке стороннего приложения. [Подробнее](/api-catalog/auth/documentation#tag/ApplicationAccess) flows: authorizationCode: authorizationUrl: https://avito.ru/oauth scopes: ah:access: Взаимодействие с иерархией аккаунтов tokenUrl: https://api.avito.ru/token type: oauth2 ClientCredentials: description: Это API использует OAuth 2 с механизмом client_credentials. Используйте его для доступа к возможностям своей личной учетной записи. [Подробнее](#tag/Access) flows: clientCredentials: scopes: {} tokenUrl: https://api.avito.ru/token type: oauth2