---
title: "Add a holiday"
method: POST
path: "/locations/{locationId}/holidays"
tags: ["AfterHours"]
---

# Add a holiday

`POST /locations/{locationId}/holidays`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/locations/{locationId}/holidays`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/locations/:locationId/holidays/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds a holiday to the specified location. 
            <br />Send this request [GET /locations/{locationId}/holidays](/swagger/ui/index?version=3#/AfterHours/GETv3_locations__locationId__holidays) to get the location holidays.
            <br />Learn [how to manage holidays for a location](https://servicechannel.atlassian.net/wiki/spaces/SCU/pages/683409418/Managing+Business+Hours+and+Holidays+for+a+Location) in ServiceChannel University.
            <br />**Example Request**
            
                POST /locations/{locationId}/holidays
                {
                 "HolidayName": "Happy Weekend",
                 "OpenTime": "10:00 AM",
                 "CloseTime": "06:00 PM",
                 "ClosedAllDay": false,
                 "Frequency": "Yearly",
                 "StartDate": "2021-07-03T00:10:00.308Z",
                 "RepeatEvery": "1",
                 "RepeatBy": "DayOfWeek",
                 "RepeatOnDays": [
                   "Saturday", "Sunday"
                 ],
                 "RepeatOnMonths": [
                   “June”, "July", "August"
                 ]
                }

## Path parameters

- `locationId` integer, required

## Request body

- ServiceChannelServicesMessagingAfterHoursAddHolidayApiModelRequest: Object request to add a holiday to a location.
  - `HolidayName` string: Holiday name.
  - `OpenTime` string: Location opening hours.
  - `CloseTime` string: Location closing hours.
  - `ClosedAllDay` boolean: Defines whether the location is closed on the specified day.
  - `Frequency` 'Weekly' | 'Monthly' | 'Yearly' | 'Singular': Defines how often the holiday occurs. Valid values: Singular, Weekly, Monthly, Yearly.
  - `StartDate` string, date-time: Holiday date.
  - `RepeatEvery` string, byte: Defines intervals for the holiday to repeat. Valid values: a number from 1 to 60. Used in combination with the `Frequency` values: Yearly, Monthly, Weekly.
  - `RepeatBy` 'DayOfWeek' | 'DayOfMonth': Defines whether the holiday repeats on days of the month or week. Valid values: DaysOfWeek, DaysOfMonth
  - `RepeatOnDays` string[]: Days when the holiday occurs. Used in combination with the `Frequency` value ‘Weekly’.
  - `RepeatOnMonths` string[]: Months when the holiday occurs. Used in combination with the `Frequency` value ‘Yearly’.

## Response `200`

The holiday is added to the specified location.

- ServiceChannelServicesMessagingAfterHoursHolidayIdsApiResponse
  - `HolidayIds` integer[]

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: <br/> 616 — Duplicate 'Day of the Week' value <br/> 619 — Incorrect format of the `Repeat by status` value. Valid values: DayOfWeek, DayOfMonth. <br/> 620 — List of days cannot be empty when submitting the `Weekly` frequency <br/> 621 — List of months cannot be empty when submitting the `Yearly` frequency <br/> 622 — Incorrect month format. Valid values: January, February, March, April, May, June, July, August, September, October, November, December. <br/> 623 — The `Holiday Name` value cannot be empty. The maximum length is 100 characters. <br/> 624 — Incorrect format of the 'Repeat every' value. The value should be a number between 1 and 60. <br/> 625 — The same month is specified twice in the 'Month' value <br/> 626 — Incorrect format of the frequency. Valid values: Weekly, Monthly, Yearly, Singular. <br/> 627 — Start date cannot be an empty value <br/> 628 — Incorrect format of the `Close All Day` value. Valid values: true, false. <br/> 3502 — The holiday name is already in use. Please suggest another name.
- `401`: The request is not authorized. <br/>Error codes: <br/> 504 — API call rejected by security permissions;
- `404`: The requested resource does not exist on the server. <br/>Error codes: <br/> 601 — Location is not found
- `500`: The server was unable to complete the request due to an internal error. <br/>Error codes: <br/>501 — Object reference not set to an instance of an object;

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
