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

# Enviar código al contacto

> ⚠️ **Esta llamada es real**: **envía un código de verificación real** al contacto del titular en ese canal (un mensaje de WhatsApp o un correo).

Envía un nuevo código en un canal obligatorio de la verificación actual y responde **200** con el estado. El nuevo código reemplaza al anterior. Sin cuerpo. Los primeros códigos los envía el propio `POST /v1/phone-lines/verification`: llama a este para un código que expiró (10 minutos), se bloqueó (5 intentos fallidos) o no llegó.

Como máximo **un código por canal cada 60 segundos**, contando el que envió el submit (429 `CONTACT_CODE_COOLDOWN`). Solo mientras la verificación esté en `PENDING_CONTACT` (409 `VERIFICATION_WRONG_STATE` después), y solo en un canal de `requiredChannels` (400 `CONTACT_CODE_NOT_REQUIRED`). 503 `SUPPLIER_UNAVAILABLE`: no se pudo poner el código en cola de envío; no cuenta para el tiempo de espera, intenta de nuevo. Sin `Idempotency-Key`: un envío está limitado por su tiempo de espera. Requiere una clave **con alcance de tenant**, como todo endpoint `/v1/phone-lines` (una clave con alcance de número recibe `403 NUMBER_SCOPE_NOT_ALLOWED`). Permiso `phone_lines:purchase`, el mismo que para comprar: con un token OAuth/MCP solo el **OWNER** del workspace puede llamarlo (`403 PERMISSION_DENIED` en otro caso). Es la misma verificación que la del panel (**Líneas telefónicas** → **Comprar líneas telefónicas**): uses la que uses, la otra ve el resultado. La respuesta es el objeto de estado de la verificación, enviado con `Cache-Control: no-store`; el número del documento y los contactos vuelven enmascarados.

> [!NOTE]
>
> Esto envía un código real al contacto que registró en la verificación.


## OpenAPI

````yaml openapi.es.json POST /v1/phone-lines/verification/contact/{channel}/send
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/phone-lines/verification/contact/{channel}/send:
    post:
      tags:
        - Phone Lines
      summary: Enviar un nuevo código de contacto
      description: >-
        ⚠️ **Esta llamada es real**: **envía un código de verificación real** al
        contacto del titular en ese canal (un mensaje de WhatsApp o un correo).


        Envía un nuevo código en un canal obligatorio de la verificación actual
        y responde **200** con el estado. El nuevo código reemplaza al anterior.
        Sin cuerpo. Los primeros códigos los envía el propio `POST
        /v1/phone-lines/verification`: llama a este para un código que expiró
        (10 minutos), se bloqueó (5 intentos fallidos) o no llegó.


        Como máximo **un código por canal cada 60 segundos**, contando el que
        envió el submit (429 `CONTACT_CODE_COOLDOWN`). Solo mientras la
        verificación esté en `PENDING_CONTACT` (409 `VERIFICATION_WRONG_STATE`
        después), y solo en un canal de `requiredChannels` (400
        `CONTACT_CODE_NOT_REQUIRED`). 503 `SUPPLIER_UNAVAILABLE`: no se pudo
        poner el código en cola de envío; no cuenta para el tiempo de espera,
        intenta de nuevo. Sin `Idempotency-Key`: un envío está limitado por su
        tiempo de espera. Requiere una clave **con alcance de tenant**, como
        todo endpoint `/v1/phone-lines` (una clave con alcance de número recibe
        `403 NUMBER_SCOPE_NOT_ALLOWED`). Permiso `phone_lines:purchase`, el
        mismo que para comprar: con un token OAuth/MCP solo el **OWNER** del
        workspace puede llamarlo (`403 PERMISSION_DENIED` en otro caso). Es la
        misma verificación que la del panel (**Líneas telefónicas** → **Comprar
        líneas telefónicas**): uses la que uses, la otra ve el resultado. La
        respuesta es el objeto de estado de la verificación, enviado con
        `Cache-Control: no-store`; el número del documento y los contactos
        vuelven enmascarados.
      operationId: post_phone_lines_verification_contact_channel_send
      parameters:
        - name: channel
          in: path
          required: true
          schema:
            type: string
            enum:
              - whatsapp
              - email
          example: email
          description: >-
            El canal de contacto, en **minúsculas**: `whatsapp` o `email`. Debe
            estar en `verification.contact.requiredChannels` (ahí en
            mayúsculas). Cualquier otro valor → 400 `INVALID_CONTACT_CHANNEL`.
      responses:
        '200':
          description: Nuevo código enviado; el estado de la verificación
          headers:
            Cache-Control:
              description: Siempre `no-store`.
              schema:
                type: string
                enum:
                  - no-store
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - NONE
                      - PENDING_CONTACT
                      - IN_REVIEW
                      - APPROVED
                      - NEEDS_DOCUMENT
                      - REJECTED
                    description: >-
                      `NONE` (nunca iniciada), `PENDING_CONTACT` (esperando los
                      códigos de contacto y, si `document.status` lo indica, un
                      documento mejor), `IN_REVIEW` (terminada, esperando a una
                      persona; compra permitida), `APPROVED` (verificada; compra
                      permitida), `NEEDS_DOCUMENT` (el revisor pidió otro
                      documento) o `REJECTED` (definitiva; habla con soporte).
                      El webhook `phone_line.verification_updated` usa los
                      mismos valores para los últimos cuatro.
                  canPurchase:
                    type: boolean
                    description: >-
                      Si `POST /v1/phone-lines` está permitido ahora: `true`
                      para `APPROVED` e `IN_REVIEW`.
                  verification:
                    type: object
                    nullable: true
                    description: '`null` para `NONE`.'
                    properties:
                      id:
                        type: string
                        description: >-
                          Identifica la verificación: el `verificationId` del
                          evento de webhook, y lo que te pedirá soporte.
                      documentType:
                        type: string
                        enum:
                          - CNPJ
                          - CPF
                      documentNumber:
                        type: string
                        description: >-
                          **Enmascarado**: `**.***.333/0001-**` (CNPJ) o
                          `***.456.789-**` (CPF). El número completo nunca se
                          devuelve.
                      legalName:
                        type: string
                        nullable: true
                        description: >-
                          La razón social del registro público (CNPJ). `null`
                          para un CPF, y cuando no se pudo consultar el
                          registro.
                      contact:
                        type: object
                        properties:
                          email:
                            type: string
                            description: >-
                              El correo de contacto, enmascarado
                              (`a***@example.com`).
                          whatsapp:
                            type: string
                            nullable: true
                            description: >-
                              El WhatsApp de contacto, enmascarado
                              (`+5511****0000`).
                          requiredChannels:
                            type: array
                            items:
                              type: string
                              enum:
                                - WHATSAPP
                                - EMAIL
                            description: >-
                              `WHATSAPP` y/o `EMAIL`: los códigos que necesita
                              esta verificación. Se fijan cuando empieza la
                              verificación. Por la API, `EMAIL` siempre es
                              obligatorio.
                          confirmedChannels:
                            type: array
                            items:
                              type: string
                              enum:
                                - WHATSAPP
                                - EMAIL
                            description: Los canales obligatorios ya confirmados.
                          pendingChannels:
                            type: array
                            items:
                              type: string
                              enum:
                                - WHATSAPP
                                - EMAIL
                            description: >-
                              Los canales obligatorios que aún esperan su
                              código.
                      document:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - RECEIVED
                              - UNREADABLE
                              - UNCLEAR
                              - REQUESTED
                              - MISSING
                            description: >-
                              `RECEIVED` (el documento llegó), `UNREADABLE` (no
                              encontramos ningún número en el archivo),
                              `UNCLEAR` (encontramos números, pero ninguno
                              confiable), `REQUESTED` (el revisor pidió otro
                              documento) o `MISSING` (aún no hay documento). En
                              los últimos cuatro casos, envía un documento nuevo
                              con `POST /v1/phone-lines/verification/document`.
                      reviewReason:
                        type: string
                        nullable: true
                        enum:
                          - REGISTRY_UNAVAILABLE
                          - DOCUMENT_CHECK
                          - null
                        description: >-
                          Solo mientras está `IN_REVIEW`: `REGISTRY_UNAVAILABLE`
                          (no se pudo consultar el registro de CNPJ) o
                          `DOCUMENT_CHECK` (el documento necesita una revisión).
                          `null` en otro caso.
                      reviewNote:
                        type: string
                        nullable: true
                        description: >-
                          El mensaje del revisor, solo en `REJECTED` y
                          `NEEDS_DOCUMENT`. `null` en otro caso, y también puede
                          ser `null` en esos.
                      createdAt:
                        type: string
                        format: date-time
                        description: 'ISO 8601: cuándo se envió esta verificación.'
                      updatedAt:
                        type: string
                        format: date-time
                        description: 'ISO 8601: su último cambio.'
              example:
                status: PENDING_CONTACT
                canPurchase: false
                verification:
                  id: cmg5k0v3r0000vf8example7k
                  documentType: CNPJ
                  documentNumber: '**.***.333/0001-**'
                  legalName: ACME LTDA
                  contact:
                    email: a***@example.com
                    whatsapp: +5511****0000
                    requiredChannels:
                      - WHATSAPP
                      - EMAIL
                    confirmedChannels:
                      - WHATSAPP
                    pendingChannels:
                      - EMAIL
                  document:
                    status: RECEIVED
                  reviewReason: null
                  reviewNote: null
                  createdAt: '2026-10-01T13:55:02.000Z'
                  updatedAt: '2026-10-01T13:56:40.000Z'
        '400':
          description: >-
            `INVALID_CONTACT_CHANNEL`: `{channel}` no es `whatsapp` ni `email`.
            `CONTACT_CODE_NOT_REQUIRED`: el canal no está en `requiredChannels`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                invalidChannel:
                  summary: Unknown channel
                  value:
                    error: >-
                      The channel in the path must be "whatsapp" or "email". | O
                      canal no caminho deve ser "whatsapp" ou "email".
                    code: INVALID_CONTACT_CHANNEL
                notRequired:
                  summary: Channel not required
                  value:
                    error: >-
                      This channel does not need a code. | Este canal não
                      precisa de código.
                    code: CONTACT_CODE_NOT_REQUIRED
        '401':
          description: >-
            Encabezado `x-api-key` / `x-api-key-id` ausente o inválido (o token
            OAuth Bearer). Sin `code` en este cuerpo.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Invalid API key
        '403':
          description: >-
            Clave con alcance de número o permiso OAuth por número
            (`NUMBER_SCOPE_NOT_ALLOWED`: usa la clave con alcance de tenant);
            token OAuth/MCP cuyo usuario no es el OWNER del workspace
            (`PERMISSION_DENIED`) o ya no es un miembro activo
            (`WORKSPACE_MEMBERSHIP_REQUIRED`); workspace archivado
            (`WORKSPACE_ARCHIVED`). Los errores de alcance y de rol traen un
            `error` solo en inglés.. `TENANT_REQUIRED`: credencial no vinculada
            a ningún workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                numberScope:
                  summary: Number-scoped key
                  value:
                    error: This endpoint requires a tenant-scoped API key
                    code: NUMBER_SCOPE_NOT_ALLOWED
                permission:
                  summary: OAuth/MCP user is not the OWNER
                  value:
                    error: >-
                      Your workspace role does not allow this action
                      (phone_lines:purchase).
                    code: PERMISSION_DENIED
                membership:
                  summary: OAuth/MCP user no longer an active member
                  value:
                    error: >-
                      The user behind this token is not an active member of this
                      workspace.
                    code: WORKSPACE_MEMBERSHIP_REQUIRED
                archived:
                  summary: Archived workspace
                  value:
                    error: >-
                      This workspace has been archived and its API is closed. |
                      Este workspace foi arquivado e sua API está encerrada.
                    code: WORKSPACE_ARCHIVED
                tenantRequired:
                  summary: Credential not bound to a workspace
                  value:
                    error: This credential is not bound to a workspace.
                    code: TENANT_REQUIRED
        '404':
          description: '`VERIFICATION_NOT_FOUND`: no se envió nada en este workspace.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Verification not found. | Verificação não encontrada.
                code: VERIFICATION_NOT_FOUND
        '409':
          description: >-
            `VERIFICATION_WRONG_STATE`: la verificación ya no está en
            `PENDING_CONTACT`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  The verification is not in a state that allows this. | A
                  verificação não está em um estado que permita isso.
                code: VERIFICATION_WRONG_STATE
        '429':
          description: >-
            `CONTACT_CODE_COOLDOWN`: se envió un código en este canal hace menos
            de 60 segundos.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Wait a moment before requesting another code. | Aguarde um
                  pouco antes de pedir outro código.
                code: CONTACT_CODE_COOLDOWN
        '500':
          description: Falla inesperada. Reintenta.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unexpected error. | Erro inesperado.
                code: INTERNAL_ERROR
        '503':
          description: >-
            `SUPPLIER_UNAVAILABLE`: no se pudo poner el código en cola de envío.
            No cuenta para el tiempo de espera; intenta de nuevo.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Phone lines are temporarily unavailable. Try again in a few
                  minutes. | As linhas estão temporariamente indisponíveis.
                  Tente de novo em alguns minutos.
                code: SUPPLIER_UNAVAILABLE
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.