Sync PTO and leave balances to an HRIS or payroll system

A leave balance is not a single number. It is a set of numbers — used, scheduled, pending, remaining, accruals, rollover, TOIL and a yearly quota — and each one can change in more than one system. This guide shows how to give every number one owner, push the result to an HRIS or payroll system in a single direction, and catch edits made in the wrong place before the next sync quietly overwrites them.
What goes wrong when two systems both own the balance
Consider a common pattern. An employee has 18 vacation days on Monday. On Tuesday, HR corrects the contract quota in the HRIS, and the nightly sync copies it over, so the employee now has 20. On Wednesday, a manager adds two days for a work anniversary in the leave tracker, the sync runs the other way, and the HRIS correction is gone. The employee took no leave all week, yet saw three different numbers, and nobody can say which one is right.
Two-way sync fails in ways that are easy to miss:
- Different people edit different systems. HR maintains the HRIS; managers and admins maintain the leave tracker. The sync cannot know which change should win, so one of them disappears without notice.
- The latest run wins. Whichever system synced most recently sets the balance, so the figure reflects timing rather than which edit was right. An employee can see a different number each day with no leave taken in between.
- Changes bounce back. A value synced from A to B registers as a new change in B, so it is synced back to A, and so on. At best this wastes requests; at worst, small rounding differences between days and hours grow with every round trip.
- Nobody can explain the number. When a payroll payout is questioned, there is no single history showing how the balance was reached.
The fix is to treat the other system as read-only for each number it does not own.
Give each number one owner
Pick one system that owns each number, and sync it in one direction only. The recommended default is to let the leave tracker own the balance — entitlements, accruals, rollover, usage and what is left — and let the HRIS or payroll system receive the result. Employees request leave and check their balance in the tracker, approvers decide there, and every rule that changes a balance is set up there.
Some companies must keep the yearly entitlement in the HRIS because it comes from employment contracts. That works too: the HRIS sends the yearly quota to the leave tracker, and the tracker still calculates everything else (accruals, rollover, usage, remaining) and sends the balances back.
The ownership table below summarises which system owns which number and which direction the data flows. It is a decision aid, not a substitute for your own policy review.
| Number | Owner | Direction |
|---|---|---|
| Used, scheduled, pending, remaining | Leave tracker | Tracker → HRIS |
| Accruals, rollover, expiry, TOIL | Leave tracker | Tracker → HRIS |
| Yearly quota | Leave tracker (recommended), or the HRIS when contracts require it | One direction only |
A working sync combines two mechanisms. Webhooks carry the changes people make, while a scheduled full sync picks up the changes that time produces, such as accruals and the start of a new leave year.
Choose the right tool for the job
The right mechanism depends on what you are trying to do. Use the REST API v2 with webhooks when balances must stay exact in an HRIS or payroll system. Use Zapier when you want to apply your own sync logic without coding and your team is small with few leave types. Use the REST API v2 alone when you need to set yearly entitlements in the leave tracker from contracts in your HRIS. Use the MCP server when you need to adjust one person's quota by hand.
Zapier triggers fire on leave events — requested, added, approved, denied, updated, cancelled and deleted — but they do not include balances. Add a Webhooks by Zapier step that calls GET /v2/users/{id}/balances with the user ID from the trigger, then a step for your HRIS app. Zapier has no TOIL, quota or policy triggers and no scheduled full sync, so balances drift after accruals and at the start of a new leave year. Use the API when balances must stay exact.
For a single adjustment, ask your AI assistant through the MCP server, for example "Set Maria's vacation quota to 25 days for this year". The assistant uses manage_user, with the same rules as the dashboard: only administrators, and location admins for their own locations, can change quotas. MCP works on one person at a time and does not fit a regular sync.
Build the REST API sync, step by step
The REST API path has five steps: create credentials, refresh a person when an event names them, run a scheduled full sync, write to the HRIS, and get notified when a balance changes in the wrong place. The subsections below walk through each one.
1. Create an API key and a webhook
Issue the key under an administrator account so it can see every user, granting Balances: Read and Users: Read (scopes balances:read and users:read). Next, register a webhook whose owner is that same administrator. For leave and TOIL events the owner requires leaves:read and toil:read, plus the read scope of any other event you subscribe to.
2. Refresh a person when an event names them
These events change someone's balance. When one arrives, read that person's balances with GET /v2/users/{id}/balances and write the result to your HRIS:
| Event | Changes | Person |
|---|---|---|
| leave.added, leave.approved, leave.updated, leave.cancelled, leave.deleted | used, scheduled, remaining | data.userId |
| leave.requested, leave.denied, leave.expired | pending only | data.userId |
| toil.added, toil.approved, toil.updated, toil.cancelled, toil.deleted | toil, remaining | data.userId |
| user.quota-updated | Quota or rollover settings | data.id |
| user.updated | Location or work week, which can change the leave policy and the hours per day | data.id |
| user.status-changed | Activation or deactivation | data.id |
Some events change many people at once. Refresh everyone they affect:
| Event | Refresh |
|---|---|
| leave-policy.enabled, leave-policy.disabled | The users in data.locationId (list them with GET /v2/users?locations=...) |
| location.updated | The users of that location. The year start or work week may have changed. |
| automation.created, automation.updated with data.type seniority-entitlement or entitlement-by-role | Everyone the automation applies to, or everyone if that is simpler |
| automation.deleted | Everyone, unless your sync stores each automation's type and the people it applies to. Deleted payloads contain only the ID, not data.type. |
Webhooks are delivered at least once and not always in order. Because you re-read the balance instead of applying the event, a duplicate or late event only costs one extra read, as long as you refresh one person at a time. If two workers refresh the same person in parallel, a slow one can write an older balance over a newer one. Use a lock per user around the whole refresh (the balance read, the comparison and write to the HRIS, and the saved last-written value), and let the scheduled sync take the same lock.
If you only send remaining to the HRIS, you can skip pending-only events.
3. Run a full sync on a schedule
Balances also change with time, without any event:
- Accruals. When a policy's accrualType is anything other than NONE, the quota grows by a portion each period, such as weekly or monthly.
- A new leave year. The quota resets and the rollover from the previous year is added.
- Rollover expiry. Rolled-over leave that was not used expires on the date set in the leave policy.
- Seniority entitlements. Extra days begin to count once a person reaches the years of service configured in the automation.
None of these triggers a webhook, so an event-only sync gradually falls out of step. Run a full sync of everyone's balances — daily if your request budget allows it, or the day after each accrual date, at the start of each leave year, and on the rollover expiry date.
Request budget. Each key may send 30,000 requests per month (see Rate limits). A full sync uses one request per user plus one per page of users, and each webhook refresh adds one more. The table below compares the monthly cost of a daily full sync with a monthly full sync after accruals for 100, 300 and 900 users.
| Users | Daily full sync | Monthly full sync after accruals |
|---|---|---|
| 100 | ~3,100 requests a month | ~100 |
| 300 | ~9,300 requests a month | ~300 |
| 900 | ~27,900, close to the limit | ~900 |
For larger companies, sync after accrual dates rather than daily, sync only the locations whose policies accrue, or contact support for a higher quota.
4. Write to the HRIS
Match each leave tracker user to the employee in your HRIS, usually by email. For each leave type, send quotas.remaining in the field that matches unit, and map leaveTypeId to the matching leave or absence type in your HRIS. When hasUnlimitedDays is true, remaining is null: skip it, or mark the type as unlimited in the HRIS. Payroll systems that pay out unused leave usually also want used, and sometimes earned.
5. Get notified when a balance changes in the wrong place
Even with a single owner, the copy will occasionally be edited by hand. Configure alerts so those edits are surfaced and corrected, instead of being silently overwritten by the next sync:
- In the system that is not the source of truth. When the leave tracker is the source, make the balance fields read-only in your HRIS or payroll system if it allows that. Before your sync writes a balance, compare the HRIS value with the value the sync wrote last time. If they differ, someone edited it in the HRIS: send an alert to HR (for example by email or to a Slack or Teams channel) with the person, the leave type and both values, instead of overwriting it without a word.
- In the leave tracker, when the HRIS owns the yearly quota. Subscribe to user.quota-updated. Changes made through the API carry an apiClient object with the keyId of the key that made them, and changes made in the dashboard, Slack or Teams have none. An event without your sync's keyId means someone changed the quota by hand in the leave tracker: alert HR, and decide whether to fix it in the HRIS or revert it.
- For changes you expect. A large change deserves scrutiny even when it originates in the correct system. For instance, alert when remaining shifts by more than a few days outside of approved leave, or turns negative.
The leave tracker's company logs record who changed what, including changes made through each API key, so any alert can be traced back to a person.
Push yearly quotas from the HRIS when contracts require it
Use this direction only for numbers the HRIS must own, usually the yearly quota from employment contracts. PUT /v2/users/{id}/quotas/{leaveTypeId} sets one person's quota for one leave type, like editing it on the user's page in the dashboard. It needs users:write, and the key owner must be an administrator, or a location admin who manages the user.
It is a full replacement: fields you leave out go back to their defaults, with one exception. Leaving out prorate keeps the person's current proration; send prorate: false to turn it off in their first leave period. Send every field you care about each time. The response is the person's quotas with 200, or 202 Accepted with an operation to follow. Send a new Idempotency-Key for each change and reuse it only when you retry that same change, so a retry never applies it twice. See Idempotency.
The fields and their meanings are listed below. Treat this as a reference for the PUT body, not as a list of values you can set on remaining.
| Field | Meaning |
|---|---|
| amount | The yearly quota, in the company's unit: days, or hours when the company uses hourly accounting. Up to 365 days or 2,920 hours. |
| unlimited | true for unlimited leave of this type. amount is then ignored. |
| period | current (default) or next leave period. |
| applyToFutureYears | true to keep the quota in later periods too. By default only the chosen period changes. |
| ignoreRolloverFromPreviousYear | true to stop the previous period's rollover being added for this person. |
| prorate | Prorate from the start date. Allowed only for the person's first leave period, otherwise 400 PRORATE_NOT_ALLOWED. |
What you cannot set:
- The remaining balance. The leave tracker always calculates remaining from the quota, accruals, rollover, TOIL and approved leave. You can't write it directly.
- A custom rollover amount. The API can only turn rollover off for a person (ignoreRolloverFromPreviousYear). A specific brought-forward amount is set in the dashboard.
- Accrual rules, rollover limits and expiry. These belong to the leave policy of the location. Change them with the leave policy endpoints or in the dashboard, not per person.
If your HRIS only knows the final balance, you can't push it as is. Setting the quota to the HRIS balance would count leave twice, because the leave tracker subtracts approved leave again. Either move the entitlement into the HRIS as a yearly quota, or let the leave tracker own the balance and sync it the other way.
When to push:
- HRIS webhook. Many HRIS systems notify you when an employee's contract or entitlement changes. Receive it, find the leave tracker user, and call PUT /v2/users/{id}/quotas/{leaveTypeId}.
- Polling. If the HRIS has no webhooks, read entitlements on a schedule (daily is usually enough), compare with GET /v2/users/{id}/quotas, and update only the people whose quota differs. Comparing first keeps you inside the request budget and avoids user.quota-updated events for nothing.
Every quota you set sends user.quota-updated. If you also sync balances to the HRIS, refresh the balances on that event, but never write the quota back to the HRIS: that is the loop described in the two-way sync section above.
To add time for overtime tracked in the HRIS, create approved TOIL for the person with POST /v2/toil and their userId. This also needs toil:write and leaves:approve, and TOIL must be enabled for that leave type in the person's leave policy.
Summary and decision checklist
Before you build, confirm the following points with your team and your HRIS owner. Each one is a design decision, not a default you can skip past without thinking about it. The aim is a balance that employees, approvers and payroll can all reconcile to the same figure, and a sync that fails loudly rather than silently when someone edits the wrong copy.
| Number | Owner | Direction |
|---|---|---|
| Used, scheduled, pending, remaining | Leave tracker | Leave tracker → HRIS |
| Accruals, rollover, expiry, TOIL | Leave tracker | Leave tracker → HRIS |
| Yearly quota | Leave tracker (recommended), or the HRIS when contracts require it | One direction only |
Recommended default; the yearly quota may be owned by the HRIS when employment contracts require it.
| You want to | Use |
|---|---|
| Keep balances in your HRIS or payroll up to date (recommended) | REST API v2 and webhooks |
| Apply your own sync logic without coding | Zapier, with a step that calls the API |
| Set yearly entitlements in the leave tracker from contracts in your HRIS | REST API v2 |
| Adjust one person's quota by hand | MCP server |
Zapier has no TOIL, quota or policy triggers and no scheduled full sync; use the API when balances must stay exact.
| Event | Changes | Person |
|---|---|---|
| leave.added, leave.approved, leave.updated, leave.cancelled, leave.deleted | used, scheduled, remaining | data.userId |
| leave.requested, leave.denied, leave.expired | pending only | data.userId |
| toil.added, toil.approved, toil.updated, toil.cancelled, toil.deleted | toil, remaining | data.userId |
| user.quota-updated | Quota or rollover settings | data.id |
| user.updated | Location or work week, which can change the leave policy and the hours per day | data.id |
| user.status-changed | Activation or deactivation | data.id |
If you only send remaining to the HRIS, you can skip pending-only events.
| Event | Refresh |
|---|---|
| leave-policy.enabled, leave-policy.disabled | The users in data.locationId (list them with GET /v2/users?locations=...) |
| location.updated | The users of that location. The year start or work week may have changed. |
| automation.created, automation.updated with data.type seniority-entitlement or entitlement-by-role | Everyone the automation applies to, or everyone if that is simpler |
| automation.deleted | Everyone, unless your sync stores each automation's type and the people it applies to. Deleted payloads contain only the ID, not data.type. |
Deleted automation payloads contain only the ID, not data.type.
| Users | Daily full sync | Monthly full sync after accruals |
|---|---|---|
| 100 | ~3,100 requests a month | ~100 |
| 300 | ~9,300 requests a month | ~300 |
| 900 | ~27,900, close to the limit | ~900 |
A key can send 30,000 requests per month. A full sync costs one request per user plus one per page of users, and every webhook refresh costs one more.
| Field | Meaning |
|---|---|
| amount | The yearly quota, in the company's unit: days, or hours when the company uses hourly accounting. Up to 365 days or 2,920 hours. |
| unlimited | true for unlimited leave of this type. amount is then ignored. |
| period | current (default) or next leave period. |
| applyToFutureYears | true to keep the quota in later periods too. By default only the chosen period changes. |
| ignoreRolloverFromPreviousYear | true to stop the previous period's rollover being added for this person. |
| prorate | Prorate from the start date. Allowed only for the person's first leave period, otherwise 400 PRORATE_NOT_ALLOWED. |
The PUT is a full replacement: fields you leave out go back to their defaults, except prorate, which keeps the current proration if omitted.
Frequently asked questions
Should the HRIS or the leave tracker be the source of truth for PTO balances?
The leave tracker, by default. It already holds the leave policies, accruals, rollover, TOIL, entitlements and every approved leave, so its balance matches what employees see. The HRIS can own the yearly quota when it comes from contracts; the leave tracker still calculates the rest.
Can I sync PTO balances both ways?
Not the same number. When different people edit each system, a two-way sync loses edits without telling anyone, the balance depends on which sync ran last, and changes bounce back and forth. Give each number one owner.
Can I set someone's remaining balance through the API?
No. You can set the yearly quota with PUT /v2/users/{id}/quotas/{leaveTypeId}, and the leave tracker calculates remaining from it.
Why do I need a nightly sync if I use webhooks?
Accruals, a new leave year, rollover expiry and seniority entitlements change balances without any event. A scheduled full sync catches them.
curl -X PUT "$API_BASE_URL/v2/users/$USER_ID/quotas/$LEAVE_TYPE_ID" \
-H "Authorization: Bearer vt_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "amount": 25, "applyToFutureYears": true }'| Users | Daily full sync | Monthly full sync after accruals |
|---|---|---|
| 100 | ~3,100 requests a month | ~100 |
| 300 | ~9,300 | ~300 |
| 900 | ~27,900, close to the limit | ~900 |