Create a forward for a user
/users/{user}/forwards
Creates a new user user forwards index. 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 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
1Mobilebusy no_answer unconditional unreachableno_answerphone_number extension voicemailphone_numbertarget_optionsobject
Responses
dataobject
550e8400-e29b-41d4-a716-446655440010550e8400-e29b-41d4-a716-446655440001unconditional+324991234561Authorization Token is missingerrorsobject
https://cockpit.voxbi.com/api/v1/users/{user}/forwards
curl -X POST 'https://cockpit.voxbi.com/api/v1/users/{user}/forwards' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"enabled":true,"event":"no_answer","target":"phone_number","target_options":{"phone_number":"+12125550100"},"caller_identity_id":null}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/users/{user}/forwards', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"enabled": true,
"event": "no_answer",
"target": "phone_number",
"target_options": {
"phone_number": "+12125550100"
},
"caller_identity_id": null
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/users/{user}/forwards',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"enabled": true,
"event": "no_answer",
"target": "phone_number",
"target_options": {
"phone_number": "+12125550100"
},
"caller_identity_id": null
}
)
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' => '{
\"enabled\": true,
\"event\": \"no_answer\",
\"target\": \"phone_number\",
\"target_options\": {
\"phone_number\": \"+12125550100\"
},
\"caller_identity_id\": null
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/users/{user}/forwards', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"target_options": { … },
{ … }
"data": { … }
cockpit.voxbi.comMon, 16 Oct 2023 14:08:48 GMTcloseno-cache, privateapplication/json6059Origin{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
{ … }
{ … }
"errors": { … }
"caller_identity_id": [ … ]
cockpit.voxbi.comMon, 16 Oct 2023 14:08:48 GMTcloseno-cache, privateapplication/json6059Origin{ … }
30