# Preview numbers to connect (/docs/api-reference/whatsapp/previewWhatsappNumbers)

> Lists the numbers on your WhatsApp Business Account with their health, and connects nothing. The access token is checked first, against the same rules as connecting, so a preview that passes can connect.

> **Set up WhatsApp first.** Connect a WhatsApp number in the dashboard or with [Connect numbers](/docs/api-reference/whatsapp/importWhatsappNumbers). Included on every paid plan. [See plans](https://omnidim.io/pricing).

**POST** `/whatsapp/numbers/preview`

Lists the numbers on your WhatsApp Business Account with their health,
and connects nothing. The access token is checked first, against the
same rules as connecting, so a preview that passes can connect.

Connect a number with `needs_migration` or `needs_registration` only
after fixing it in WhatsApp Manager, or its sends fail.

```yaml
operationId: previewWhatsappNumbers
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - waba_id
          - access_token
        properties:
          waba_id:
            type: string
            description: Your WhatsApp Business Account id, from WhatsApp Manager.
          access_token:
            type: string
            description: A Meta access token that never expires, with both WhatsApp permissions.
responses:
  '200':
    description: The numbers on the account.
    content:
      application/json:
        schema:
          type: object
          properties:
            data:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                    description: Meta's id for the number. Pass it in `phone_number_ids`.
                  display_phone_number:
                    type: string
                    example: +1 555-123-4567
                  name:
                    type: string
                    nullable: true
                    description: The display name on WhatsApp.
                  status:
                    type: string
                    nullable: true
                    description: Meta's connection status, such as `CONNECTED` or `PENDING`.
                  can_send_message:
                    type: string
                    nullable: true
                    description: '`AVAILABLE`, `LIMITED` or `BLOCKED`.'
                  quality_rating:
                    type: string
                    nullable: true
                  name_status:
                    type: string
                    nullable: true
                  code_verification_status:
                    type: string
                    nullable: true
                  platform_type:
                    type: string
                    nullable: true
                  is_on_biz_app:
                    type: boolean
                    nullable: true
                  needs_migration:
                    type: boolean
                    description: >-
                      The number is on the WhatsApp Business app, not the Cloud API. Its sends fail
                      until it moves.
                  needs_registration:
                    type: boolean
                    description: >-
                      The number is verified but not registered with the Cloud API. Its sends fail
                      until it is.
                  reason:
                    type: string
                    description: A short reason when the number is not ready, otherwise empty.
                  already_imported:
                    type: boolean
                    description: Already connected to your account. Connecting again updates it.
                  connected_elsewhere:
                    type: boolean
                    description: Connected to another account, so connecting it is refused.
  '400':
    description: |
      `missing_fields` (`waba_id` or `access_token`), `invalid_json` (the
      body is not a JSON object), `invalid_parameter` (`phone_number_ids`),
      `token_invalid`, `token_expires`, `token_missing_permissions`,
      `invalid_request` (the account has no numbers, or Meta did not say which
      app the token belongs to), or `import_failed` (no number connected;
      `failed` says why for each).
    content:
      application/json:
        schema:
          type: object
          description: |
            The error envelope for every WhatsApp route. Some errors add keys:
            `fields` (the template parameters a send still needs), `ref` (a
            500's support reference) and `failed` (on `import_failed`).
          properties:
            error:
              type: string
              description: Machine-readable category, such as `invalid_request`.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable, specific reason, such as `window_closed`.
            request_id:
              type: string
              description: >-
                Correlates this response with the server log. Also sent as the `X-Request-Id`
                header.
            fields:
              type: array
              items:
                type: string
              description: >-
                On a template send missing parameters (`missing_fields`), the field keys you still
                need.
            ref:
              type: string
              description: On a `500`, the reference to quote to support.
            failed:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                  message:
                    type: string
                    example: >-
                      This WhatsApp number is already connected to another account. Disconnect it
                      there first, then import it again. Contact support if you cannot access that
                      account.
              description: On `import_failed`, each number and why it could not be connected.
        example:
          error: invalid_request
          error_description: This token expires on 27 Nov. Generate a new one set to never expire.
          code: token_expires
          request_id: req_5b8e2d1c7a94
  '401':
    description: Missing or invalid API key.
    content:
      application/json:
        schema:
          type: object
          description: |
            The error envelope for every WhatsApp route. Some errors add keys:
            `fields` (the template parameters a send still needs), `ref` (a
            500's support reference) and `failed` (on `import_failed`).
          properties:
            error:
              type: string
              description: Machine-readable category, such as `invalid_request`.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable, specific reason, such as `window_closed`.
            request_id:
              type: string
              description: >-
                Correlates this response with the server log. Also sent as the `X-Request-Id`
                header.
            fields:
              type: array
              items:
                type: string
              description: >-
                On a template send missing parameters (`missing_fields`), the field keys you still
                need.
            ref:
              type: string
              description: On a `500`, the reference to quote to support.
            failed:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                  message:
                    type: string
                    example: >-
                      This WhatsApp number is already connected to another account. Disconnect it
                      there first, then import it again. Contact support if you cannot access that
                      account.
              description: On `import_failed`, each number and why it could not be connected.
        example:
          error: unauthorized
          error_description: Missing or invalid API key
          code: invalid_api_key
          request_id: req_6e2b9d4f1a38
  '403':
    description: |
      `feature_not_enabled` when your plan or role cannot use WhatsApp,
      `permission_denied` when the key's user cannot make changes, or
      `service_unavailable` when the account is on hold.
    content:
      application/json:
        schema:
          type: object
          description: |
            The error envelope for every WhatsApp route. Some errors add keys:
            `fields` (the template parameters a send still needs), `ref` (a
            500's support reference) and `failed` (on `import_failed`).
          properties:
            error:
              type: string
              description: Machine-readable category, such as `invalid_request`.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable, specific reason, such as `window_closed`.
            request_id:
              type: string
              description: >-
                Correlates this response with the server log. Also sent as the `X-Request-Id`
                header.
            fields:
              type: array
              items:
                type: string
              description: >-
                On a template send missing parameters (`missing_fields`), the field keys you still
                need.
            ref:
              type: string
              description: On a `500`, the reference to quote to support.
            failed:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                  message:
                    type: string
                    example: >-
                      This WhatsApp number is already connected to another account. Disconnect it
                      there first, then import it again. Contact support if you cannot access that
                      account.
              description: On `import_failed`, each number and why it could not be connected.
        example:
          error: forbidden
          error_description: You do not have permission to make changes to WhatsApp.
          code: permission_denied
          request_id: req_9f2c1a4b7d3e
  '500':
    description: Something went wrong on our side. Quote `ref` to support.
    content:
      application/json:
        schema:
          type: object
          description: |
            The error envelope for every WhatsApp route. Some errors add keys:
            `fields` (the template parameters a send still needs), `ref` (a
            500's support reference) and `failed` (on `import_failed`).
          properties:
            error:
              type: string
              description: Machine-readable category, such as `invalid_request`.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable, specific reason, such as `window_closed`.
            request_id:
              type: string
              description: >-
                Correlates this response with the server log. Also sent as the `X-Request-Id`
                header.
            fields:
              type: array
              items:
                type: string
              description: >-
                On a template send missing parameters (`missing_fields`), the field keys you still
                need.
            ref:
              type: string
              description: On a `500`, the reference to quote to support.
            failed:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                  message:
                    type: string
                    example: >-
                      This WhatsApp number is already connected to another account. Disconnect it
                      there first, then import it again. Contact support if you cannot access that
                      account.
              description: On `import_failed`, each number and why it could not be connected.
        example:
          error: server_error
          error_description: >-
            Something went wrong on our side. Please try again shortly, or contact support with
            reference 9a1f3e8b02c4.
          ref: 9a1f3e8b02c4
          code: server_error
          request_id: req_9a1f3e8b02c4
  '502':
    description: '`upstream_error`: Meta could not be reached or refused the request. Nothing was connected.'
    content:
      application/json:
        schema:
          type: object
          description: |
            The error envelope for every WhatsApp route. Some errors add keys:
            `fields` (the template parameters a send still needs), `ref` (a
            500's support reference) and `failed` (on `import_failed`).
          properties:
            error:
              type: string
              description: Machine-readable category, such as `invalid_request`.
            error_description:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable, specific reason, such as `window_closed`.
            request_id:
              type: string
              description: >-
                Correlates this response with the server log. Also sent as the `X-Request-Id`
                header.
            fields:
              type: array
              items:
                type: string
              description: >-
                On a template send missing parameters (`missing_fields`), the field keys you still
                need.
            ref:
              type: string
              description: On a `500`, the reference to quote to support.
            failed:
              type: array
              items:
                type: object
                properties:
                  phone_number_id:
                    type: string
                  message:
                    type: string
                    example: >-
                      This WhatsApp number is already connected to another account. Disconnect it
                      there first, then import it again. Contact support if you cannot access that
                      account.
              description: On `import_failed`, each number and why it could not be connected.
        example:
          error: server_error
          error_description: Couldn't reach Meta to check this token. Please try again shortly.
          code: upstream_error
          request_id: req_2f7a9c4e1b63
```

**curl**

```bash
curl -X POST "https://omnidim.io/api/v1/whatsapp/numbers/preview" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```