---
title: "Download a recording"
description: "Retrieve the audio of an accessible recorded call by its recording identifier."
---

> **Account availability:** These examples describe the A1PBX version 7 interface. Confirm the endpoint, header authentication, response format, and record permissions for your assigned account before production use.

## Request

Retrieve the audio of an accessible recorded call by its recording identifier.

`GET /call_recording`

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `uuid` | string | Yes | Recording identifier obtained from an authorized recording result. |
| `type` | string | No | Explicitly request binary or base64. Availability depends on your deployed version. |

## Examples

### cURL

```bash
curl --fail-with-body --get \
  "https://$A1PBX_ACCOUNT_ID.a1routes.com/app/api/7/call_recording" \
  --header "Authorization: Basic $A1PBX_API_KEY" \
  --data-urlencode "uuid=$RECORDING_UUID" \
  --data-urlencode "type=binary" \
  --output recording.audio
```

### Node.js

```javascript
import { writeFile } from 'node:fs/promises';
const url = new URL(`https://${process.env.A1PBX_ACCOUNT_ID}.a1routes.com/app/api/7/call_recording`);
url.searchParams.set('uuid', process.env.RECORDING_UUID);
url.searchParams.set('type', "binary");
const response = await fetch(url, {
  headers: {
    Authorization: `Basic ${process.env.A1PBX_API_KEY}`,
  },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
await writeFile('recording.audio', Buffer.from(await response.arrayBuffer()));
```

### Python

```python
import os
import requests
url = f"https://{os.environ['A1PBX_ACCOUNT_ID']}.a1routes.com/app/api/7/call_recording"
response = requests.get(
    url,
    params={
        "uuid": os.environ["RECORDING_UUID"],
        "type": "binary",
    },
    headers={"Authorization": "Basic " + os.environ["A1PBX_API_KEY"]},
    timeout=30,
)
response.raise_for_status()
with open("recording.audio", "wb") as audio:
    audio.write(response.content)
```

### PHP

```php
<?php
$url = 'https://' . getenv('A1PBX_ACCOUNT_ID') . '.a1routes.com/app/api/7/call_recording';
$url .= '?' . http_build_query([
    'uuid' => getenv('RECORDING_UUID'),
    'type' => 'binary',
]);
$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => ['Authorization: Basic ' . getenv('A1PBX_API_KEY')],
]);
$body = curl_exec($ch);
if ($body === false) throw new RuntimeException(curl_error($ch));
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 400) throw new RuntimeException('HTTP ' . $status);
file_put_contents('recording.audio', $body);
```

## Response

For `type=binary`, handle the response as an audio file and save it locally. For `type=base64`, confirm the returned encoding and envelope before decoding. Do not infer content type or a file extension from the request alone.

## Integration notes

Recordings may be unavailable when recording was not enabled or the file is outside its retention period. Never expose the authenticated download URL publicly.

See [authentication](/docs/authentication), [pagination](/docs/pagination), and [error handling](/docs/errors).
