List a location's holidays
This endpoint returns every holiday day for a single location within one calendar year. The response is sorted by date and delivered in one payload without pagination. Each day is its own entry, so a multi-day holiday appears as several records that share a multiDayId. The call requires the holidays:read scope.
Request contract
Use GET on /v2/locations/{id}/holidays. The path parameter id is required and identifies the location. The optional query parameter year is an integer with a minimum of 0; when omitted it defaults to the current UTC year. The request must carry a bearer token with holidays:read. The exact request contract, including the cURL example and SDK variants, is supplied in the protected modules code0001 and hidden-sdk-0-_default.
Response shape
A successful 200 response wraps an array of Holiday objects in a data property. Each Holiday carries id, locationId, name, date, isHalfDay, type, and recurring as required fields. multiDayId is optional and appears only when the day belongs to a multi-day holiday. transferredFrom is optional and appears only when a holiday was moved from a non-working day. The full field definitions are in schema0005 and the sample payload is in code0002.
Holiday field map
The table below summarizes each field in the Holiday object and whether it is required in the response.
Error handling
The endpoint can return 400 VALIDATION_ERROR when year is not a whole number, and 404 RESOURCE_NOT_FOUND when the location does not exist or falls outside the key's data reach. Authentication failures return 401, missing scopes return 403, rate limiting returns 429, and server faults return 500. The error envelope is described in schema0006 through schema0011, and the sample error bodies are in code0003, code0004, code0006, code0007, and code0008.
Worked example
Suppose a location has a New Year's Day holiday on 2026-01-01, a two-day company retreat on 2026-06-18 and 2026-06-19, and Christmas Day on 2026-12-25. A request with year=2026 returns four entries sorted by date. The two retreat days share the same multiDayId, so a client can group them back into one event. New Year's Day and Christmas Day have recurring set to true. The full sample is in code0002.
Decision checklist
Before calling the endpoint, confirm the following: the location id is known and visible to the key owner; the key has holidays:read; the year is either omitted for the current UTC year or supplied as a whole number; and the client can handle one entry per day rather than one entry per holiday event. If the response will be used to build a calendar, group entries by multiDayId where present and treat isHalfDay as a separate flag on each day.
| Field | Type | Required | Notes |
|---|---|---|---|
| id | string | yes | Holiday ID; days of a multi-day holiday can share one ID |
| locationId | string | yes | ID of the location this holiday belongs to |
| name | string | yes | Holiday name |
| date | string (date) | yes | Date of this holiday day in YYYY-MM-DD format |
| isHalfDay | boolean | yes | Whether it is a half-day holiday |
| type | string | yes | custom or imported |
| recurring | boolean | yes | Whether the holiday repeats every year |
| multiDayId | string | no | Shared by every day of a multi-day holiday; omitted for single-day holidays |
| transferredFrom | string (date) | no | Original date when the holiday was moved from a non-working day |
Field definitions are taken from the supplied response schema. The sample payload in code0002 illustrates the shape but is not a live response.
Frequently asked questions
What happens if I omit the year parameter?
The endpoint uses the current UTC year. Supply year explicitly when you need a different calendar year.
How do I reconstruct a multi-day holiday from the response?
Group entries that share the same multiDayId. Each day is a separate record, so a two-day retreat produces two entries with the same multiDayId.
Why do I get a 403 error?
The key likely lacks the holidays:read scope. Add that scope to the key in the dashboard and retry. The error body lists the required scopes in details.requiredScopes.
Why does a valid location ID return 404?
The location may not exist or may be outside the data reach of the key. Check the ID and confirm the key owner can see that location.
curl -X GET "$API_BASE_URL/v2/locations/string/holidays" \
-H "Authorization: Bearer "{
"data": [
{
"id": "holiday-8e1f2a3b-4c5d-4e6f-9a7b-8c9d0e1f2a3b",
"locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
"name": "New Year's Day",
"date": "2026-01-01",
"isHalfDay": false,
"type": "imported",
"recurring": true
},
{
"id": "holiday-5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
"locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
"name": "Company retreat",
"date": "2026-06-18",
"isHalfDay": false,
"type": "custom",
"recurring": false,
"multiDayId": "multiDay-2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
},
{
"id": "holiday-5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
"locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
"name": "Company retreat",
"date": "2026-06-19",
"isHalfDay": false,
"type": "custom",
"recurring": false,
"multiDayId": "multiDay-2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"
},
{
"id": "holiday-4d2b7c1e-9a3f-4e5d-8c6b-1a2f3e4d5c6b",
"locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
"name": "Christmas Day",
"date": "2026-12-25",
"isHalfDay": false,
"type": "custom",
"recurring": true
}
]
}{
"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. |
year
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| year | integer | No | the year to list holidays for, defaults to the current UTC year. | 0 <= value |
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 |