Skip to content

Download a call recording (user, pbx)

get /call-recording

Streams the audio recording for a call. Pick the file with type; no storage path is needed:

  • no type, or type=all → the combined recording (caller + callee)
  • type=caller → the caller leg
  • type=callee → the callee leg

The download_url values in call history and call detail already point here with the right id and type, so they can be followed with the same token. The older path parameter still works; when both are sent, type wins.

Authentication accepts either a user personal access token or a PBX-owned API key. A PBX API key must carry the call-history ability/scope. No other token is needed: use the same token as for call history and call detail.

Example: GET /call-recording?id=47679936&type=caller returns the caller's track as audio/wav. Each request returns one file.

Rate-limited to 120 requests per minute per principal.

HTTP: bearerAuth

User bearer token. Default authentication for customer-facing endpoints. Obtain a token by calling POST /login with your credentials, then send it on every subsequent request as Authorization: Bearer <token>. The token inherits the permissions and PBX scope of the authenticated user.

HTTP Authorization Scheme
bearer
Bearer format
Bearer <token>
id query · integer · int64 *
The `cdr_id` of the call whose recording to download.
type query · string
Which recording to download. Omit (or `all`) for the combined recording.
enum: all caller callee
path query · string
Legacy. Specific recording-file path (the `path` value from a `recording_file`, `recording_file_path_caller`, or `recording_file_path_callee` reference). Use `type` instead; ignored when `type` is sent.
raw query · boolean
`1` returns the stored file byte-for-byte. By default, recordings stored with 24 kHz audio under an 8 kHz WAV header (they play three times too long and slowed down) are corrected on download; `raw=1` skips that correction.

Responses

The recording audio stream. Status, body and headers are identical to the CDRs API's own call-recording endpoint.
Response schema
No response body.
Authorization Token Missing. This error is returned when the authorization token is missing.
Response schema
errorstring
Error message
example: Authorization Token is missing
The presented PBX API key does not carry the required `call-history` ability/scope, or the call belongs to another company, or the user token's user does not have "Access own call recordings and transcriptions" (`access_all_call_recordings` on `GET /me`).
Response schema
messagestring
The call has no recording of the requested type.
Response schema
statusboolean
example:
messagestring
Invalid `id` or `type`. Allowed `type` values are `all`, `caller`, `callee`.
Response schema
statusboolean
example:
errorsobject
Free-form object
Too many requests. Rate-limited to 120 requests per minute per principal.
Response schema
No response body.
get https://cockpit.voxbi.com/api/v1/call-recording
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/call-recording' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/call-recording', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${YOUR_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.get('https://cockpit.voxbi.com/api/v1/call-recording',
    headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
    'http' => [
        'method'  => 'GET',
        'header'  => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
    ],
]);

$response = file_get_contents('https://cockpit.voxbi.com/api/v1/call-recording', false, $context);
$data = json_decode($response, true);
print_r($data);
No example for this status.
X-Recording-Repaired string
Present only when the WAV header was corrected on the fly, e.g. `sample-rate 8000->24000; original bytes via raw=1`. Only the header changes; the audio samples are delivered unchanged.
{ … }
"error": "Authorization Token is missing"
}
Cache-Control string
example: private, must-revalidate
Connection string
example: keep-alive
Content-Type string
example: application/json
Vary string
example: Origin
X-RateLimit-Limit integer
Max requests allowed in the current rate-limit window.
example: 60
X-RateLimit-Remaining integer
Requests remaining in the current rate-limit window.
example: 57
{ … }
"message": "Invalid ability provided."
}
{ … }
"status": false,
"message": "Recording dont exists."
}
{ … }
"status": false,
"errors": { … }
"type": [ … ]
"The selected type is invalid."
]
}
}
No example for this status.