Create a schedule (user)
Creates a schedule. Requires a token whose validator holds the schedules-management permission, and every company, department or employee you select must be within that validator scope.
scope_type decides who the schedule is for and which selection field is required. It is optional: omit it and the department_id you send becomes a single-department scope, which is exactly how this endpoint behaved before scopes existed, so existing integrations need no change.
The schedule's anchor department (department in the response, group_id on the legacy list endpoint) is derived from the selection. When the selection resolves to no department at all, which happens for a company whose people hold contracts carrying no department, the schedule is saved without one and works normally: its people come from the company. Nothing is refused for lack of a department.
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
Reception weekdayscompany department employeesdepartmentcompaniesarray<string>
departmentsarray<string>
employeesarray<string>
550e8400-e29b-41d4-a716-446655440001days_of_week*array<integer>
08:0017:00550e8400-e29b-41d4-a716-446655440003status_filtersarray<string>
1Responses
550e8400-e29b-41d4-a716-446655440000Sales Team Weekly Plandepartmentobject | null
550e8400-e29b-41d4-a716-446655440001Customer Supportcompany department employeesdepartmentscope*object
companies*array<object>
550e8400-e29b-41d4-a716-446655440020Northwind Tradingdepartments*array<object>
550e8400-e29b-41d4-a716-446655440001Customer Supportemployees*array<object>
550e8400-e29b-41d4-a716-446655440010Jane Smithdepartments*array<object>
550e8400-e29b-41d4-a716-446655440001Customer Supportemployees*array<object>
550e8400-e29b-41d4-a716-446655440010Jane Smith550e8400-e29b-41d4-a716-446655440002Customer SupportdaysOfWeek*array<integer>
1 2 3 4 5 6 7109:0017:3030statusobject | null
550e8400-e29b-41d4-a716-446655440002AvailablesubStatusobject | null
550e8400-e29b-41d4-a716-446655440003On BreakstatusFilters*array<string>
550e8400-e29b-41d4-a716-44665544000212024-03-01T08:29:07+00:002024-03-01T08:29:07+00:00Authorization 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}/schedule-management
curl -X POST 'https://cockpit.voxbi.com/api/v1/{pbx_id}/schedule-management' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"name":"Reception weekdays","scope_type":"department","departments":["550e8400-e29b-41d4-a716-446655440001","550e8400-e29b-41d4-a716-446655440002"],"days_of_week":[1,2,3,4,5],"day_start_time":"08:00","day_end_time":"17:00"}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/schedule-management', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"name": "Reception weekdays",
"scope_type": "department",
"departments": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002"
],
"days_of_week": [
1,
2,
3,
4,
5
],
"day_start_time": "08:00",
"day_end_time": "17:00"
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/{pbx_id}/schedule-management',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"name": "Reception weekdays",
"scope_type": "department",
"departments": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002"
],
"days_of_week": [
1,
2,
3,
4,
5
],
"day_start_time": "08:00",
"day_end_time": "17:00"
}
)
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' => '{
\"name\": \"Reception weekdays\",
\"scope_type\": \"department\",
\"departments\": [
\"550e8400-e29b-41d4-a716-446655440001\",
\"550e8400-e29b-41d4-a716-446655440002\"
],
\"days_of_week\": [
1,
2,
3,
4,
5
],
\"day_start_time\": \"08:00\",
\"day_end_time\": \"17:00\"
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/{pbx_id}/schedule-management', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"departments": [ … ],
"days_of_week": [ … ],
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057