Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Update holiday year

Updates the validity period (validTill) of a custom holiday year configuration.

What this does: Changes how long a custom holiday configuration applies to future years. This is useful when you want to extend or limit the scope of your customizations.

How validTill works:

  • Set to a specific year (e.g., 2026): The configuration applies from the year’s start year through 2026

    • Future years within this range will be automatically created as “derived” configurations
    • Years beyond validTill will use default holidays
  • Set to null: The configuration applies indefinitely to all future years

    • All future years will automatically inherit this configuration as “derived” years
    • Useful for permanent company holidays that should always apply

Example scenarios:

  1. Temporary change: You add a special holiday for 2024-2025 only

    • Create year 2024 with validTill: 2025
    • Both 2024 and 2025 will use the custom configuration
    • 2026 and beyond will use defaults
  2. Permanent company holiday: You add “Company Foundation Day” that should always be a holiday

    • Create year 2024 with validTill: null
    • All future years will automatically include this holiday
  3. Extending validity: You previously set validTill: 2025 but want to extend to 2027

    • Update the year with validTill: 2027
    • Years 2026 and 2027 will now also use the custom configuration

Note: This endpoint only works on custom holiday years (those with an id). Default years cannot be updated - you must create a custom year first using POST /holidays/years.

PUT/holidays/years/{yearId}
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
yearIdstringrequired
Request body
requiredapplication/json
validTillobjectrequired
The last year this configuration applies to. If `null`, the configuration applies indefinitely to all future years. If set to a specific year (e.g., 2026), the configuration applies from the year's start year through that year. Future years within this range will automatically be created as "derived" configurations. Years beyond `validTill` will use default holidays.
Responses
200Holiday year updated successfully
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X PUT "https://leadtime.app/api/public/holidays/years/string" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "validTill": 2026
}'
Response
Holiday year updated successfully