Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

Create custom holiday year

Creates a custom holiday year configuration for the workspace, allowing you to customize holidays for a specific year and country/region.

What this does: Creates a workspace-specific holiday configuration by copying the default holidays for the specified year and country. Once created, you can add, modify, or delete holidays using the holiday days endpoints.

Important behavior:

  • If a custom year already exists for the specified year/country, it will be deleted and recreated
  • This effectively resets the year to default holidays
  • All existing custom holidays for that year will be lost
  • Use this endpoint to start customizing a year or to reset it back to defaults

Validity period (validTill): The validTill field controls how the custom configuration propagates to future years:

  • If validTill is set (e.g., 2026), the configuration applies to all years from the specified year through validTill
  • If validTill is null, the configuration applies indefinitely to future years
  • Future years will automatically be created as “derived” configurations
  • You can update validTill later using PUT /holidays/years/:yearId

Use cases:

  • Adding company-specific holidays (e.g., “Company Outing”, “Festivus”)
  • Removing holidays that don’t apply to your organization
  • Modifying holiday dates for your specific needs
  • Resetting a customized year back to defaults

Next steps: After creating a custom year, use:

  • POST /holidays/days to add new holidays
  • PUT /holidays/days/:dayId to modify existing holidays
  • DELETE /holidays/days/:dayId to remove holidays
POST/holidays/years
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Request body
requiredapplication/json
countrystringrequired
Country or region code (e.g., "US", "DE", "US-CA"). Must be one of the available codes from `GET /holidays/countries`.
validTillobject
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 specified year through that year. Future years within this range will automatically be created as "derived" configurations. You can update this later using `PUT /holidays/years/:yearId`.
yearnumberrequired
The year to create a custom holiday configuration for. Must be 1900 or later. If a custom year already exists for this year/country combination, it will be deleted and recreated with default holidays.
Responses
201Custom holiday year created successfully
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/holidays/years" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "country": "US",
  "validTill": 2026,
  "year": 2024
}'
Response
Custom holiday year created successfully