Skip to main content

Update Holiday (v1)

Method & Path

PATCH /api/v1/workspace/:workspaceId/holidays/:holidayId

Description

Update an existing holiday. All fields are optional - only provided fields will be updated.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace settings management permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
holidayIdstringYesHoliday identifier

Request Body

{
"name": "Updated Holiday Name",
"date": "2025-01-02T00:00:00.000Z",
"isRecurring": true,
"recurrenceRule": {
"frequency": "weekly",
"dayOfWeek": 5
}
}

Request Body Schema

FieldTypeRequiredDescription
namestringNoHoliday name (min: 1, max: 200 characters)
datestringNoHoliday date (ISO 8601 datetime format)
isRecurringbooleanNoWhether the holiday recurs
recurrenceRuleobjectNoRecurrence rule (required if isRecurring is true)
recurrenceRule.frequencystringNoRecurrence frequency (daily, weekly, monthly, yearly)
recurrenceRule.dayOfWeeknumberNoDay of week (0-6, Sunday-Saturday) for weekly recurrence

Response 200 OK

{
"holiday": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"name": "Updated Holiday Name",
"date": "2025-01-02T00:00:00.000Z",
"isRecurring": true,
"recurrenceRule": {
"frequency": "weekly",
"dayOfWeek": 5
},
"createdAt": "2024-12-01T10:00:00.000Z",
"updatedAt": "2024-12-01T11:00:00.000Z"
}
}

Common Errors

400 Bad Request: Invalid request body (e.g., invalid date format, invalid recurrence rule)

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have permission to update holidays

404 Not Found: Workspace or holiday not found

422 Unprocessable Entity: Validation error (e.g., invalid recurrence rule configuration)

500 Internal Server Error: Server error occurred while processing the request

Notes

  • At least one field must be provided in the request body
  • If isRecurring is set to true, a valid recurrenceRule must be provided
  • If isRecurring is set to false, recurrenceRule will be set to null