> ## 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 (PILOT_STATUS)

> Crea un número de WhatsApp no oficial (PILOT_STATUS) y devuelve el código QR + el código de emparejamiento para vincularlo. De forma predeterminada vincula el número a la API key que hace la llamada (usa linkToApiKey:false para omitirlo). Efecto real: aprovisiona una instancia.



## OpenAPI

````yaml openapi.es.json POST /v1/numbers
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:
    post:
      tags:
        - Numbers
      summary: Crear número (PILOT_STATUS)
      description: >-
        Crea un número de WhatsApp no oficial (PILOT_STATUS) y devuelve el
        código QR + el código de emparejamiento para vincularlo. De forma
        predeterminada vincula el número a la API key que hace la llamada (usa
        linkToApiKey:false para omitirlo). Efecto real: aprovisiona una
        instancia.
      operationId: post_numbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Nombre visible del número.
                  example: Suporte
                  minLength: 1
                  maxLength: 60
                number:
                  type: string
                  description: Número de teléfono (mínimo 10 dígitos, + opcional).
                  example: '5511999999999'
                  minLength: 10
                  pattern: ^\+?\d+$
                linkToApiKey:
                  type: boolean
                  description: >-
                    Vincular el nuevo número a la API key que hace la llamada
                    (predeterminado true).
                  example: 'true'
                settings:
                  type: object
                  description: >-
                    Configuración con la que NACE el número, el mismo bloque que
                    `PATCH /v1/numbers/{id}`. Aquí se decide
                    `historyImportEnabled`: su valor predeterminado es `true`
                    (era `false` para los números creados entre 2026-08-26 y
                    2026-09-16), el proveedor entrega el historial del
                    dispositivo de una sola vez justo después de la conexión y
                    no hay forma de pedirlo después. Se acepta aquí cualquier
                    campo del bloque del PATCH; el `201` devuelve con qué se
                    creó el número.
                  properties:
                    historyImportEnabled:
                      type: boolean
                      description: >-
                        Guardar el volcado de historial al conectar.
                        Predeterminado `false`.
                      example: true
                    webhookHistoricalMessages:
                      type: boolean
                      description: >-
                        Entregar esos mensajes históricos a tus webhooks.
                        Predeterminado `false`.
                      example: false
                    ignoreNewsletters:
                      type: boolean
                      description: >-
                        Descartar al llegar las publicaciones de Canales de
                        WhatsApp (`@newsletter`). Predeterminado `false`.
                      example: false
                    markReadOnSend:
                      type: boolean
                      description: >-
                        Valor predeterminado de `markRead` en `POST
                        /v1/messages/send`. Predeterminado `true`. `false`: en
                        números oficiales (Meta) los envíos salen sin el
                        indicador de escritura y sin marcar la conversación como
                        leída. Sin efecto en números no oficiales.
                      example: true
                piiMode:
                  type: string
                  enum:
                    - STORE_INDEFINITE
                    - STORE_X_DAYS
                    - RELAY_ONLY
                  default: STORE_INDEFINITE
                  description: >-
                    Política de retención de datos del número. Cualquier otro
                    valor: 400 `Invalid piiMode`.
                piiRetentionDays:
                  type: integer
                  minimum: 1
                  maximum: 3650
                  description: >-
                    Obligatorio con `piiMode: STORE_X_DAYS`; se ignora en los
                    demás modos.
              required:
                - name
                - number
      responses:
        '201':
          description: Crear número
          content:
            application/json:
              example:
                numberId: cmm0abc123
                instance:
                  id: num_01HZX...
                  number: '5511999999999'
                  name: Suporte
                  provider: PILOT_STATUS
                  status: CONNECTING
                  isFullyConnected: false
                qrcodeBase64: data:image/png;base64,iVBORw0KGgo...
                pairingCode: ABCD-1234
                linkedApiKeyId: null
              schema:
                type: object
                properties:
                  numberId:
                    type: string
                    description: >-
                      El id del número: el mismo `id` de `GET /v1/numbers`, el
                      que recibe `DELETE /v1/numbers/{id}` y el `data.numberId`
                      de los webhooks. No es lo mismo que `instance.id` (el id
                      de la instancia, sin cambios).
                  instance:
                    type: object
                    description: >-
                      La instancia creada. Sin cambios; `instance.id` es el id
                      de la instancia.
                  qrcodeBase64:
                    type:
                      - string
                      - 'null'
                  pairingCode:
                    type:
                      - string
                      - 'null'
                  linkedApiKeyId:
                    type: 'null'
                    description: Siempre `null` (la vinculación de keys fue retirada).
        '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 (`Number already exists`), o fue eliminado en
            este workspace y está dentro de su ventana de 30 días
            (`NUMBER_SOFT_DELETED`, con `numberId` y `restorableUntil`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This number was deleted and is inside the 30-day recovery
                  window. Use POST /v1/numbers/{id}/restore to recover it, or
                  DELETE /v1/numbers/{id}/purge to discard it for good and
                  recreate it.
                code: NUMBER_SOFT_DELETED
                numberId: num_01HZX...
                restorableUntil: '2026-12-09T12:00:00.000Z'
        '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
        '502':
          description: El proveedor rechazó crear la instancia; no se guarda nada
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Failed to create instance
                details: Upstream provider returned 500
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.