Voxbi Cockpit APIs
All endpoints

List weekly work times for employees in the tenant (user)

Returns a paginated map of weekly work-time aggregates for active employees in the PBX tenant. The response uses a hand-rolled Laravel paginator envelope (data, links, meta). The data object is keyed by employee UUID; each value is a map keyed by ISO week-start date (YYYY-MM-DD) plus a reserved summary key holding the totals across the queried range. Time values are formatted strings (HH:MM:SS) or - when no work shift was compiled for that week, and every one is mirrored by a signed <field>Seconds integer. Overtime figures are balances: a week below the required time is negative, so the weekly rows always sum to summary. Days after today are excluded from the aggregates (they would otherwise book a full requirement against zero worked time), so a still-running overtime period reports the same balance as GET /{pbx_id}/user/{employee_id}/overtime. When the authenticated user cannot view other employees (no validator scope) and no filter[employee_id] or user_ids is supplied, the result is scoped to the caller's own employee record; requesting another employee returns 403. The queried date range defaults to the current month and cannot exceed 100 days.

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.
filter[from] query · string · date
Start date of the range (format `Y-m-d`). Defaults to the first day of the current month.
filter[to] query · string · date
End date of the range (format `Y-m-d`). Defaults to today. The range may not exceed 100 days.
filter[employee_id] query · array
One or more employee UUIDs to restrict the result to. Accepts a comma-separated string or an array.
user_ids query · array
Array of employee UUIDs to restrict the result to.
page query · integer
Page number.
per_page query · integer
Number of employees per page (1 to 100, default 20).
accept header · string
example: application/json

Responses

OK. Paginated envelope. The `data` object is keyed by employee UUID; each value is a weekly map keyed by week-start date plus a `summary` key.
Response schema
dataobject
Map keyed by employee UUID. Each value is a weekly work-time map.
Free-form object
linksobject
firststring
The first page of the resource
example: http://localhost/api/v1/resources?page=1
laststring
The last page of the resource
example: http://localhost/api/v1/resources?page=1
prevnull | string
The previous page of the resource
nextnull | string
The next page of the resource
metaobject
current_pageinteger
The current page of the resource
≥ 1
example: 1
fromnull | integer
The first item of the resource
≥ 1
example: 1
last_pageinteger
The last page of the resource
≥ 1
example: 1
linksarray<object>
urlstring | null
The url of the resource (null for the boundary prev/next links)
example: http://localhost/api/v1/resources?page=1
labelstring
The label of the resource
example: first
activeboolean
The status of the resource
example: 1
pathstring
The path of the resource
example: http://localhost/api/v1/resources
per_pageinteger
The number of items per page of the resource
≥ 1
example: 15
tonull | integer
The last item of the resource
≥ 1
example: 1
totalinteger
The total number of items of the resource
≥ 0
example: 1
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 work times for an employee they are not allowed to view.
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}/work-times
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times', {
  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}/work-times',
    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}/work-times', false, $context);
$data = json_decode($response, true);
print_r($data);
{}
"data": {},
"550e8400-e29b-41d4-a716-446655440001": {}
"2024-03-04": {},
"totalWorkedTime": "41:31:51",
"totalWorkedTimeSeconds": 149511,
"requiredWorkedTime": "40:00:00",
"requiredWorkedTimeSeconds": 144000,
"businessDaysWorkedTime": "01:31:51",
"businessDaysWorkedTimeSeconds": 5511,
"nonWorkingDaysWorkedTime": "00:00:00",
"nonWorkingDaysWorkedTimeSeconds": 0,
"hasOvertime": true
},
"2024-03-11": {},
"totalWorkedTime": "37:51:11",
"totalWorkedTimeSeconds": 136271,
"requiredWorkedTime": "40:00:00",
"requiredWorkedTimeSeconds": 144000,
"businessDaysWorkedTime": "-02:08:49",
"businessDaysWorkedTimeSeconds": -7729,
"nonWorkingDaysWorkedTime": "00:00:00",
"nonWorkingDaysWorkedTimeSeconds": 0,
"hasOvertime": false
},
"summary": {}
"totalWorkedTime": "79:23:02",
"totalWorkedTimeSeconds": 285782,
"requiredWorkedTime": "80:00:00",
"requiredWorkedTimeSeconds": 288000,
"businessDaysWorkedTime": "-00:36:58",
"businessDaysWorkedTimeSeconds": -2218,
"nonWorkingDaysWorkedTime": "00:00:00",
"nonWorkingDaysWorkedTimeSeconds": 0,
"hasOvertime": false
}
}
},
"links": {},
"first": "https://cockpit.voxbi.com/tempus/api/v1/550e8400-e29b-41d4-a716-446655440000/work-times?page=1",
"last": "https://cockpit.voxbi.com/tempus/api/v1/550e8400-e29b-41d4-a716-446655440000/work-times?page=1",
"prev": null,
"next": null
},
"meta": {}
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://cockpit.voxbi.com/tempus/api/v1/550e8400-e29b-41d4-a716-446655440000/work-times",
"per_page": 20,
"to": 1,
"total": 1
}
}
{}
"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