Get a user's leave quotas
Use this endpoint when you need a user's base leave entitlement for one leave period, broken down by active leave type in the user's location. It is the right call for planning or policy checks; it is not the call for remaining balances.
What this returns — and what it does not
This endpoint returns the quota — the base entitlement before rollover, seniority, TOIL and usage — for each leave type in the user's location, for one leave period. That distinction matters: a quota tells you what the period starts with, not what is left after time taken or adjustments. If you need remaining balances, use the balances endpoint instead.
Checklist before you call:
- Confirm the user ID you will place in the path.
- Decide whether you need the current period or the next one.
- Confirm your key carries the required read scope.
- Send no query parameter other than period.
- Read each amount together with its unit, and check unlimited and isCustom before comparing values across users.
Request: path, period and authorization
Send a GET request to /v2/users/{id}/quotas. The id path parameter is a required string identifying the resource. The only query parameter is period, an optional string defaulting to current. current selects the leave period containing today; next selects the period after it.
Authorization uses a bearer API key in the Authorization header, with the users:read scope required. The key owner's role can further limit what data is reachable, so a valid key does not guarantee access to every user.
The request example is provided as protected module code0001, and the parameter contracts are schema0001 through schema0004. Use those modules for exact field and enum details rather than guessing values.
Reading the response
A successful response contains the userId, the selected period with its start and end dates, and a quotas array. Each quota entry carries leaveTypeId, leaveTypeName, unlimited, amount, unit, isCustom, prorate and ignoreRolloverFromPreviousYear.
Read the fields as a group:
- amount is in the quota's own unit, days or hours, as configured on the leave policy or the user's custom quota.
- When unlimited is true, amount is 0 — treat the flag, not the number, as the entitlement signal.
- isCustom is true when the value was set for this user rather than inherited from the location's leave policy.
- prorate indicates proration for the user's first leave period.
- ignoreRolloverFromPreviousYear indicates that rolled-over days from the previous period are not added for this user.
- Only active leave types appear.
Worked example from protected module code0002: the period runs 2026-01-01 to 2026-12-31. Vacation shows amount 25 in days with isCustom true, so this user has a personal override rather than the location default. Sick leave shows unlimited true with amount 0 in days, so do not report that as zero entitlement. Both entries have prorate false and ignoreRolloverFromPreviousYear false.
Hidden leave types need care: without leave-types:read-hidden, leaveTypeName is returned as Hidden Leave Type, while leaveTypeId and amount are unchanged. Do not treat the placeholder name as the real type name, and do not drop the entry — its amount is still meaningful.
Errors and how to react
Failures use a shared error envelope with a stable code, a readable name, a description, a resolution, a requestId and optional details. Keep the requestId when contacting support.
- 400 VALIDATION_ERROR: the period value is invalid or an unknown query parameter was sent. Fix the listed fields and retry.
- 400 QUOTA_PERIOD_NOT_AVAILABLE: the user has no leave period containing today, or no next period. Check period selection and the user's period setup.
- 404 RESOURCE_NOT_FOUND: the user does not exist or sits outside the key's data reach. Verify the ID and the key owner's visibility.
- 401, 403, 429 and 500 responses follow the same envelope; the protected examples code0003 through code0008 show the shapes for validation, authorization, scope, not-found, rate-limit and internal errors. A key lacking a required scope returns INSUFFICIENT_SCOPE with the needed scopes listed in details.requiredScopes.
Frequently asked questions
Does this endpoint show remaining leave?
No. This endpoint returns the starting entitlement for a period, before adjustments for rollover, seniority, TOIL and usage. For what remains available, use the balances endpoint.
Which query parameters can I send?
Only period is accepted. Values are current for the period containing today, which is the default, or next for the following period. Any other query parameter fails validation.
How should amount, unit and isCustom be interpreted?
The amount is expressed in the unit configured for that quota, either days or hours. An unlimited quota reports amount 0. isCustom distinguishes a user-specific setting from the location policy value.
What happens for a hidden leave type?
Without leave-types:read-hidden, the name is replaced with Hidden Leave Type, while leaveTypeId and amount stay the same. Only active leave types are returned in either case.
curl -X GET "$API_BASE_URL/v2/users/string/quotas" \
-H "Authorization: Bearer "{
"data": {
"userId": "user-cfe5d39b-f1f0-45aa-85cd-ce93e637a262",
"period": {
"start": "2026-01-01",
"end": "2026-12-31"
},
"quotas": [
{
"leaveTypeId": "leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
"leaveTypeName": "Vacation",
"unlimited": false,
"amount": 25,
"unit": "days",
"isCustom": true,
"prorate": false,
"ignoreRolloverFromPreviousYear": false
},
{
"leaveTypeId": "leaveType-88681ca1-4a47-4e4d-bc35-ffff86c0f54e",
"leaveTypeName": "Sick leave",
"unlimited": true,
"amount": 0,
"unit": "days",
"isCustom": false,
"prorate": false,
"ignoreRolloverFromPreviousYear": false
}
]
}
}{
"error": {
"code": "VALIDATION_ERROR",
"name": "ValidationError",
"description": "Example post details.",
"resolution": "Fix the fields listed in details.fields and send the request again.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
"details": {
"fields": [
{
"path": "startDate",
"message": "\"startDate\" is required"
}
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"name": "Unauthorized",
"description": "Example post details.",
"resolution": "Send a valid API key in the Authorization header as Bearer followed by the full vt_live_ key.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "INSUFFICIENT_SCOPE",
"name": "InsufficientScope",
"description": "Example post details.",
"resolution": "Add the scopes listed in details.requiredScopes to the key in the OnlyLeave dashboard.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
"details": {
"requiredScopes": [
"leaves:write"
]
}
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"name": "ResourceNotFound",
"description": "Example post details.",
"resolution": "Check the ID of the resource named in details.resource and that the key owner can see it.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "RATE_LIMITED",
"name": "RateLimited",
"description": "Example post details.",
"resolution": "Wait a few seconds and retry, using the same Idempotency-Key for writes.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"name": "InternalError",
"description": "Example post details.",
"resolution": "Retry later, and if it keeps happening, contact OnlyLeave support and quote the requestId.",
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
}
}id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | string | Yes | resource ID. |
period
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| period | string | No | current returns the leave period that contains today, next returns the leave period after it. Default is current . | "current" Allowed values: "current" | "next" |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | object | No | ||
| response.data.userId | string | No | the ID of the user | |
| response.data.period | object | No | ||
| response.data.period.start | string | No | first day of the leave period in YYYY-MM-DD format | Format: date |
| response.data.period.end | string | No | last day of the leave period in YYYY-MM-DD format | Format: date |
| response.data.quotas | array<UserQuota> | No | ||
| response.data.quotas[] | object | |||
| response.data.quotas[].leaveTypeId | string | No | the ID of the leave type | |
| response.data.quotas[].leaveTypeName | string | No | leave type name | |
| response.data.quotas[].unlimited | boolean | No | true if the user has unlimited leave of this type | |
| response.data.quotas[].amount | number | No | the quota for the period, in unit ; 0 when unlimited is true | |
| response.data.quotas[].unit | string | No | the unit of amount , days or hours, as set on the leave policy or on the user's custom quota | "days" | "hours" |
| response.data.quotas[].isCustom | boolean | No | true when the quota was set for this user instead of coming from the location's leave policy | |
| response.data.quotas[].prorate | boolean | No | true if the quota is prorated for the user's first leave period | |
| response.data.quotas[].ignoreRolloverFromPreviousYear | boolean | No | true if days rolled over from the previous period are not added for this user |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |