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:
-
Fixed (
type: "Fixed"):- A specific date that doesn’t change
- Requires a
datefield in ISO 8601 format (e.g., “2024-12-25”) - Example: “Christmas Day” on December 25
-
Rule (
type: "Rule"):- A computed date based on a rule string
- Requires a
rulefield (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
yearIdis 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 · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
dayIdstringrequiredQuery parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced 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:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsondatestringThe 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.
namestringrequiredThe name of the holiday. Can be changed to rename the holiday (e.g., "Christmas" → "Holiday Break").
rulestringRule 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.
typestringrequiredThe 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:
FixedRuleResponses
200Holiday day updated successfully
datestringThe 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.
idstringrequiredUnique identifier for the holiday day.
namestringrequiredThe name of the holiday.
rulestringRule string for rule-based holidays. Only present when `type` is "Rule". The date is automatically computed from this rule for each year.
typestringrequiredThe type of holiday: "Fixed" for specific dates, "Rule" for computed dates based on rules.
Allowed:
FixedRuleyearIdstringrequiredThe 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"
}'const response = await fetch("https://leadtime.app/api/public/holidays/days/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-12-25",
"name": "Christmas Day",
"rule": "25 december",
"type": "Fixed"
})
});import requests
response = requests.put(
"https://leadtime.app/api/public/holidays/days/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"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"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions