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

> ## Agent Instructions
> Integrating Pilot Status end to end? Follow https://docs.pilotstatus.com.br/guides/integrate-with-ai.md (pt-BR: https://docs.pilotstatus.com.br/pt-BR/guides/integrate-with-ai.md). No step requires contacting support: every credential is shown in the dashboard or in an API response, and a lost one is regenerated, not recovered.
> Webhook signing secret: shown ONCE in the Signing secret window right after creating the webhook on /webhooks, and in the `secret` field of the POST /v1/webhooks response (MCP: webhooks_create). Lost it: Edit Webhook → Generate a new secret, POST /v1/webhooks/{id}/rotate-secret, or webhooks_rotate_secret (the old one stops working at once). Verify `x-pilot-status-signature` = hex HMAC-SHA256 of the raw request body keyed with that secret.
> Meta verify token (number connected with the user's own Meta app credentials): Meta Number Created! window after connecting, then the number's card on Numbers (workspace Owner), or webhook.verifyToken in the POST /v1/numbers/meta response. It is not the webhook signing secret.
> REST auth: `x-api-key: ps_...` header, never Authorization: Bearer. MCP: https://mcp.pilotstatus.com.br/mcp (148 tools, OAuth 2.1 or x-api-key); Code Mode: https://mcp.pilotstatus.com.br/code. Destructive MCP tools return a preview and a confirm_token: show the preview and call again only after the user's explicit yes. Over OAuth, revealing or creating ps_ API keys is workspace Owner only.

# Emparejamiento remoto (enlace de conexión)

> Genera un link para que otra persona conecte su propio número. provider=PILOT_STATUS (predeterminado) requiere name + number y devuelve un link de emparejamiento por QR; provider=META devuelve un link alojado de Embedded Signup (la persona elige el número dentro del diálogo de Facebook, sin name/number).



## OpenAPI

````yaml openapi.es.json POST /v1/numbers/remote-pairing
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    API REST pública de Pilot Status. Autentícate con el encabezado `x-api-key:
    ps_...` (o `x-api-key-id`). URL base: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/numbers/remote-pairing:
    post:
      tags:
        - Numbers
      summary: Emparejamiento remoto (link de conexión)
      description: >-
        Genera un link para que otra persona conecte su propio número.
        provider=PILOT_STATUS (predeterminado) requiere name + number y devuelve
        un link de emparejamiento por QR; provider=META devuelve un link alojado
        de Embedded Signup (la persona elige el número dentro del diálogo de
        Facebook, sin name/number).
      operationId: post_numbers_remote-pairing
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  description: Tipo de link (predeterminado PILOT_STATUS).
                  example: PILOT_STATUS
                name:
                  type: string
                  description: Obligatorio para PILOT_STATUS; se ignora para META.
                  example: Cliente Acme
                number:
                  type: string
                  description: Obligatorio para PILOT_STATUS; se ignora para META.
                  example: '5511988887777'
                sendViaWhatsApp:
                  type: boolean
                  description: >-
                    Enviar el link por WhatsApp (PILOT_STATUS). Predeterminado
                    false.
                  example: 'false'
                redirectUrl:
                  type: string
                  description: URL de redirección al finalizar (META).
                  example: https://app.acme.com/done
                externalRef:
                  type: string
                  description: Referencia externa opcional para correlación (META).
                  example: customer-42
                linkToApiKey:
                  type: boolean
                  description: >-
                    Obsoleto: se acepta y se ignora. No se toca ninguna API key
                    y `linkedApiKeyId` siempre es null.
                  example: 'true'
                metaFlow:
                  type: string
                  enum:
                    - embedded
                    - credentials
                  description: >-
                    Solo META: `embedded` (predeterminado) ejecuta Meta Embedded
                    Signup en la página alojada; `credentials` recopila las
                    credenciales de una WABA existente.
                  example: embedded
                settings:
                  type: object
                  description: >-
                    Configuración con la que NACE el número, el mismo bloque que
                    `PATCH /v1/numbers/{id}`. Aplica a ambos proveedores: para
                    `META` se escribe en el placeholder donde llega la conexión.
                    Este es el momento de decidir el historial:
                    `settings.historyImportEnabled` tiene como valor
                    predeterminado `true`, el proveedor entrega el historial del
                    dispositivo una sola vez, justo después de que la persona se
                    conecta, y cambiar el flag después no puede recuperarlo ni
                    deshacerlo. Los valores inválidos responden `400
                    INVALID_SETTINGS` y no se crea nada.
                  properties:
                    historyImportEnabled:
                      type: boolean
                      example: false
                    webhookHistoricalMessages:
                      type: boolean
                      example: false
                    ignoreNewsletters:
                      type: boolean
                      example: false
                    markReadOnSend:
                      type: boolean
                      example: true
                  additionalProperties: true
      responses:
        '201':
          description: >-
            Link de emparejamiento creado. `META` responde con el `numberId` del
            placeholder, el link, su `expiresAt` (30 min) y los `settings` con
            los que se creó el placeholder.
          content:
            application/json:
              examples:
                pilot_status:
                  summary: PILOT_STATUS (QR)
                  value:
                    provider: PILOT_STATUS
                    remotePairingToken: rp_01HZX...
                    remotePairingUrl: https://pilotstatus.com.br/connect/rp_01HZX...
                    numberId: num_01HZX...
                meta:
                  summary: META (Embedded Signup)
                  value:
                    provider: META
                    numberId: num_01HZX...
                    remotePairingUrl: https://connect.pilotstatus.com.br/connect/eyJhbGciOi...
                    expiresAt: '2026-09-16T14:06:38.000Z'
                    settings:
                      historyImportEnabled: true
                      webhookHistoricalMessages: false
                      ignoreNewsletters: false
                      markReadOnSend: true
                      alwaysOnline: null
                      rejectCall: null
                      msgRejectCall: null
                      readMessages: null
                      ignoreGroups: null
                      ignoreStatus: null
                      appliesTo:
                        history: all
                        advanced: none
                        sending: meta
        '400':
          description: >-
            Payload o parámetros inválidos, o `INVALID_BODY` cuando el cuerpo no
            es JSON válido
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                validation:
                  summary: Validation error
                  value:
                    error: Validation error
                invalidBody:
                  summary: Body is not valid JSON
                  value:
                    error: >-
                      The request body is not valid JSON | O corpo da requisição
                      não é um JSON válido
                    code: INVALID_BODY
        '401':
          description: Encabezado `x-api-key` / `x-api-key-id` ausente o inválido
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '402':
          description: >-
            No se creó ningún link (ni, para `META`, ningún placeholder). Decide
            según `code`. En el plan Free, un número que supera la cuota del
            plan siempre responde `PLAN_NUMBER_LIMIT_REACHED`, sin importar el
            saldo de la billetera o la tarjeta guardada (el plan Free nunca
            compra un número extra por sí solo), y lo mismo ocurre con un link
            para un teléfono que ya existe en el workspace pero nunca se conectó
            (ese cuerpo trae solo `plan`, `maxNumbers` y `currentNumberCount`).
            En un plan pago el rechazo solo ocurre cuando el número sería un
            extra que no se puede financiar (el saldo de la billetera no cubre
            `proratedTotal` y no hay tarjeta guardada):
            `PLAN_NUMBER_LIMIT_REACHED` cuando la cuota propia del plan está
            llena y nunca se compró un extra, `INSUFFICIENT_FUNDS` cuando es un
            extra pago más.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - PLAN_NUMBER_LIMIT_REACHED
                      - INSUFFICIENT_FUNDS
                  code:
                    type: string
                    enum:
                      - PLAN_NUMBER_LIMIT_REACHED
                      - INSUFFICIENT_FUNDS
                  plan:
                    type: string
                  maxNumbers:
                    type: integer
                  currentNumberCount:
                    type: integer
                  extras:
                    type: integer
                    description: Cuántos números extra nuevos necesitaría la solicitud.
                  proratedTotal:
                    type: number
                    description: >-
                      El precio prorrateado de esos números extra por el resto
                      del ciclo.
                  walletBalance:
                    type: number
                  currency:
                    type: string
                    example: BRL
              examples:
                freePlanNewNumber:
                  summary: Free plan — new number (funds do not clear it)
                  value:
                    error: PLAN_NUMBER_LIMIT_REACHED
                    code: PLAN_NUMBER_LIMIT_REACHED
                    proratedTotal: 14.95
                    currency: BRL
                    walletBalance: 50
                    extras: 1
                    plan: FREE
                    maxNumbers: 1
                    currentNumberCount: 1
                freePlanExistingPhone:
                  summary: Free plan — phone already exists, never connected
                  value:
                    error: PLAN_NUMBER_LIMIT_REACHED
                    code: PLAN_NUMBER_LIMIT_REACHED
                    plan: FREE
                    maxNumbers: 1
                    currentNumberCount: 1
                insufficientFunds:
                  summary: Paid plan — INSUFFICIENT_FUNDS
                  value:
                    error: INSUFFICIENT_FUNDS
                    code: INSUFFICIENT_FUNDS
                    proratedTotal: 14.95
                    currency: BRL
                    walletBalance: 0
                    extras: 1
                    plan: ON_DEMAND
                    maxNumbers: 3
                    currentNumberCount: 3
        '403':
          description: >-
            Token OAuth/MCP o key de cuenta (`ps_account_`) de un usuario cuyo
            rol en el workspace no tiene `numbers:connect` (Admin u Owner), o
            que ya no es miembro activo (`WORKSPACE_MEMBERSHIP_REQUIRED`); o un
            permiso OAuth por número (`NUMBERS_GRANT_NOT_ALLOWED`); o una key de
            número (`ps_number_`, o una key `ps_` heredada limitada a un
            número), que no puede crear números
            (`NUMBER_KEY_CANNOT_CREATE_NUMBER`). Usa una key de workspace o una
            key de cuenta
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                permissionDenied:
                  summary: PERMISSION_DENIED
                  value:
                    error: >-
                      Your workspace role does not allow this action
                      (numbers:connect).
                    code: PERMISSION_DENIED
                numberKeyCannotCreateNumber:
                  summary: NUMBER_KEY_CANNOT_CREATE_NUMBER
                  value:
                    error: >-
                      A number key cannot create WhatsApp numbers: use a
                      workspace API key or an account API key (ps_account_…) to
                      connect a new number | Uma chave de número não pode criar
                      números de WhatsApp: use uma API key de workspace ou uma
                      API key de conta (ps_account_…) para conectar um novo
                      número
                    code: NUMBER_KEY_CANNOT_CREATE_NUMBER
        '429':
          description: Límite de solicitudes excedido
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Tu API key ps_
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: Id de la API key (alternativa a x-api-key)

````

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