Approve a request
Approve an absence request, shift booking, swap or unassignment request.
POST https://cotlet.dev/api/v1/quinyx/requests/{request_id}/approve
write Confirm
Approving an absence request changes the schedule: each shift in the period is unassigned, deleted, reassigned or kept, as you set in shift_actions. The approved request leaves the Needs Approval list. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| request_id string required | string | Id from list_approval_requests. |
| comment string | string | Comment for the employee and the audit log. |
| shift_actions array | array | For absence requests, one object per shift: shift_id and action, one of unassign, delete, reassign, keep. Reassign also takes employee_id. |
Request
curl -X POST https://cotlet.dev/api/v1/quinyx/requests/77310/approve \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"comment":"Approved: 4 colleagues are scheduled each day. Both shifts are now open.","shift_actions":[{"shift_id":"90412","action":"unassign"},{"shift_id":"90437","action":"unassign"}]}' result = client.call("quinyx", "approve_request", {"request_id":"77310","comment":"Approved: 4 colleagues are scheduled each day. Both shifts are now open.","shift_actions":[{"shift_id":"90412","action":"unassign"},{"shift_id":"90437","action":"unassign"}]}) const result = await cotlet.call('quinyx', 'approve_request', {"request_id":"77310","comment":"Approved: 4 colleagues are scheduled each day. Both shifts are now open.","shift_actions":[{"shift_id":"90412","action":"unassign"},{"shift_id":"90437","action":"unassign"}]}); cotlet call quinyx approve_request --data '{"request_id":"77310","comment":"Approved: 4 colleagues are scheduled each day. Both shifts are now open.","shift_actions":[{"shift_id":"90412","action":"unassign"},{"shift_id":"90437","action":"unassign"}]}' Example response
{
"request_id": "77310",
"category": "absence_request",
"status": "approved",
"employee": "Elena Ruiz",
"shift_actions": [
{
"shift_id": "90412",
"action": "unassign"
},
{
"shift_id": "90437",
"action": "unassign"
}
],
"comment": "Approved: 4 colleagues are scheduled each day. Both shifts are now open."
}