Voxbi Cockpit APIs
All endpoints

Get daily required work time for a single employee (user)

Returns the contracted (required) work time per calendar day for one employee across the requested range. The response is a flat object (NOT wrapped in data) keyed by date (YYYY-MM-DD); each value is the required work time for that day in seconds. The figure is derived from the employee's active work-shift assignment and is reduced by approved absences and public holidays (full-day holidays yield 0, half-day holidays halve the requirement). Values are never negative. Both filter[from] and filter[to] are required and the range may not exceed 100 days. The caller may only request their own employee record; requesting another employee returns 403.

HTTP: bearerAuth

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>
pbx_id path · string *
UUID of the PBX tenant.
employee_id path · string *
UUID of the employee. Must match the authenticated caller's own employee record.
filter[from] query · string · date *
Start date of the range (format `Y-m-d`).
filter[to] query · string · date *
End date of the range (format `Y-m-d`). The range may not exceed 100 days.
accept header · string
example: application/json

Responses

OK. Flat object keyed by date (`YYYY-MM-DD`); each value is the required work time in seconds for that day. NOT wrapped in `data`.
Response schema
Free-form object
Authorization Token Missing. This error is returned when the authorization token is missing.
Response schema
errorstring
Error message
example: Authorization Token is missing
The authenticated user has no associated employee record, belongs to a different PBX, or requested an employee other than their own.
Response schema
No response body.
Unprocessable Parameters. This error is returned when a parameter is not valid.
Response schema
messagestring
example: The given data was invalid.
errorsobject
filterarray<string>
[]string
sortarray<string>
[]string
pagearray<string>
[]string
per_pagearray<string>
[]string
get https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/required-work-time
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/required-work-time' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/required-work-time', {
  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}/required-work-time',
    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}/required-work-time', false, $context);
$data = json_decode($response, true);
print_r($data);
{}
"2024-03-01": 28800,
"2024-03-02": 0,
"2024-03-03": 0,
"2024-03-04": 28800,
"2024-03-05": 14400
}
{}
"error": "Authorization Token is missing"
}
Cache-Control string
example: private, must-revalidate
Connection string
example: keep-alive
Content-Type string
example: application/json
Vary string
example: Origin
X-RateLimit-Limit integer
Max requests allowed in the current rate-limit window.
example: 60
X-RateLimit-Remaining integer
Requests remaining in the current rate-limit window.
example: 57
No example for this status.
{}
"errors": {}
"filter": [],
"The filter field must be an array."
],
"sort": [],
"The sort field must be a string."
],
"page": [],
"The page field must be an integer."
],
"per_page": []
"The per page field must be an integer."
]
}
}
Cache-Control string
example: private, must-revalidate
Connection string
example: keep-alive
Content-Type string
example: application/json
Vary string
example: Origin
X-RateLimit-Limit integer
Max requests allowed in the current rate-limit window.
example: 60
X-RateLimit-Remaining integer
Requests remaining in the current rate-limit window.
example: 57