Calls
Download the recording
Gives the call's recording.
GET https://api.diska.ai/v1/calls/{call_id}/recording
Scope: recordings:read
By default it answers 302 to a signed link that lasts 5 minutes (curl -L -o recording.webm … follows it and saves the audio). With ?format=json it returns the link as JSON. Ask for a new link whenever you need the audio instead of storing it. Every access is recorded in the audit log.
Parameters
Path
| Name | Type | Required | Description |
|---|---|---|---|
call_id | string | Yes | The call's ID. |
Query string
| Name | Type | Required | Description |
|---|---|---|---|
format | string | No | redirect (the default) or json. Default: redirect. |
Examples
curl "https://api.diska.ai/v1/calls/<call_id>/recording?format=json" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/calls/<call_id>/recording?format=json",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/calls/<call_id>/recording?format=json', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/calls/<call_id>/recording?format=json');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Try it
Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.
GET
https://api.diska.ai/v1/calls/{call_id}/recording?format=jsonStarts with dsk_. It stays in this browser tab only.
path
query
Enter an API key (dsk_…).
Response 200
| Field | Type | Description |
|---|---|---|
call_id | string | The call. |
url | string | Signed link to download the audio. |
expires_in | integer | Seconds until the link expires. |
content_type | string | null | Audio format, for example audio/webm. |
size_bytes | integer | null | Size in bytes. |
duration_seconds | integer | null | Duration in seconds, when known. |
{
"call_id": "8d0c6a3e-2f14-4b7a-9c55-1e3f0a6d2b81",
"url": "https://o-seu-sistema.com/hooks/diska",
"expires_in": 0,
"content_type": "…",
"size_bytes": 48213,
"duration_seconds": 95
}
Errors
| Code | When |
|---|---|
404 | Esta chamada não tem gravação. (no recording), or the recording is no longer available (for example, it expired). |
502 | The link could not be generated. Try again. |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

