Initiate a new call
Places an outbound call on behalf of the authenticated user.
Minimal request
destination is the only required field. Everything else is optional:
{ "destination": "+12125550199" }
With nothing else supplied, the call is placed using the user's own configuration: their default caller identity and their default ringing targets as set up in the cockpit.
Choosing target devices
Send targets when you want to override which of the user's endpoints should ring. Each
flag is independent, so you can combine them (for example ring the desk phone and the
twinned mobile at the same time):
{
"destination": "+12125550199",
"targets": {
"sip_devices": [],
"webrtc": false,
"twinning": true,
"teams": false
}
}
sip_devices: list of SIP device identifiers to ring. Omit or sendnullto let the PBX pick the user's SIP devices.webrtc: ring the browser softphone. Defaults tofalse.twinning: ring the twinned (mobile) number. Defaults tofalse.teams: ring the Microsoft Teams endpoint. Defaults tofalse.
Every boolean flag defaults to false when it is not passed, so a targets object is only
useful if at least one flag is true or sip_devices is populated.
Enabling a target only has an effect if the matching configuration or integration exists for
the user: WebRTC requires a WebRTC-enabled account, twinning requires a twinning number,
and teams requires the Teams integration. If the underlying feature is not configured, the
PBX simply skips that target and rings whatever remains.
Caller identity
caller_identity is optional. Pass the UUID of a caller identity available to the user to
present a specific outbound number. When omitted, the user's default caller identity is
used.
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
+12125550199550e8400-e29b-41d4-a716-446655440000targetsobject
sip_devicesarray<string>
Responses
dataobject
Authorization Token is missingThe given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/calls/new
curl -X POST 'https://cockpit.voxbi.com/api/v1/calls/new' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"destination":"+12125550199"}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/calls/new', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"destination": "+12125550199"
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/calls/new',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"destination": "+12125550199"
}
)
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' => '{
\"destination\": \"+12125550199\"
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/calls/new', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
{ … }
"data": { … }
cockpit.voxbi.comMon, 16 Oct 2023 14:08:48 GMTcloseno-cache, privateapplication/json6059Origin{ … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057