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

# Connect a preassigned line

> Connect a preassigned line



## OpenAPI

````yaml openapi.json POST /v1/onboarding/connect
openapi: 3.1.0
info:
  title: Watahub API
  version: 0.2.0
  description: >-
    Tenant API of Watahub, the multi-tenant WhatsApp Cloud API gateway.
    Authenticate every request with your API key as `Authorization: Bearer
    <key>` or `X-API-Key: <key>`.


    - Shapes the gateway owns are closed: no other field appears.

    - Records that come from Meta are open: documented fields are listed and any
    other field Meta adds is passed through.

    - The `/vN.N` proxy passes Meta's body and status through untouched; the
    version in the path is accepted and ignored.
servers:
  - url: https://cloud.watahub.dev
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Messages
  - name: Media
  - name: Templates
  - name: Graph-compatible proxy
    description: >-
      Drop-in for Meta's Graph API on three routes. Meta's response is returned
      as is.
  - name: Phones
    description: Phones
  - name: Conversations
    description: Conversations
  - name: Connect
    description: Connect
  - name: Customers
    description: Customers
  - name: Webhooks
    description: Webhooks
  - name: Logs
    description: Logs
  - name: Health
    description: Health
  - name: Message templates
    description: >-
      Templates cached by the gateway per WABA; synced from Meta and required by
      broadcasts.
  - name: Broadcasts
    description: >-
      Send one approved template to up to 500 recipients; sending is queued and
      drained in the background.
paths:
  /v1/onboarding/connect:
    post:
      tags:
        - Connect
      summary: Connect a preassigned line
      description: >-
        Requires a phone/WABA preassigned to the account. Exchanges the code,
        stores the token encrypted, then subscribes and registers. A later step
        can fail with the token already stored; inspect the returned step before
        retrying.
      operationId: onboardingConnect
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnboardingConnect'
      responses:
        '200':
          description: Steps result.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    OnboardingConnect:
      type: object
      required:
        - code
        - wabaId
        - phoneNumberId
        - pin
      properties:
        code:
          type: string
          description: Embedded Signup code.
        wabaId:
          type: string
          pattern: ^\d{1,32}$
        phoneNumberId:
          type: string
          pattern: ^\d{1,32}$
        pin:
          type: string
          pattern: ^\d{6}$
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Invalid input (validation error, non-canonical path).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: Account requires payment.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Too many requests (account rate limit, 10 failed keys/min per IP, or 20
        setup links/hour).
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Gateway paused, in maintenance, or Meta app not configured.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: Tenant API key.
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Tenant API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.