Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

Update holiday day

Updates an existing holiday day in a custom holiday year configuration.

What this does: Modifies a holiday’s name, type, date, or rule. This allows you to customize holidays from the default set or modify holidays you’ve previously added.

Holiday types: You can update holidays to be either type:

  1. Fixed (type: "Fixed"):

    • A specific date that doesn’t change
    • Requires a date field in ISO 8601 format (e.g., “2024-12-25”)
    • Example: “Christmas Day” on December 25
  2. Rule (type: "Rule"):

    • A computed date based on a rule string
    • Requires a rule field (e.g., “25 december”, “easter monday”, “first monday in september”)
    • The date is automatically computed from the rule for each year
    • If converting from Fixed to Rule, you must provide a rule (or it will use the existing rule if available)

Important constraints:

  • You cannot convert a Fixed holiday to Rule without providing a rule
  • If the holiday already has a rule and you’re converting to Rule type, the existing rule will be preserved if you don’t provide one
  • The holiday must belong to a custom year (not a default year)
  • The yearId is automatically determined from the existing holiday

Use cases:

  • Renaming a holiday (e.g., “Christmas” → “Holiday Break”)
  • Changing a holiday date
  • Converting a fixed holiday to a rule-based one (e.g., “First Monday in September” for Labor Day)
  • Modifying rule-based holidays from the default set

Example - Converting Fixed to Rule:

{
  "name": "Labor Day",
  "type": "Rule",
  "rule": "first monday in september"
}
PUT/holidays/days/{dayId}
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
dayIdstringrequired
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
datestring
The specific date for fixed holidays in ISO 8601 format (e.g., "2024-12-25"). Required when `type` is "Fixed". The date should be in the format YYYY-MM-DD. The time portion is ignored.
namestringrequired
The name of the holiday. Can be changed to rename the holiday (e.g., "Christmas" → "Holiday Break").
rulestring
Rule string for rule-based holidays (only for Rule type). Examples: "25 december", "easter monday", "first monday in september". If not provided when switching to Rule type, the existing rule will be preserved (if available). If converting from Fixed to Rule without an existing rule, you must provide this field.
typestringrequired
The type of holiday: "Fixed" for specific dates, "Rule" for computed dates based on rules. You can convert between types, but converting from Fixed to Rule requires providing a `rule` field.
Allowed:FixedRule
Responses
200Holiday day updated 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 PUT "https://leadtime.app/api/public/holidays/days/string" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "date": "2024-12-25",
  "name": "Christmas Day",
  "rule": "25 december",
  "type": "Fixed"
}'
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"
}