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
yearIdmust belong to a custom holiday year (created viaPOST /holidays/years) - You cannot add holidays to default years - create a custom year first
- The
datemust be in ISO 8601 format (e.g., “2024-12-25”) - The
nameshould 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/daysAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredQuery 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/jsondatestringrequiredThe 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.
namestringrequiredThe name of the holiday. Should be descriptive and clear (e.g., "Company Outing", "Festivus", "Team Building Day").
typestringrequiredHoliday 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:
FixedyearIdstringrequiredThe 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
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 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"
}'const response = await fetch("https://leadtime.app/api/public/holidays/days", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-12-25",
"name": "Christmas Day",
"type": "Fixed",
"yearId": "550e8400-e29b-41d4-a716-446655440000"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/holidays/days",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"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"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions