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

Parameters: approve_request
NameTypeDescription
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
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"}]}'
Python
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"}]})
Node.js
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"}]});
CLI
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

JSON

{
  "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."
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.