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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
holidayId | string | Yes | Holiday identifier |
Request Body
{
"name": "Updated Holiday Name",
"date": "2025-01-02T00:00:00.000Z",
"isRecurring": true,
"recurrenceRule": {
"frequency": "weekly",
"dayOfWeek": 5
}
}
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Holiday name (min: 1, max: 200 characters) |
date | string | No | Holiday date (ISO 8601 datetime format) |
isRecurring | boolean | No | Whether the holiday recurs |
recurrenceRule | object | No | Recurrence rule (required if isRecurring is true) |
recurrenceRule.frequency | string | No | Recurrence frequency (daily, weekly, monthly, yearly) |
recurrenceRule.dayOfWeek | number | No | Day 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
isRecurringis set totrue, a validrecurrenceRulemust be provided - If
isRecurringis set tofalse,recurrenceRulewill be set tonull