Voxbi Cockpit APIs
All endpoints

Stream a sound file's audio (user, pbx)

Stream the raw audio bytes of a sound file. The response is sent inline (not as an attachment) so it can be played directly, for example as the src of an HTML <audio> element. The Content-Type reflects the stored format (commonly audio/mpeg, but audio/wav, audio/flac or audio/aac may also be returned), falling back to audio/mpeg.

This endpoint accepts EITHER of two authentication methods:

  • A temporary signed URL. This is the audio_url returned by the sound file resource (it embeds expires and signature query parameters and expires roughly one hour after it is minted). No Authorization header is required, which lets it be used directly in an <audio src>.
  • A bearer token carrying the sound-files ability. Used for durable or programmatic access; the stream is scoped to the token principal's PBX.

When neither a valid signature nor a token is present the request is rejected with 401. A token that lacks the sound-files ability is rejected with 403.

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>
soundFile path · string · uuid *
Sound file identifier.
expires query · integer
Expiry timestamp from the signed `audio_url`. Present only when authenticating with a signed URL.
signature query · string
HMAC signature from the signed `audio_url`. Present only when authenticating with a signed URL.
accept header · string
example: audio/mpeg

Responses

Raw audio stream, sent inline.
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 bearer token does not carry the `sound-files` ability.
Response schema
No response body.
Data Not Found. This error is returned when the requested data is not found.
Response schema
messagearray<string>
[]string
get https://cockpit.voxbi.com/api/v1/sound-files/{soundFile}/audio
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/sound-files/{soundFile}/audio' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/sound-files/{soundFile}/audio', {
  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/sound-files/{soundFile}/audio',
    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/sound-files/{soundFile}/audio', false, $context);
$data = json_decode($response, true);
print_r($data);
No example for this status.
Content-Type string
example: audio/mpeg
Content-Disposition string
example: inline; filename="Welcome announcement"
{}
"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
No example for this status.
{}
"message": []
"Data not found"
]
}
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