> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vargopartners.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Список клиентов

> Клиенты партнёра постранично, свежие первыми. Фильтр `status` — по подписке: `active`, `expired`, `suspended` — как `subscription.status`; `none` — подписки не было ни разу.



## OpenAPI

````yaml GET /api/partner/v1/clients
openapi: 3.1.0
info:
  title: VARGO Partner API
  version: '1.0'
  description: >-
    REST API для продажи VPN в своём боте, мини-аппе или на сайте: тарифы,
    счета, клиенты и их устройства. Клиент платит платформе, наценка партнёра
    начисляется на его баланс.


    Ключ партнёра — в заголовке `Authorization: Bearer vgo_live_…`, его выдаёт
    платформа. Ключ живёт только на сервере партнёра: в коде мини-аппа или сайта
    его быть не должно. Деньги — строки в рублях (`"150.00"`), даты — ISO-8601
    UTC. Ошибки — `{error: {code, message, fields}}`: ветвиться по `code`,
    `message` клиенту не показывать.
servers:
  - url: https://api.vargopartners.com
security:
  - PartnerKey: []
paths:
  /api/partner/v1/clients:
    get:
      tags:
        - Partner API
      summary: Список клиентов
      description: >-
        Клиенты партнёра постранично, свежие первыми. Фильтр `status` — по
        подписке: `active`, `expired`, `suspended` — как `subscription.status`;
        `none` — подписки не было ни разу.
      operationId: list_clients_api_partner_v1_clients_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            maximum: 100000
            minimum: 1
            description: Номер страницы, с 1
            default: 1
            title: Page
          description: Номер страницы, с 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Клиентов на странице, до 100
            default: 20
            title: Limit
          description: Клиентов на странице, до 100
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - active
                  - expired
                  - suspended
                  - none
                type: string
              - type: 'null'
            description: Статус подписки; без фильтра — все клиенты
            title: Status
          description: Статус подписки; без фильтра — все клиенты
      responses:
        '200':
          description: Страница клиентов
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClientsPage'
        '401':
          description: >-
            Ключ не принят: `UNAUTHORIZED`. Неверный и отозванный ключ,
            выключенный доступ к API — один ответ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: >-
            Запрос не прошёл проверку: `code` — `VALIDATION_ERROR`, в `fields` —
            поле и причина
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: >-
            Превышен лимит: `RATE_LIMITED` — повторить после паузы из
            `Retry-After`. У суточных лимитов (`NEW_CLIENTS_DAILY_LIMIT`,
            `TRIAL_DAILY_LIMIT`) заголовка нет — повторять на следующие сутки
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          headers:
            Retry-After:
              description: >-
                Пауза в секундах до повтора; есть у `RATE_LIMITED` и
                `LINK_ROTATE_TOO_SOON`
              schema:
                type: integer
                minimum: 1
        default:
          description: >-
            Ошибка — тот же конверт; ветвиться по `code`, список кодов — в
            документации
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    ApiClientsPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ApiClient'
          type: array
          title: Items
          description: Клиенты на странице
        total:
          type: integer
          title: Total
          description: Всего клиентов по фильтру
        page:
          type: integer
          title: Page
          description: Номер страницы
        limit:
          type: integer
          title: Limit
          description: Клиентов на странице
      type: object
      required:
        - items
        - total
        - page
        - limit
      title: ApiClientsPage
    ApiError:
      description: 'Конверт любой ошибки: статус HTTP плюс `error.code`.'
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
          description: Код, текст и поля ошибки
      required:
        - error
      title: ApiError
      type: object
    ApiClient:
      properties:
        client_id:
          type: string
          title: Client Id
          description: Id клиента в вашей системе
          examples:
            - user-42
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Когда клиент заведён, UTC
        subscription:
          anyOf:
            - $ref: '#/components/schemas/ApiSubscription'
            - type: 'null'
          description: Подписка; `null` — подписки не было ни разу
        trial_available:
          type: boolean
          title: Trial Available
          description: >-
            Пробный период сейчас можно выдать: подписки не было, пробный период
            включён партнёру, суточный лимит не исчерпан, клиент не заблокирован
      type: object
      required:
        - client_id
        - created_at
        - subscription
        - trial_available
      title: ApiClient
    ApiErrorBody:
      properties:
        code:
          description: Машиночитаемый код ошибки — ветвиться по нему
          examples:
            - VALIDATION_ERROR
          title: Code
          type: string
        message:
          description: >-
            Текст для логов на языке из `Accept-Language` (`ru` или `en`);
            клиенту не показывать
          title: Message
          type: string
        fields:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          description: Поле → причина у `VALIDATION_ERROR`; у остальных ошибок `null`
          title: Fields
      required:
        - code
        - message
        - fields
      title: ApiErrorBody
      type: object
    ApiSubscription:
      properties:
        status:
          type: string
          enum:
            - active
            - expired
            - suspended
          title: Status
          description: >-
            `active` — действует (у пробной `is_trial: true`); `expired` — срок
            вышел, продление возобновляет подписку с момента оплаты; `suspended`
            — срок идёт, но доступ приостановлен платформой
        is_trial:
          type: boolean
          title: Is Trial
          description: Пробная подписка
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Конец срока, UTC
        days_left:
          type: integer
          title: Days Left
          description: Дней до конца срока с округлением вверх; у истёкшей — 0
          examples:
            - 30
        subscription_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Url
          description: >-
            Ссылка подписки для VPN-приложения. Отдаётся и у истёкшей: после
            продления ссылка та же. `null` — ссылки пока нет
        connect:
          items:
            $ref: '#/components/schemas/ApiConnectLink'
          type: array
          title: Connect
          description: >-
            Готовые ссылки подключения по приложениям; пусто, пока нет ссылки
            подписки
        devices_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Devices Limit
          description: Сколько устройств можно подключить; `null` — без ограничения
      type: object
      required:
        - status
        - is_trial
        - expires_at
        - days_left
        - subscription_url
        - connect
        - devices_limit
      title: ApiSubscription
    ApiConnectLink:
      properties:
        app_id:
          type: string
          title: App Id
          description: Код приложения — как в `GET /apps`
          examples:
            - happ
        app_name:
          type: string
          title: App Name
          description: Название приложения
          examples:
            - Happ
        connect_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Connect Url
          description: >-
            Адрес для кнопки «Открыть в приложении»: https-страница, которая
            открывает приложение с подпиской
        qr_payload:
          anyOf:
            - type: string
            - type: 'null'
          title: Qr Payload
          description: 'Строка для QR-кода: его сканирует приложение'
        supports_manual_url:
          type: boolean
          title: Supports Manual Url
          description: Приложение принимает ссылку подписки, вставленную вручную
      type: object
      required:
        - app_id
        - app_name
        - connect_url
        - qr_payload
        - supports_manual_url
      title: ApiConnectLink
  securitySchemes:
    PartnerKey:
      type: http
      scheme: bearer
      description: >-
        Ключ партнёра `vgo_live_…`, его выдаёт платформа. Хранится только на
        сервере партнёра.

````