Create or update an employee's overtime decision (user)
Creates or updates the overtime decision for a single Tempus employee for an overtime calculation period. The endpoint recalculates the period's overtime, derives to_pay / to_increment from the chosen decision (or from an explicit to_pay), and persists the decision via an upsert keyed on tenant, employee and period.
The stored row is fully derived server-side, so the response is the authoritative "after" state:
decision_balance— the balance carried into the period, taken from the last LOCKED period's closing balance (never from an unlocked draft).decision_overtime— the period's accrual UP TO TODAY. Days that have not happened yet are not counted, so a decision taken mid-period no longer reports the remaining workdays as undertime.to_pay— what is cashed out, capped atdecision_balance + decision_overtimeand never negative.to_increment—decision_overtime - to_pay, i.e. what lands on the balance. Negative when the payout is drawn from the carried-in balance.decision_new_balance— what is left afterwards.
When overtime_calculation_period_id is omitted the active period is resolved from the employee's current contract; if no active contract or no active decision period can be resolved the request is rejected with 422. If a decision for the period has already been processed (locked) it can no longer be changed and the request returns 403. The employee must belong to the requested PBX tenant, otherwise 404 is returned.
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
pay add_to_balance customadd_to_balance43200550e8400-e29b-41d4-a716-446655440060Responses
dataobject
550e8400-e29b-41d4-a716-446655440000550e8400-e29b-41d4-a716-4466554400011042550e8400-e29b-41d4-a716-446655440002manual automaticmanualpay_out3600072003600001800038400Carried forward at the employee's request2024-03-01 08:29:07overtime_calculation_periodobject
550e8400-e29b-41d4-a716-446655440002550e8400-e29b-41d4-a716-446655440001550e8400-e29b-41d4-a716-44665544000310422024-03-01T00:00:00Z2024-03-31T23:59:59ZAuthorization Token is missingmessagearray<string>
You asked to be paid 12:00 but only 07:44 is available (balance carried in plus the overtime accrued this period).errorsobject
https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision
curl -X POST 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"decision":"custom","overtime_calculation_period_id":"550e8400-e29b-41d4-a716-446655440060","to_pay":43200}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"decision": "custom",
"overtime_calculation_period_id": "550e8400-e29b-41d4-a716-446655440060",
"to_pay": 43200
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"decision": "custom",
"overtime_calculation_period_id": "550e8400-e29b-41d4-a716-446655440060",
"to_pay": 43200
}
)
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' => '{
\"decision\": \"custom\",
\"overtime_calculation_period_id\": \"550e8400-e29b-41d4-a716-446655440060\",
\"to_pay\": 43200
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"message": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057