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

# Download call recording

> Returns the call recording of a request whose `hasAudio` is `true` — the stored file itself, not JSON. Streamed from our private copy, never the carrier's URL.

`Content-Type` is the recording's own format — usually `audio/wav` or `audio/mpeg`, since the carrier's format varies from call to call (`application/octet-stream` when none was stored) — with its `Content-Length`. `Content-Disposition: attachment; filename="activation-{activationId}.wav"` (`.mp3` for an MP3; no extension for any other format). `Cache-Control: private, no-store`: the recording speaks the activation code.

`404 ACTIVATION_NOT_FOUND` answers, all alike: a request of another workspace or an unknown id; a request **without a recording** (`hasAudio: false` — the wait timed out or was cancelled before any call, or the call could not be downloaded or stored); and any request of a line that is `RETURNED` or `CANCELED` — a line that leaves your workspace has its recordings deleted.

You rarely need to build this URL: the `phone_line.audio_received`, `phone_line.code_received` and `phone_line.code_failed` webhooks carry it as `audioUrl` whenever the request has a recording. The URL holds no credential — send your key with it.

**Requires a tenant-scoped key** — a number-scoped key (or per-number OAuth grant) gets `403 NUMBER_SCOPE_NOT_ALLOWED`. Permission `phone_lines:read`: with an OAuth / MCP token the user must be an **Owner or Admin** (`403 PERMISSION_DENIED` otherwise).

> [!WARNING]
>
> **The activation code is a credential.** Whoever holds it can register a WhatsApp account on the line. Do not paste a response with a code anywhere public.


## OpenAPI

````yaml openapi.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: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: 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: Download the call recording
      description: >-
        Returns the call recording of a request whose `hasAudio` is `true` — the
        stored file itself, not JSON. Streamed from our private copy, never the
        carrier's URL.


        `Content-Type` is the recording's own format — usually `audio/wav` or
        `audio/mpeg`, since the carrier's format varies from call to call
        (`application/octet-stream` when none was stored) — with its
        `Content-Length`. `Content-Disposition: attachment;
        filename="activation-{activationId}.wav"` (`.mp3` for an MP3; no
        extension for any other format). `Cache-Control: private, no-store`: the
        recording speaks the activation code.


        `404 ACTIVATION_NOT_FOUND` answers, all alike: a request of another
        workspace or an unknown id; a request **without a recording**
        (`hasAudio: false` — the wait timed out or was cancelled before any
        call, or the call could not be downloaded or stored); and any request of
        a line that is `RETURNED` or `CANCELED` — a line that leaves your
        workspace has its recordings deleted.


        You rarely need to build this URL: the `phone_line.audio_received`,
        `phone_line.code_received` and `phone_line.code_failed` webhooks carry
        it as `audioUrl` whenever the request has a recording. The URL holds no
        credential — send your key with it.


        **Requires a tenant-scoped key** — a number-scoped key (or per-number
        OAuth grant) gets `403 NUMBER_SCOPE_NOT_ALLOWED`. Permission
        `phone_lines:read`: with an OAuth / MCP token the user must be an
        **Owner or Admin** (`403 PERMISSION_DENIED` otherwise).
      operationId: get_phone_lines_activations_activationid_audio
      parameters:
        - name: activationId
          in: path
          required: true
          schema:
            type: string
          example: cmg5k3a7c0002ac8example4q
          description: >-
            The code request id (`activation.id`, returned by `POST
            /v1/phone-lines/{id}/activations`).
      responses:
        '200':
          description: >-
            The call recording, as stored (binary). `Cache-Control: private,
            no-store`.
          headers:
            Content-Type:
              description: >-
                The recording's own format — usually `audio/wav` or
                `audio/mpeg`; `application/octet-stream` when none was stored.
              schema:
                type: string
              example: audio/wav
            Content-Length:
              description: Size of the recording in bytes.
              schema:
                type: integer
              example: 221228
            Content-Disposition:
              description: >-
                `attachment; filename="activation-{activationId}.wav"` — `.mp3`
                for an MP3, no extension for any other format.
              schema:
                type: string
              example: attachment; filename="activation-cmg5k3a7c0002ac8example4q.wav"
            Cache-Control:
              description: >-
                Always `private, no-store`: the recording speaks the activation
                code.
              schema:
                type: string
                enum:
                  - private, no-store
            X-Content-Type-Options:
              description: Always `nosniff`.
              schema:
                type: string
                enum:
                  - nosniff
          content:
            audio/wav:
              schema:
                type: string
                format: binary
            audio/mpeg:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          description: >-
            Missing or invalid `x-api-key` / `x-api-key-id` header (the body
            carries only `error`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Invalid API key
        '403':
          description: >-
            Number-scoped key or per-number OAuth grant
            (`NUMBER_SCOPE_NOT_ALLOWED`); OAuth/MCP token of a user who is not
            Owner or Admin (`PERMISSION_DENIED`) or no longer an active member
            (`WORKSPACE_MEMBERSHIP_REQUIRED`); archived workspace
            (`WORKSPACE_ARCHIVED`). `TENANT_REQUIRED`: credential not bound to
            any 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 such request in your workspace, a request with no recording
            (`hasAudio: false`), or a request of a `RETURNED` / `CANCELED` line
          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: Unexpected failure
          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: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.