Skip to content

Reading PTO and leave balances

Balances tend to get challenged around payroll time. One report shows a number, the dashboard shows a different one, and someone has to work out why before pay can be finalized. This guide explains how to retrieve balances straight from the system, either for an individual or for the full company, which value to rely on, and how the components of that value fit together.

What a leave balance actually contains

Within a given leave year, a balance represents how much of a leave type a person still has available. It combines the assigned quota, anything carried over from the prior year, time off in lieu, and leave already taken. The platform derives this from a ledger that records every request, approval, cancellation and quota adjustment, which is why the dashboard, the API and the MCP server all report an identical figure. The calculation itself is supplied as an exact contract module (code0002) on this page; for readers, the key points are that time off in lieu is treated differently depending on the policy's accrualType, and that expired rollover is accounted for separately from lapsed time off in lieu.

The short answer

Call GET /v2/users/{id}/balances with an API key that has balances:read, then read quotas.remaining in the field matching the leave type's unit (days or hours). For the whole company, list users with GET /v2/users and fetch each person's balances. For plain-language questions, use the MCP server. For a monthly email without code, use a scheduled Leave Balance Report.

Choosing the right tool

The right path depends on the job. The table below maps common tasks to the tool that fits them.

Step-by-step with the REST API

The worked example uses the REST API: one person's balances first, then everyone's.

1. Create an API key

In the dashboard, open Add-ons → Open API and add a key with the Balances: Read and Users: Read scopes (balances:read and users:read). See Authentication. A key can only reach the people its owner is allowed to view. If you need balances for the entire company, issue the key from an administrator account.

2. Get one person's balances

The request is delivered as an exact contract module (code0003). The response contains one entry for the current leave year, with one item per active leave type; the full response shape is in code0004. Add period=all to return every leave year of the person instead. isCurrent marks the year that contains today.

3. Read the right number

For "how much does this person have left", read quotas.remaining in the field matching unit: remaining.days when unit is days, remaining.hours when it is hours. The other field is a conversion using the person's average working hours per day, so it can show fractions the dashboard does not. remaining is null when hasUnlimitedDays is true, so check that before comparing numbers. The field meanings are listed in the balance field table below.

Worked example

Using the example: rollover 3 + earned 21 − used 8 − expired 0 = 16 remaining. The 5 scheduled days sit inside the 8 used days, and the 2 pending days are not subtracted. If you want "left if every pending request is approved", subtract pending yourself. If you want "left as of today", add scheduled back to remaining.

4. Get everyone's balances

No single endpoint returns every balance in one call. Start from the user list, then request balances per user. The Node.js and Python examples are delivered as exact contract modules (code0005 and code0006). Keep paginating until nextToken is missing, even when a page is short or empty. GET /v2/users returns active users by default; add status=INACTIVE for deactivated users, or filter with locations, departments and labels.

Planning the request budget

A key can send 10 requests per second and 30,000 per month. One full sync costs one request per user plus one per page of users, so a daily sync of 300 people uses about 9,300 requests a month. For larger companies, sync less often, sync only the locations you need, or contact support for a higher quota. To keep balances current, subscribe to webhooks for leave and quota changes and refresh the person each event names. Also keep a scheduled full sync running: accruals, rollover expiry, seniority entitlements and the start of a new leave year all shift balances without emitting any event. See Run a full sync on a schedule.

Errors and what they mean

The error table below lists the common failures and the fix for each.

Asking Vee

Vee is the AI assistant built into the product. It is available to everyone in the dashboard, Slack, Microsoft Teams or the mobile app, with no setup required — for example "How many days do I have left?" or "Do my unused days roll over?" Vee draws on the same balances as the API and answers only about your own. For anyone else's balances, use MCP or the API.

Asking an AI assistant through MCP

Connect your AI client to the MCP server and ask in plain language, for example "How many vacation days do I have left?", "What's Ana's sick leave balance this year?" or "Does Mark have enough vacation days left for two weeks in August?" The assistant uses the get_user_details tool, which returns the same balances as the API. You see the balances your role allows: your own as a user, your departments as an approver, everyone as an administrator. MCP looks up one person at a time, so it fits questions and quick checks. For the whole team or a regular export, use the REST API.

Using Zapier

Zapier triggers fire on leave events (requested, approved, cancelled and so on) and do not include balances. To get a balance into a Zap, call the REST API from it, for example with a "Webhooks by Zapier" step that sends the request from step 2.

Without code: a scheduled report

To get balances by email once a month, go to Reports → Scheduled Reports in the dashboard and create a Leave Balance Report. Choose the locations, departments or labels to include, the people who receive it, and the day of the month it is sent. You can also create the same report with POST /v2/scheduled-reports and reportType: leaveBalanceReport. Scheduled reports are part of the Complete plan.

Summary

Balances are calculated the same way in the dashboard, the API and MCP, so read them instead of recalculating. Read quotas.remaining in the field matching unit, and check hasUnlimitedDays first: remaining is null for unlimited leave. used already includes future approved leave (scheduled); pending is never subtracted. For everyone's balances, list users and request each one, follow nextToken to the end, and budget for 10 requests per second and 30,000 per month. For a company-wide sync, issue the key from an administrator account; for one-person questions, use MCP; for a monthly email without code, use a scheduled report.

Which tool fits which job
You want toUse
Sync balances to payroll, an HRIS or a spreadsheet on a scheduleREST API v2
Let everyone check their own balance in the dashboard, Slack or Teams, with nothing to set upVee
Ask your own AI assistant about anyone's balance your role can seeMCP server
Email a balance report to HR once a month, without codeScheduled report
Apply your own logic to balances without coding, for example post someone's remaining days to Slack when their leave is approvedZapier, through the REST API

Captured evidence; tool availability and plan inclusion may change.

Balance field meanings
FieldMeaning
baseQuotaThe yearly quota from the leave policy, or the person's custom quota.
seniorityEntitlement, entitlementByRoleExtra quota for this year from automations.
earnedWhat the person has earned so far this year, without rollover. For accrual policies, only what has accrued until today. Prorated when the person started during the year and proration is on.
quotaAtYearEndThe yearly entitlement: baseQuota plus the two entitlements, not prorated. It is not a forecast: earned can end the year below it, for example after proration, paused accruals or an accrual cap.
rolloverFromPreviousYearBrought forward from last year. Can be negative when the policy carries a negative balance forward.
expiredThe part of the rollover that expired unused.
toil, toilLapsedTime off in lieu added to this leave type, and the part of it that lapsed.
usedApproved leave this year, including approved leave that is still in the future.
scheduledApproved leave dated after today. It is the future part of used, already subtracted from remaining.
pendingRequests waiting for approval.
remainingWhat is left to request. The same number the dashboard shows.

Captured evidence; field behavior follows the current API contract.

Common errors and fixes
ErrorCauseWhat to do
404 RESOURCE_NOT_FOUNDThe user does not exist, or is outside the key's data reach.Use an administrator's key, or check the user ID.
403 INSUFFICIENT_SCOPEThe key has no balances:read (or users:read for the user list).Edit the key and set Balances (or Users) to Read.
429 RATE_LIMITEDToo many requests in a short time.Retry with backoff.
429 QUOTA_EXCEEDEDThe monthly quota is used up.Wait for the next month, or contact support.

Captured evidence; error codes and remedies follow the current API contract.

Frequently asked questions

Does the remaining balance include pending requests?

No. The remaining figure accounts for approved leave alone. Anything still waiting on a decision is reported separately in pending, so if you need a worst-case view where every open request is granted, you have to do that subtraction on your side.

Does the remaining balance include approved leave in the future?

Yes. Approved leave that falls on later dates is already counted inside used, and scheduled carves out exactly that later-dated share. If your goal is a figure that reflects only what has been taken up to now, put scheduled back into remaining.

What does a negative PTO balance mean?

The isNegative flag turns true whenever a value drops below zero, which happens when someone has taken more leave than they had accrued by that point. Policies that permit it can also pass a deficit into the following leave year, and in that case rolloverFromPreviousYear itself carries a negative value.

Where is last year's rollover, or brought-forward balance?

You will find it under quotas.rolloverFromPreviousYear. Any portion of that carry-over that lapsed without being used sits in quotas.expired, and remaining already reflects both of them.

Should I read days or hours?

Use whichever field corresponds to the leave type's unit. The remaining field is a derived conversion based on that person's average working hours per day, so treat it as secondary.

curl "$API_BASE_URL/v2/users/$USER_ID/balances" \
  -H "Authorization: Bearer vt_live_..."
{
  "data": [
    {
      "userId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14",
      "yearStart": "2026-01-01",
      "yearEnd": "2026-12-31",
      "isCurrent": true,
      "leaveTypes": [
        {
          "leaveTypeId": "leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
          "leaveTypeName": "Vacation",
          "leavePolicyId": "leavePolicy-2d7c1b9e-5a4f-4c3b-8e1d-7f6a5b4c3d2e",
          "accrualType": "NONE",
          "unit": "days",
          "hasUnlimitedDays": false,
          "quotas": {
            "baseQuota": { "days": 20, "hours": 160, "isNegative": false },
            "rolloverFromPreviousYear": { "days": 3, "hours": 24, "isNegative": false },
            "seniorityEntitlement": { "days": 0, "hours": 0, "isNegative": false },
            "entitlementByRole": { "days": 0, "hours": 0, "isNegative": false },
            "toil": { "days": 1, "hours": 8, "isNegative": false },
            "toilLapsed": { "days": 0, "hours": 0, "isNegative": false },
            "earned": { "days": 21, "hours": 168, "isNegative": false },
            "quotaAtYearEnd": { "days": 20, "hours": 160, "isNegative": false },
            "expired": { "days": 0, "hours": 0, "isNegative": false },
            "used": { "days": 8, "hours": 64, "isNegative": false },
            "scheduled": { "days": 5, "hours": 40, "isNegative": false },
            "pending": { "days": 2, "hours": 16, "isNegative": false },
            "remaining": { "days": 16, "hours": 128, "isNegative": false }
          }
        }
      ]
    }
  ]
}