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

# Descargar grabación de llamada

> Devuelve la grabación de la llamada de una solicitud cuyo `hasAudio` es `true`: el archivo guardado en sí, no JSON. Se transmite desde nuestra copia privada, nunca desde la URL del operador.

`Content-Type` es el formato propio de la grabación (normalmente `audio/wav` o `audio/mpeg`, ya que el formato del operador varía de una llamada a otra; `application/octet-stream` cuando no se guardó ninguno), con su `Content-Length`. `Content-Disposition: attachment; filename="activation-{activationId}.wav"` (`.mp3` para un MP3; sin extensión para cualquier otro formato). `Cache-Control: private, no-store`: la grabación dice el código de activación.

`404 ACTIVATION_NOT_FOUND` responde, siempre igual: a una solicitud de otro workspace o a un id desconocido; a una solicitud **sin grabación** (`hasAudio: false`: la espera expiró o se canceló antes de cualquier llamada, o la llamada no se pudo descargar ni guardar); y a cualquier solicitud de una línea `RETURNED` o `CANCELED`: una línea que sale de tu workspace tiene sus grabaciones eliminadas.

Rara vez necesitas armar esta URL: los webhooks `phone_line.audio_received`, `phone_line.code_received` y `phone_line.code_failed` la traen como `audioUrl` siempre que la solicitud tenga grabación. La URL no contiene credenciales: envía tu clave con ella.

**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/activations/{activationId}/audio
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/activations/{activationId}/audio:
    get:
      tags:
        - Phone Lines
      summary: Descargar la grabación de la llamada
      description: >-
        Devuelve la grabación de la llamada de una solicitud cuyo `hasAudio` es
        `true`: el archivo guardado en sí, no JSON. Se transmite desde nuestra
        copia privada, nunca desde la URL del operador.


        `Content-Type` es el formato propio de la grabación (normalmente
        `audio/wav` o `audio/mpeg`, ya que el formato del operador varía de una
        llamada a otra; `application/octet-stream` cuando no se guardó ninguno),
        con su `Content-Length`. `Content-Disposition: attachment;
        filename="activation-{activationId}.wav"` (`.mp3` para un MP3; sin
        extensión para cualquier otro formato). `Cache-Control: private,
        no-store`: la grabación dice el código de activación.


        `404 ACTIVATION_NOT_FOUND` responde, siempre igual: a una solicitud de
        otro workspace o a un id desconocido; a una solicitud **sin grabación**
        (`hasAudio: false`: la espera expiró o se canceló antes de cualquier
        llamada, o la llamada no se pudo descargar ni guardar); y a cualquier
        solicitud de una línea `RETURNED` o `CANCELED`: una línea que sale de tu
        workspace tiene sus grabaciones eliminadas.


        Rara vez necesitas armar esta URL: los webhooks
        `phone_line.audio_received`, `phone_line.code_received` y
        `phone_line.code_failed` la traen como `audioUrl` siempre que la
        solicitud tenga grabación. La URL no contiene credenciales: envía tu
        clave con ella.


        **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_activations_activationid_audio
      parameters:
        - name: activationId
          in: path
          required: true
          schema:
            type: string
          example: cmg5k3a7c0002ac8example4q
          description: >-
            El id de la solicitud de código (`activation.id`, devuelto por `POST
            /v1/phone-lines/{id}/activations`).
      responses:
        '200':
          description: >-
            La grabación de la llamada, tal como se guardó (binario).
            `Cache-Control: private, no-store`.
          headers:
            Content-Type:
              description: >-
                El formato propio de la grabación: normalmente `audio/wav` o
                `audio/mpeg`; `application/octet-stream` cuando no se guardó
                ninguno.
              schema:
                type: string
              example: audio/wav
            Content-Length:
              description: Tamaño de la grabación en bytes.
              schema:
                type: integer
              example: 221228
            Content-Disposition:
              description: >-
                `attachment; filename="activation-{activationId}.wav"`: `.mp3`
                para un MP3, sin extensión para cualquier otro formato.
              schema:
                type: string
              example: attachment; filename="activation-cmg5k3a7c0002ac8example4q.wav"
            Cache-Control:
              description: >-
                Siempre `private, no-store`: la grabación dice el código de
                activación.
              schema:
                type: string
                enum:
                  - private, no-store
            X-Content-Type-Options:
              description: Siempre `nosniff`.
              schema:
                type: string
                enum:
                  - nosniff
          content:
            audio/wav:
              schema:
                type: string
                format: binary
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/ogg:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        '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 solicitud en tu workspace, una solicitud sin grabación
            (`hasAudio: false`), o una solicitud de una línea `RETURNED` /
            `CANCELED`
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Code request not found. | Pedido de código não encontrado.
                code: ACTIVATION_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.