Save the employee's overtime decision preference (user)
Creates or replaces the employee's overtime decision preference. There is at most one employee level row, so this is an upsert: 201 the first time, 200 on every later call. It writes the same row HR edits under "Decision Preferences", so a change made here is visible to HR immediately.
This is a full replace, not a patch. Fields left out are reset: policy_reason
becomes null and is_active becomes true.
Which fields are required depends on auto_decision_policy:
auto_decision_policy |
preferred_decision |
cap | rest_policy |
|---|---|---|---|
skip_if_manual_decision |
required | required | required |
force_auto_decision |
required | required | required |
force_zero_overtime |
ignored, stored as null | ignored, stored as null | ignored, stored as null |
The cap may be sent as max_seconds or as max_hours; max_seconds wins
when both are present. max_hours is multiplied by 3600 and rounded to the
nearest second. One of the two is required unless the policy is
force_zero_overtime.
Self service only. The request is rejected with 403 when the authenticated user has no access to the tenant or the employee record is not their own, and with 404 when the employee cannot be found.
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
skip_if_manual_decision force_auto_decision force_zero_overtimeforce_auto_decisionPrefers time off over payoutpay_up_to increment_up_to nullincrement_up_to828800add_to_balance drop nulladd_to_balance1Responses
Your overtime decision preference has been saved.data*object
9b1f0c62-4d0a-4e2f-9f43-6f4a5c8d1e70employeeemployeea24c68c0-92c0-4ca0-b749-84c6ddd671edskip_if_manual_decision force_auto_decision force_zero_overtimeforce_auto_decisionForce auto-decision (override manual)Prefers time off over payoutpay_up_to increment_up_to nullpay_up_toPay up to X hours288008add_to_balance drop nulladd_to_balanceAdd to balance12026-08-06 09:14:222026-08-06 10:02:51meta*object
1options*object
auto_decision_policy*object
preferred_decision*object
rest_policy*object
limits*object
3600115200132defaults*object
skip_if_manual_decisionpay_up_toadd_to_balance360011Your overtime decision preference has been saved.data*object
9b1f0c62-4d0a-4e2f-9f43-6f4a5c8d1e70employeeemployeea24c68c0-92c0-4ca0-b749-84c6ddd671edskip_if_manual_decision force_auto_decision force_zero_overtimeforce_auto_decisionForce auto-decision (override manual)Prefers time off over payoutpay_up_to increment_up_to nullpay_up_toPay up to X hours288008add_to_balance drop nulladd_to_balanceAdd to balance12026-08-06 09:14:222026-08-06 10:02:51meta*object
1options*object
auto_decision_policy*object
preferred_decision*object
rest_policy*object
limits*object
3600115200132defaults*object
skip_if_manual_decisionpay_up_toadd_to_balance360011Authorization Token is missingmessagearray<string>
The given data was invalid.errors*object
https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision-preference
curl -X PUT 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision-preference' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
--data '{"auto_decision_policy":"force_auto_decision","policy_reason":"Happy to be paid out for the first 8 hours","preferred_decision":"pay_up_to","max_hours":8,"rest_policy":"add_to_balance","is_active":true}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision-preference', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
body: JSON.stringify({
"auto_decision_policy": "force_auto_decision",
"policy_reason": "Happy to be paid out for the first 8 hours",
"preferred_decision": "pay_up_to",
"max_hours": 8,
"rest_policy": "add_to_balance",
"is_active": true
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.put('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision-preference',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
json={
"auto_decision_policy": "force_auto_decision",
"policy_reason": "Happy to be paid out for the first 8 hours",
"preferred_decision": "pay_up_to",
"max_hours": 8,
"rest_policy": "add_to_balance",
"is_active": true
}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'PUT',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
'content' => '{
\"auto_decision_policy\": \"force_auto_decision\",
\"policy_reason\": \"Happy to be paid out for the first 8 hours\",
\"preferred_decision\": \"pay_up_to\",
\"max_hours\": 8,
\"rest_policy\": \"add_to_balance\",
\"is_active\": true
}',
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/user-overtime-decision-preference', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
{ … }
"data": { … },
"meta": { … }
"options": { … },
"auto_decision_policy": { … },
"preferred_decision": { … },
"rest_policy": { … }
"limits": { … },
"defaults": { … }
{ … }
"data": { … },
"meta": { … }
"options": { … },
"auto_decision_policy": { … },
"preferred_decision": { … },
"rest_policy": { … }
"limits": { … },
"defaults": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"message": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057