Get the next availability date for an employee (user)
Searches forward from a start moment for the next time the employee is available and returns it. The response is a flat object and is not wrapped in a data envelope. When the employee is already available at that moment, next_available_date is null and available_now is true : there is no future availability to report, so a date equal to the current/from day is never returned for that case.
The search is time-aware: a half day off only blocks the part of the day it covers. A morning absence (e.g. 08:00–12:00) that is under way returns today together with next_available_at = the moment it ends; an afternoon one reads as available before it starts and returns the next working day (date only) from the moment it does. message is a ready-to-display line for either case.
When no available date is found within the search window (and the employee is not available now), the endpoint responds with 404 and a flat body reporting the searched range. A 404 is also returned when the employee cannot be found for the tenant.
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/jsonResponses
currentobject
absenceobject
absence_windowobject
am pmAuthorization Token is missingThe given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/next-availability
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/next-availability' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/next-availability', {
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/{pbx_id}/user/{employee_id}/next-availability',
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/{pbx_id}/user/{employee_id}/next-availability', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"current": { … },
"absence": { … },
"absence_window": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057