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

# Historial de códigos de activación

> Devuelve las solicitudes de código de la línea, **de la más reciente a la más antigua**, con los códigos: `{ "activations": [ … ] }`. También funciona con líneas suspendidas: conservan su historial. Una línea de otro workspace responde `404 LINE_NOT_FOUND`, nunca una lista vacía.

Una línea que salió de tu workspace (`RETURNED` o `CANCELED`) tiene su historial **eliminado**: sus solicitudes siguen listadas (`id`, `status`, marcas de tiempo, `failureReason`), pero `code` es `null` y `hasAudio` pasa a `false` a medida que se eliminan las grabaciones. Se envía con `Cache-Control: no-store`: los códigos son credenciales.

**Requiere una clave con alcance de tenant**: una clave con alcance de número (o un permiso OAuth por número) recibe `403 NUMBER_SCOPE_NOT_ALLOWED`. Permiso `phone_lines:read`: con un token OAuth / MCP el usuario debe ser **Owner o Admin** (`403 PERMISSION_DENIED` en otro caso).

> [!WARNING]
>
> **El código de activación es una credencial.** Quien lo tenga puede registrar una cuenta de WhatsApp en la línea. No pegue una respuesta con un código en ningún lugar público.


## OpenAPI

````yaml openapi.es.json GET /v1/phone-lines/{id}/activations
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/{id}/activations:
    get:
      tags:
        - Phone Lines
      summary: Historial de códigos de una línea
      description: >-
        Devuelve las solicitudes de código de la línea, **de la más reciente a
        la más antigua**, con los códigos: `{ "activations": [ … ] }`. También
        funciona con líneas suspendidas: conservan su historial. Una línea de
        otro workspace responde `404 LINE_NOT_FOUND`, nunca una lista vacía.


        Una línea que salió de tu workspace (`RETURNED` o `CANCELED`) tiene su
        historial **eliminado**: sus solicitudes siguen listadas (`id`,
        `status`, marcas de tiempo, `failureReason`), pero `code` es `null` y
        `hasAudio` pasa a `false` a medida que se eliminan las grabaciones. Se
        envía con `Cache-Control: no-store`: los códigos son credenciales.


        **Requiere una clave con alcance de tenant**: una clave con alcance de
        número (o un permiso OAuth por número) recibe `403
        NUMBER_SCOPE_NOT_ALLOWED`. Permiso `phone_lines:read`: con un token
        OAuth / MCP el usuario debe ser **Owner o Admin** (`403
        PERMISSION_DENIED` en otro caso).
      operationId: get_phone_lines_id_activations
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: cmg5k2l1n0001pl8example9x
          description: >-
            El `id` de la línea (de `GET /v1/phone-lines`), no el número de
            teléfono.
        - name: limit
          in: query
          required: false
          description: >-
            De 1 a 100 (por defecto 20). Cualquier otro valor (0, 101, un
            decimal, texto, vacío) → `400 INVALID_LIMIT`.
          schema:
            type: string
            description: (integer (1–100))
          example: '20'
      responses:
        '200':
          description: >-
            Las solicitudes de código de la línea, de la más reciente a la más
            antigua. Se envía con `Cache-Control: no-store`.
          headers:
            Cache-Control:
              description: '`no-store`'
              schema:
                type: string
                enum:
                  - no-store
          content:
            application/json:
              schema:
                type: object
                properties:
                  activations:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: El id de la solicitud (`activationId`).
                        lineId:
                          type: string
                          description: La línea a la que pertenece la solicitud.
                        status:
                          type: string
                          enum:
                            - WAITING
                            - CAPTURED
                            - TRANSCRIBED
                            - TIMED_OUT
                            - FAILED
                          description: >-
                            `WAITING`, `CAPTURED`, `TRANSCRIBED`, `TIMED_OUT` o
                            `FAILED`. Sigue consultando mientras `status` sea
                            `WAITING`, o `CAPTURED` con `failureReason: null`;
                            cualquier otra combinación es definitiva.
                        requestedAt:
                          type: string
                          format: date-time
                          description: 'ISO 8601: cuándo se abrió la solicitud.'
                        pollDeadline:
                          type: string
                          format: date-time
                          description: >-
                            ISO 8601: fin de la ventana de captura, 5 minutos
                            después de la solicitud.
                        code:
                          type:
                            - string
                            - 'null'
                          description: >-
                            El código de 6 dígitos, una vez `TRANSCRIBED` y
                            encontrado. `null` en otro caso. **Una credencial**:
                            quien lo tenga puede registrar una cuenta de
                            WhatsApp en la línea.
                        capturedAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                          description: >-
                            ISO 8601: cuándo se guardó la grabación de la
                            llamada.
                        transcribedAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                          description: 'ISO 8601: cuándo terminó la transcripción.'
                        failureReason:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Por qué una solicitud final no tiene código:
                            `no_call_in_window`, `canceled_by_customer`,
                            `no_code_in_transcript`, `transcription_failed`,
                            `audio_download_failed`, `audio_store_failed`,
                            `poll_not_scheduled`, o `null`. Trata un valor
                            desconocido como una falla, ya que pueden agregarse
                            nuevos.
                        hasAudio:
                          type: boolean
                          description: >-
                            Si hay una grabación de la llamada guardada: se
                            descarga desde `GET
                            /v1/phone-lines/activations/{activationId}/audio` y
                            se reproduce en el panel.
                      required:
                        - id
                        - lineId
                        - status
                        - requestedAt
                        - pollDeadline
                        - code
                        - capturedAt
                        - transcribedAt
                        - failureReason
                        - hasAudio
                required:
                  - activations
              example:
                activations:
                  - id: cmg5k3a7c0002ac8example4q
                    lineId: cmg5k2l1n0001pl8example9x
                    status: TRANSCRIBED
                    requestedAt: '2026-10-01T14:10:00.000Z'
                    pollDeadline: '2026-10-01T14:15:00.000Z'
                    code: '123456'
                    capturedAt: '2026-10-01T14:11:42.000Z'
                    transcribedAt: '2026-10-01T14:11:51.000Z'
                    failureReason: null
                    hasAudio: true
                  - id: cmg5j9x2b0001ac8example7m
                    lineId: cmg5k2l1n0001pl8example9x
                    status: TIMED_OUT
                    requestedAt: '2026-10-01T13:40:00.000Z'
                    pollDeadline: '2026-10-01T13:45:00.000Z'
                    code: null
                    capturedAt: null
                    transcribedAt: null
                    failureReason: no_call_in_window
                    hasAudio: false
        '400':
          description: '`limit` no es un entero de 1 a 100'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  limit must be an integer between 1 and 100. | limit deve ser
                  um inteiro entre 1 e 100.
                code: INVALID_LIMIT
        '401':
          description: >-
            Encabezado `x-api-key` / `x-api-key-id` ausente o inválido (el
            cuerpo trae solo `error`)
          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`); token OAuth/MCP de un usuario que no
            es Owner ni Admin (`PERMISSION_DENIED`) o que ya no es miembro
            activo (`WORKSPACE_MEMBERSHIP_REQUIRED`); workspace archivado
            (`WORKSPACE_ARCHIVED`). `TENANT_REQUIRED`: credencial no vinculada a
            ningún workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                number_scope_not_allowed:
                  summary: Number-scoped key
                  value:
                    error: This endpoint requires a tenant-scoped API key
                    code: NUMBER_SCOPE_NOT_ALLOWED
                permission_denied:
                  summary: Role without phone_lines:read
                  value:
                    error: >-
                      Your workspace role does not allow this action
                      (phone_lines:read).
                    code: PERMISSION_DENIED
                workspace_membership_required:
                  summary: No longer a member
                  value:
                    error: >-
                      The user behind this token is not an active member of this
                      workspace.
                    code: WORKSPACE_MEMBERSHIP_REQUIRED
                workspace_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: No existe esa línea en tu workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Line not found. | Linha não encontrada.
                code: LINE_NOT_FOUND
        '500':
          description: Falla inesperada
          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.