Mon-Fri 10am - 6pm
Audio Enable / Disable
Base URL for your account: https://cpaas.studio/api/v1
GET
POST
/api/v1/voice/audio/toggle
Turns an audio asset on or off for selection in a broadcast. This is not approval — it's a usability switch layered on top of the pending/approved/rejected status.
Parameters
| Param | Type | Required | Notes |
|---|---|---|---|
audio_uid |
string | one of audio_uid/reference | Takes precedence if both are supplied. |
reference |
string | one of audio_uid/reference | Ambiguous reference is refused, not resolved — see notes below. |
action |
string | one of action/status | "enable" or "disable". |
status |
1/0 | one of action/status | Alias for action — 1 = enable, 0 = disable. |
Request example
curl -X POST "https://cpaas.studio/api/v1/voice/audio/toggle" \
-H "X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d "audio_uid=AUD7K2M9QX4WQ" -d "action=disable"
<?php
$ch = curl_init('https://cpaas.studio/api/v1/voice/audio/toggle');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => ['audio_uid' => 'AUD7K2M9QX4WQ', 'action' => 'disable'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Success response (data)
{
"audio_uid": "AUD7K2M9QX4WQ",
"name": "Welcome Greeting",
"enabled": false,
"status": "approved"
}
Errors
| Code | Status | When |
|---|---|---|
AUDIO_NOT_FOUND |
404 | audio_uid/reference doesn't match any of your assets. |
REQ_VALIDATION_FAILED |
422 | Missing audio_uid/reference, missing action/status, or an ambiguous reference (error.details.matching_audio_uids lists every match). |
Notes
- If more than one of your assets shares the reference you supply, the request is rejected naming every matching audio_uid — nothing is changed. Use audio_uid to target one exactly.
- Disabling does not delete the asset from the operator, and does not stop a broadcast already queued using it before you disabled it.
- Enabling a "pending" asset does not make it usable — it is still waiting on approval separately.
Need more context? See Getting started for authentication, the response envelope, and the full error-code reference.