Voxbi Cockpit APIs
All endpoints

List weekly work times for a single employee (user)

Returns the weekly work-time aggregates for one employee. The response is a flat object (NOT wrapped in data) 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. Each entry also includes a minWorkTimeReached boolean. The caller may only request their 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.
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`). 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.
accept header · string
example: application/json

Responses

OK. Flat object keyed by week-start date (`YYYY-MM-DD`) plus a reserved `summary` key. 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.
Data Not Found. This error is returned when the requested data is not found.
Response schema
messagearray<string>
[]string
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}/work-times
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/work-times' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_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}/user/{employee_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}/user/{employee_id}/work-times', false, $context);
$data = json_decode($response, true);
print_r($data);
{}
"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,
"minWorkTimeReached": 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,
"minWorkTimeReached": 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,
"minWorkTimeReached": false
}
}
{}
"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.
{}
"message": []
"Data not found"
]
}
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
{}
"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