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

# Crear número de Meta (Cloud API)

> Onboarding manual de Meta Cloud API: ya tienes la WABA + el token de system user y pasas las credenciales directamente. Devuelve el número creado + la URL del webhook/verifyToken que debes configurar en tu app de Meta. (¿Aún no tienes credenciales? Usa /api/v1/numbers/remote-pairing con provider=META.) Cualquier key `ps_` del workspace puede llamarlo; un permiso OAuth por número recibe 403 `NUMBERS_GRANT_NOT_ALLOWED`. `webhook.verifyToken` siempre se devuelve a las keys `ps_`; por OAuth/MCP solo una vez que la revelación queda registrada en la auditoría. Si ese registro falla, el número se crea igual pero `verifyToken` es `null`, con `secretWithheld: true` y `secretWithheldCode: "OAUTH_SECRET_AUDIT_UNAVAILABLE"`.



## OpenAPI

````yaml openapi.es.json POST /v1/numbers/meta
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/meta:
    post:
      tags:
        - Numbers
      summary: Crear número de Meta (Cloud API)
      description: >-
        Onboarding manual de Meta Cloud API: ya tienes la WABA + el token de
        system user y pasas las credenciales directamente. Devuelve el número
        creado + la URL del webhook/verifyToken que debes configurar en tu app
        de Meta. (¿Aún no tienes credenciales? Usa
        /api/v1/numbers/remote-pairing con provider=META.) Cualquier key `ps_`
        del workspace puede llamarlo; un permiso OAuth por número recibe 403
        `NUMBERS_GRANT_NOT_ALLOWED`. `webhook.verifyToken` siempre se devuelve a
        las keys `ps_`; por OAuth/MCP solo una vez que la revelación queda
        registrada en la auditoría. Si ese registro falla, el número se crea
        igual pero `verifyToken` es `null`, con `secretWithheld: true` y
        `secretWithheldCode: "OAUTH_SECRET_AUDIT_UNAVAILABLE"`.
      operationId: post_numbers_meta
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Nombre visible del número.
                  example: Atendimento
                  minLength: 1
                  maxLength: 60
                number:
                  type: string
                  description: Número de teléfono (mínimo 8 dígitos, + opcional).
                  example: '5511999999999'
                  minLength: 8
                  pattern: ^\+?\d+$
                metaPhoneId:
                  type: string
                  description: Phone Number ID de Meta Cloud API.
                  example: '123456789012345'
                metaWabaId:
                  type: string
                  description: ID de la WhatsApp Business Account (WABA).
                  example: '987654321098765'
                metaAccessToken:
                  type: string
                  description: Token de acceso del system user.
                  example: EAAG...
                metaAppSecret:
                  type: string
                  description: App Secret de la app de Meta.
                  example: a1b2c3...
                metaAppId:
                  type: string
                  description: App ID de la app de Meta.
                  example: '100200300400500'
                linkToApiKey:
                  type: boolean
                  description: >-
                    Vincular el número a la API key que hace la llamada
                    (predeterminado true).
                  example: 'true'
                routeWebhooksToPilot:
                  type: boolean
                  default: false
                  description: >-
                    Cuando es `true`, Pilot suscribe la WABA a su propio
                    callback de webhook (`override_callback_uri`), lo que
                    redirige TODOS los números de la WABA. La respuesta devuelve
                    `webhook.routedToPilot: true`.
              required:
                - name
                - number
                - metaPhoneId
                - metaWabaId
                - metaAccessToken
                - metaAppSecret
                - metaAppId
      responses:
        '201':
          description: Crear número de Meta
          content:
            application/json:
              example:
                number:
                  id: num_01HZX...
                  number: '5511999999999'
                  name: Atendimento
                  provider: META
                  metaPhoneId: '123456789012345'
                  metaWabaId: '987654321098765'
                  isFullyConnected: true
                  createdAt: '2026-06-20T10:00:00.000Z'
                webhook:
                  url: https://webhook.pilotstatus.com.br/meta
                  verifyToken: ps_meta_verify_...
                linkedApiKeyId: key_01HZX...
        '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: >-
            Control de capacidad: `error` es `PLAN_NUMBER_LIMIT_REACHED` o
            `INSUFFICIENT_FUNDS` (el código llega en `error`), con `plan`,
            `maxNumbers`, `currentNumberCount`, `extras`, `proratedTotal`,
            `walletBalance`, `currency`
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: PLAN_NUMBER_LIMIT_REACHED
                plan: FREE
                maxNumbers: 1
                currentNumberCount: 1
        '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
        '409':
          description: El número ya existe
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Number already exists
        '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.