Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

Add holiday day

Adds a new holiday day to a custom holiday year configuration.

What this does: Creates a new holiday in a custom holiday year. This allows you to add company-specific holidays that don’t exist in the default holiday data (e.g., “Company Outing”, “Festivus”, “Team Building Day”).

Holiday types: Only Fixed holidays can be created via this endpoint:

  • Fixed: A specific date that doesn’t change (e.g., “2024-12-25” for Christmas)
  • Rule-based: Holidays computed from rules (e.g., “25 december”, “easter monday”) come from default definitions
    • Rule-based holidays can only be edited, not created
    • They exist in default holiday configurations and can be modified in custom years

Requirements:

  • The yearId must belong to a custom holiday year (created via POST /holidays/years)
  • You cannot add holidays to default years - create a custom year first
  • The date must be in ISO 8601 format (e.g., “2024-12-25”)
  • The name should be descriptive (e.g., “Company Foundation Day”)

Use cases:

  • Adding company-specific holidays
  • Adding regional holidays not in the default data
  • Creating special event days that should be treated as holidays

Example: To add “Company Outing” on June 15, 2024:

{
  "yearId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Company Outing",
  "type": "Fixed",
  "date": "2024-06-15"
}
POST/holidays/days
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
datestringrequired
The specific date for the holiday in ISO 8601 format (e.g., "2024-12-25" or "2024-06-15"). The date should be in the format YYYY-MM-DD. The time portion is ignored.
namestringrequired
The name of the holiday. Should be descriptive and clear (e.g., "Company Outing", "Festivus", "Team Building Day").
typestringrequired
Holiday type. Only "Fixed" is allowed when creating new holidays. Rule-based holidays can only be edited, not created, as they come from default holiday definitions.
Allowed:Fixed
yearIdstringrequired
The UUID of the custom holiday year this holiday belongs to. Must be a custom year (created via `POST /holidays/years`). You cannot add holidays to default years.
Responses
201Holiday day created successfully
datestring
The date of the holiday in ISO 8601 format. Present for Fixed holidays. For Rule-based holidays, this is the computed date based on the rule for the year.
idstringrequired
Unique identifier for the holiday day.
namestringrequired
The name of the holiday.
rulestring
Rule string for rule-based holidays. Only present when `type` is "Rule". The date is automatically computed from this rule for each year.
typestringrequired
The type of holiday: "Fixed" for specific dates, "Rule" for computed dates based on rules.
Allowed:FixedRule
yearIdstringrequired
The UUID of the holiday year this holiday belongs to.
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/holidays/days" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "date": "2024-12-25",
  "name": "Christmas Day",
  "type": "Fixed",
  "yearId": "550e8400-e29b-41d4-a716-446655440000"
}'
Response
{
  "date": "2024-12-25T00:00:00.000Z",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Christmas Day",
  "rule": "25 december",
  "type": "Fixed",
  "yearId": "550e8400-e29b-41d4-a716-446655440000"
}