---
title: "Retrieve recording audio"
description: "Find a recorded call and save its audio securely."
---

## Find the recording

Use [List call recordings](/docs/a1pbx/recordings) with your authorized account. Select a recording identifier from the returned data. Confirm identifier mapping before joining it to a CRM call record.

## Download the audio

Request [Download a recording](/docs/a1pbx/recording) with `type=binary`. Check the HTTP status and content type before saving the result. A JSON error must not be saved as an audio file.

### 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);
```

## Make playback private

Store files in private storage and enforce your own user authorization before playback. Avoid permanent public links. Retention and recording availability depend on the account and the original call configuration.
