Skip to content

Get a holiday

This endpoint returns one holiday record belonging to a specific location, for any year. You supply the location ID and the holiday ID in the path, and the API responds with the holiday's fields. When a multi-day holiday shares a single holidayId across several days, the endpoint returns the earliest day of that span.

Request at a glance

Method: GET. Path: /v2/locations/{id}/holidays/{holidayId}. Both path parameters are required strings: id identifies the location, holidayId identifies the holiday. The request must carry an Authorization header with a bearer token. The key needs the holidays:read scope. The key owner's role can further limit what the key can reach.

Authorization and scope

Send the API key as Authorization: Bearer <token>, using the vt_live_ prefix on the secret. The holidays:read scope is required. Key creation, available scopes, and role-based limits are covered in the Authentication and Scopes documentation for this API.

Path parameters

id (string, required): the location resource ID. holidayId (string, required): the holiday ID. Both appear in the URL path, not the query string.

Response shape and field map

A successful call returns a JSON object with a data property holding the holiday. The following fields are always present: id, locationId, name, date (YYYY-MM-DD), isHalfDay (boolean), type (custom or imported), and recurring (boolean). Two fields are conditional. multiDayId is a string shared by every day of a multi-day holiday and is omitted for single-day holidays. transferredFrom is a date string present only when the holiday originally fell on a non-working day and was moved to this date. Imported holidays can only be renamed or made non-recurring.

Multi-day holidays and the earliest-day rule

A multi-day holiday can give the same holidayId to each of its days. When you request that ID, the endpoint returns the earliest day in the span. If you need every day of the span, list the location's holidays and filter by multiDayId rather than calling this endpoint once per day.

The 404 case and how to read it

A 404 RESOURCE_NOT_FOUND response can mean one of three things: the location does not exist, the location is outside the data reach of the key, or the location has no holiday with the supplied holidayId. Before assuming the holiday is missing, confirm the location ID is visible to the key owner and that the holiday ID was copied from the same location's holiday list. The error envelope includes a requestId to quote when contacting support.

Worked example

The sample response shows a recurring custom holiday named Christmas Day on 2026-12-25, flagged as not a half day, with type custom and recurring true. Because it is a single-day holiday, no multiDayId appears. A consumer reading this payload can rely on date, isHalfDay, and recurring to decide whether the day counts as a full working-day exception for the location.

Reader checklist before you call

  1. Confirm the key has holidays:read. 2. Confirm the key owner can see the target location. 3. Confirm holidayId came from that location's holiday list, not another location. 4. Expect the earliest day when the ID is shared across a multi-day span. 5. Capture the requestId from any error envelope for support follow-up.

Frequently asked questions

What scope does this endpoint require?

The holidays:read scope. The key is sent as Authorization: Bearer <token>.

Which day is returned for a multi-day holiday?

The earliest day of the span. Every day of a multi-day holiday can share one holidayId, and this endpoint collapses that to the first day.

Why did I get a 404 RESOURCE_NOT_FOUND?

Three causes are possible: the location does not exist, the location is outside the key's data reach, or the location has no holiday with that holidayId. Check the location ID and holiday ID against the same location's holiday list.

When is multiDayId present?

Only on days that belong to a multi-day holiday. Single-day holidays omit the field.

What does transferredFrom mean?

It holds the original date when a holiday fell on a non-working day and was moved to the returned date.

What is the difference between custom and imported holidays?

custom means the holiday was created in the product or through the API. imported means it came from the holiday library, and imported holidays can only be renamed or made non-recurring.

curl -X GET "$API_BASE_URL/v2/locations/string/holidays/string" \
  -H "Authorization: Bearer "
{
  "data": {
    "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": "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

FieldTypeRequiredDescriptionConstraints
idstringYesresource ID.

holidayId

FieldTypeRequiredDescriptionConstraints
holidayIdstringYesholiday ID.

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo