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

# Pair an egress node

> Register a new Android egress node for a sender and return its pairing payload. Encode `pairing.token`, `pairing.gatewayUrl`, and `pairing.wsPath` into the QR the Zavu Egress Node Android app scans. The token is not persisted — re-issue it with the pairing-token endpoint to show the QR again. Not available with test-mode API keys.



## OpenAPI

````yaml /openapi.json post /v1/whatsapp-alt/egress-nodes
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram/Messenger)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/whatsapp-alt/egress-nodes:
    post:
      tags:
        - WhatsApp Alternative
      summary: Pair an egress node
      description: >-
        Register a new Android egress node for a sender and return its pairing
        payload. Encode `pairing.token`, `pairing.gatewayUrl`, and
        `pairing.wsPath` into the QR the Zavu Egress Node Android app scans. The
        token is not persisted — re-issue it with the pairing-token endpoint to
        show the QR again. Not available with test-mode API keys.
      operationId: createWhatsAppAltEgressNode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsAppAltEgressNodeCreateRequest'
            example:
              senderId: sender_12345
              label: Store iPhone
      responses:
        '201':
          description: Egress node created with pairing payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsAppAltEgressNodePairingResponse'
        '400':
          description: Invalid request or test-mode key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Sender not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    WhatsAppAltEgressNodeCreateRequest:
      type: object
      required:
        - senderId
      properties:
        senderId:
          type: string
          description: Sender the egress device belongs to.
        label:
          type: string
          maxLength: 100
    WhatsAppAltEgressNodePairingResponse:
      type: object
      required:
        - node
        - pairing
      properties:
        node:
          $ref: '#/components/schemas/WhatsAppAltEgressNode'
        pairing:
          $ref: '#/components/schemas/WhatsAppAltPairing'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    WhatsAppAltEgressNode:
      type: object
      required:
        - id
        - senderId
        - status
        - createdAt
      properties:
        id:
          type: string
          description: >-
            Egress node ID. Use it as `egress.nodeId` when setting a session's
            egress.
        senderId:
          type: string
        label:
          type: string
        status:
          $ref: '#/components/schemas/WhatsAppAltEgressNodeStatus'
        exitIp:
          type: string
          description: Public IP the device currently exits from.
        exitCountry:
          type: string
          description: ISO country of the exit IP.
        net:
          type: string
          description: Network type reported by the device (wifi, cell, other).
        lastSeenAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
    WhatsAppAltPairing:
      type: object
      required:
        - token
        - gatewayUrl
        - wsPath
      properties:
        token:
          type: string
          description: >-
            Short-lived HMAC pairing token. Hand it to the Zavu Egress Node
            Android app by encoding `token`, `gatewayUrl`, and `wsPath` into the
            pairing QR the app scans. The token is not persisted — re-issue it
            with `POST /v1/whatsapp-alt/egress-nodes/{nodeId}/pairing-token` to
            show the QR again.
        gatewayUrl:
          type: string
          description: WSS gateway the Android device dials out to.
        wsPath:
          type: string
          example: /egress/agent
        expiresAt:
          type: string
          format: date-time
          description: When the pairing token expires.
    WhatsAppAltEgressNodeStatus:
      type: string
      description: >-
        pending = paired but never connected; online = tunnel is live; offline =
        the last tunnel dropped.
      enum:
        - pending
        - online
        - offline
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````