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

# Confirmar código de contacto

> ⚠️ **Esta llamada es real**: confirma un código de la verificación de identidad del workspace, y el último **decide** la verificación.

Confirma el código de 6 dígitos recibido en ese canal y responde **200** con el estado. Cuando era el último código obligatorio y el documento ya está, la verificación se decide en esta misma respuesta (`APPROVED`, o `IN_REVIEW` cuando una persona necesita revisarla; **ambos te permiten comprar**, `canPurchase: true`) y sale el evento de webhook `phone_line.verification_updated`.

Un código **expira 10 minutos** después de enviado (400 `CONTACT_CODE_EXPIRED`). Un código incorrecto es 400 `CONTACT_CODE_INVALID` y cuenta como intento; tras **5 intentos fallidos** el código se bloquea (429 `CONTACT_CODE_TOO_MANY_ATTEMPTS`): envía uno nuevo con `…/contact/{channel}/send`. Un código se usa una sola vez: reintentar una confirmación que ya tuvo éxito responde `CONTACT_CODE_INVALID`; lee el estado con `GET /v1/phone-lines/verification` en su lugar. El único campo del cuerpo es `code`; el canal va en la ruta. 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.



## OpenAPI

````yaml openapi.es.json POST /v1/phone-lines/verification/contact/{channel}/confirm
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}/confirm:
    post:
      tags:
        - Phone Lines
      summary: Confirmar un código de contacto
      description: >-
        ⚠️ **Esta llamada es real**: confirma un código de la verificación de
        identidad del workspace, y el último **decide** la verificación.


        Confirma el código de 6 dígitos recibido en ese canal y responde **200**
        con el estado. Cuando era el último código obligatorio y el documento ya
        está, la verificación se decide en esta misma respuesta (`APPROVED`, o
        `IN_REVIEW` cuando una persona necesita revisarla; **ambos te permiten
        comprar**, `canPurchase: true`) y sale el evento de webhook
        `phone_line.verification_updated`.


        Un código **expira 10 minutos** después de enviado (400
        `CONTACT_CODE_EXPIRED`). Un código incorrecto es 400
        `CONTACT_CODE_INVALID` y cuenta como intento; tras **5 intentos
        fallidos** el código se bloquea (429 `CONTACT_CODE_TOO_MANY_ATTEMPTS`):
        envía uno nuevo con `…/contact/{channel}/send`. Un código se usa una
        sola vez: reintentar una confirmación que ya tuvo éxito responde
        `CONTACT_CODE_INVALID`; lee el estado con `GET
        /v1/phone-lines/verification` en su lugar. El único campo del cuerpo es
        `code`; el canal va en la ruta. 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_confirm
      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`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - code
              additionalProperties: false
              properties:
                code:
                  type: string
                  description: El código de 6 dígitos recibido en ese canal.
                  example: '482913'
            example:
              code: '482913'
      responses:
        '200':
          description: >-
            Código confirmado; el estado de la verificación (con la decisión
            cuando era el último código)
          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.'
              examples:
                approved:
                  summary: Last code — approved
                  value:
                    status: APPROVED
                    canPurchase: true
                    verification:
                      id: cmg5k0v3r0000vf8example7k
                      documentType: CNPJ
                      documentNumber: '**.***.333/0001-**'
                      legalName: ACME LTDA
                      contact:
                        email: a***@example.com
                        whatsapp: +5511****0000
                        requiredChannels:
                          - WHATSAPP
                          - EMAIL
                        confirmedChannels:
                          - WHATSAPP
                          - EMAIL
                        pendingChannels: []
                      document:
                        status: RECEIVED
                      reviewReason: null
                      reviewNote: null
                      createdAt: '2026-10-01T13:55:02.000Z'
                      updatedAt: '2026-10-01T13:57:31.000Z'
                inReview:
                  summary: Last code — waiting for a person (purchase allowed)
                  value:
                    status: IN_REVIEW
                    canPurchase: true
                    verification:
                      id: cmg5k0v3r0000vf8example7k
                      documentType: CNPJ
                      documentNumber: '**.***.333/0001-**'
                      legalName: ACME LTDA
                      contact:
                        email: a***@example.com
                        whatsapp: +5511****0000
                        requiredChannels:
                          - WHATSAPP
                          - EMAIL
                        confirmedChannels:
                          - WHATSAPP
                          - EMAIL
                        pendingChannels: []
                      document:
                        status: RECEIVED
                      reviewReason: DOCUMENT_CHECK
                      reviewNote: null
                      createdAt: '2026-10-01T13:55:02.000Z'
                      updatedAt: '2026-10-01T14:20:12.000Z'
                onePending:
                  summary: One channel still pending
                  value:
                    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`),
            `INVALID_BODY` (no es un objeto JSON), `UNKNOWN_FIELDS` (cualquier
            cosa que no sea `code`), `CONTACT_CODE_INVALID` (código incorrecto,
            que cuenta como intento, ningún código en ese canal, o `code` no es
            una cadena), `CONTACT_CODE_EXPIRED` (de más de 10 minutos) o
            `CONTACT_CODE_NOT_REQUIRED` (el canal no está en
            `requiredChannels`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Frase en inglés y frase en portugués separadas por ` | `.
                  code:
                    type: string
                    description: >-
                      Código de error estable: ramifica según él, nunca según el
                      texto.
                  details:
                    type: object
                    description: >-
                      Solo errores de validación: `unknownFields` (array) o
                      `maxLength` (número).
                    additionalProperties: true
              examples:
                invalid:
                  summary: Wrong code
                  value:
                    error: Wrong code. | Código incorreto.
                    code: CONTACT_CODE_INVALID
                expired:
                  summary: Code expired
                  value:
                    error: >-
                      This code has expired. Request a new one. | Este código
                      expirou. Peça um novo.
                    code: CONTACT_CODE_EXPIRED
                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
                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
                unknownFields:
                  summary: Field other than code
                  value:
                    error: >-
                      Unknown field(s): channel. This endpoint accepts only
                      "code"; the channel goes in the path. | Campo(s)
                      desconhecido(s): channel. Este endpoint aceita apenas
                      "code"; o canal vai no caminho.
                    code: UNKNOWN_FIELDS
                    details:
                      unknownFields:
                        - channel
        '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
        '429':
          description: >-
            `CONTACT_CODE_TOO_MANY_ATTEMPTS`: 5 intentos fallidos; envía un
            nuevo código con `…/contact/{channel}/send`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  Too many wrong attempts. Request a new code. | Tentativas
                  erradas demais. Peça um novo código.
                code: CONTACT_CODE_TOO_MANY_ATTEMPTS
        '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
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.