Bulk-update DND rules for a user
/users/{user}/dnds/bulk
Creates a new dnd user dnds bulk. Validation rules and required fields are defined in the
request body schema below.
Same PBX only: a {user} of another PBX answers 404. Writes are allowed for the user themself
or a caller with the write users permission, otherwise 403.
For an external dnds.*.caller_identity_id, the value must be one of the caller identities the {user}
may use (their own, their groups', their SIP devices', and the PBX ones), otherwise 422.
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>
application/jsonRequest body · required · application/json
dnds*array<object>
internal externalResponses
dataarray<object>
550e8400-e29b-41d4-a716-4466554400001Authorization Token is missingerrorsobject
https://cockpit.voxbi.com/api/v1/users/{user}/dnds/bulk
curl -X POST 'https://cockpit.voxbi.com/api/v1/users/{user}/dnds/bulk' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"dnds":[{"type":"internal","status":true},{"type":"external","caller_identity_id":"550e8400-e29b-41d4-a716-446655440003","status":false}]}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/users/{user}/dnds/bulk', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"dnds": [
{
"type": "internal",
"status": true
},
{
"type": "external",
"caller_identity_id": "550e8400-e29b-41d4-a716-446655440003",
"status": false
}
]
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/users/{user}/dnds/bulk',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"dnds": [
{
"type": "internal",
"status": true
},
{
"type": "external",
"caller_identity_id": "550e8400-e29b-41d4-a716-446655440003",
"status": false
}
]
}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
'content' => '{
\"dnds\": [
{
\"type\": \"internal\",
\"status\": true
},
{
\"type\": \"external\",
\"caller_identity_id\": \"550e8400-e29b-41d4-a716-446655440003\",
\"status\": false
}
]
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/users/{user}/dnds/bulk', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"dnds": [ … ]
{ … },
{ … }
{ … }
"data": [ … ]
{ … }
cockpit.voxbi.comMon, 16 Oct 2023 14:08:48 GMTcloseno-cache, privateapplication/json6059Origin{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
{ … }
{ … }
"errors": { … }
"dnds.0.caller_identity_id": [ … ]
cockpit.voxbi.comMon, 16 Oct 2023 14:08:48 GMTcloseno-cache, privateapplication/json6059Origin{ … }
30