Deputy automation · runs daily
Approve or decline Deputy leave requests by your own rule
A leave request arrives by email or push notification, and the manager has to look at the roster, pick a day type for every day and write a comment before approving.
Cotlet does it in your own Deputy account with list_leave_requests, list_shifts, approve_leave_request and decline_leave_request, called by your AI agent, an n8n workflow or a script.
Hosted · nothing to install or maintain
Can Deputy do this on its own?
Deputy has a leave approval flow in its apps and an update on the Leave resource in its REST API (checked 20 Oct 2026). Neither applies a rule such as notice period or cover at the location. Deputy has no official MCP server, and an API script must work out the hours of each day itself.
How you do it in Deputy today
- Managers hear about a request by email, a push notification in the mobile app, or on their dashboard in the web app.
- On mobile, the manager scrolls down the Home screen to Needs attention and taps Leave requests, then checks the details.
- For a request of several days, the manager sets each day to Standard hours, Scheduled hours or Non-working day before Approve is possible.
- The manager adds a comment and taps Approve or Decline. A comment is required to decline.
- The leave type the employee picked is only a suggestion, so the manager can choose another leave type for each day.
How to approve or decline Deputy leave requests by your own rule
Go through pending leave requests. Approve annual leave for at least 14 days ahead when no more than one person at the location is off, decline the rest with a reason and tell me which ones. - 01
Read the pending requests
list_leave_requests returns pending requests with the employee, dates, requested leave type and comment. The account must be a Location Manager or System Administrator to decide them; a Supervisor can only enter leave dates and times.
- 02
Check cover on the roster
For each request, list_shifts reads the location's shifts on those dates. The agent counts who else is off or scheduled and applies the cover rule from your prompt.
- 03
Choose a day type
For an approval, the agent sets day_type to standard_hours, scheduled_hours or non_working_day for the whole request. Deputy asks for this on a multi-day request, and approving only the date range creates no timesheets.
- 04
Approve or decline with a reason
approve_leave_request approves the matches. decline_leave_request sends the comment to the employee, which Deputy requires for a decline, so the agent writes it from your rule. Both wait for your OK per call by default.
- 05
Leave the unclear ones
A request that breaks the rule only slightly, or with no clear roster answer, stays pending with a note for you.
What you get back
Pending leave requests: 6
Approved 4 (Tom Becker Nov 3 to Nov 4, standard hours; cover is fine)
Declined 1 (Ana Lopez Nov 10: two others off that day)
Left for you 1:
- Sam Okafor Dec 24 to Dec 26: holiday week, your call Other ways to ask
- Approve all sick leave for one day automatically and list the longer ones for me.
- Every Monday, show who is off this week at each location, and approve nothing.
- Decline requests that start in less than 14 days and write a polite reason.
What Deputy allows, and what to know first
- Deputy requires a comment to decline a leave request, so a decline without a reason is not possible.
- For a past date, Deputy creates the timesheets as soon as leave is approved; for a future date, it creates them as each day passes.
- Deputy tracks leave in hours, not days, so every approved day needs a day type to know how many hours it stands for.
- Deputy lets a manager enter leave for someone else from the People page with Request & Approve, and a Supervisor can enter only the dates and times.
approve_leave_request and decline_leave_request ask for your OK by default. To run it daily without you, switch confirmation off for those tools in your dashboard.
Sources: Deputy Help: Approving leave requests on the Deputy mobile app · Deputy Help: Managers can enter leave requests on behalf of their team members · Deputy Help: Leave Management FAQs · Deputy Developer: Adding a leave request for an employee
Call approve_leave_request from a script
curl -X POST https://cotlet.dev/api/v1/deputy/leaves/311/request/approve \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"day_type":"standard_hours","comment":"Approved, enjoy the break."}' {
"leave_id": 311,
"employee": "Tom Becker",
"status": "approved",
"leave_type": "Annual leave",
"day_type": "standard_hours",
"days": [
"2026-11-03",
"2026-11-04"
],
"comment": "Approved, enjoy the break."
} MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is deputy_write → approve_leave_request. Example data.
Schedule it in n8n, Make, Zapier or cronDeputy tools this automation uses
| Tool | Parameters |
|---|---|
| list_leave_requests | location_id, status |
| list_shifts | location_id, date_from, date_to, employee_id |
| approve_leave_request | leave_id, day_type, leave_type, comment |
| decline_leave_request | leave_id, comment |
Frequently asked questions
Is it safe to connect Deputy to Cotlet?
Yes. You sign in to Deputy yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Deputy once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.
Give your agent access to Deputy.
Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Deputy.