> ## 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.

# Перевыпустить ссылку подписки

> Новая ссылка подписки; старая сразу перестаёт работать, и клиент добавляет подписку в приложение заново. Не чаще раза в час на клиента: иначе `429 LINK_ROTATE_TOO_SOON`, пауза в секундах — в заголовке `Retry-After`. Без действующей подписки — `400 NO_ACTIVE_SUBSCRIPTION`.



## OpenAPI

````yaml POST /api/partner/v1/clients/{client_id}/rotate-link
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/{client_id}/rotate-link:
    post:
      tags:
        - Partner API
      summary: Перевыпустить ссылку подписки
      description: >-
        Новая ссылка подписки; старая сразу перестаёт работать, и клиент
        добавляет подписку в приложение заново. Не чаще раза в час на клиента:
        иначе `429 LINK_ROTATE_TOO_SOON`, пауза в секундах — в заголовке
        `Retry-After`. Без действующей подписки — `400 NO_ACTIVE_SUBSCRIPTION`.
      operationId: rotate_link_api_partner_v1_clients__client_id__rotate_link_post
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9._:@+-]*[A-Za-z0-9_:@+-][A-Za-z0-9._:@+-]*$
            description: Id клиента в вашей системе
            title: Client Id
          description: Id клиента в вашей системе
      responses:
        '200':
          description: Клиент с новой ссылкой
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiClient'
        '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:
    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
    ApiError:
      description: 'Конверт любой ошибки: статус HTTP плюс `error.code`.'
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
          description: Код, текст и поля ошибки
      required:
        - error
      title: ApiError
      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
    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
    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_…`, его выдаёт платформа. Хранится только на
        сервере партнёра.

````