Add a Holiday
Add and configure a holiday.
Request URL
POST {base_url}/{api_path}/holidays/create?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| timezone_id | No | Integer | The ID of the associated time zone. Note: You can query time zone ID using the Query Time Zone List list.
|
| name | Yes | String | The name of the holiday. |
| type | Yes | String | The recurrence type of the holiday. Valid value:
|
| month | No | String | The month of the holiday. Note: Required when
type is week or
weekday.Valid value:
|
| how_week | No | Integer | The week of the month for the holiday. Note: Required when
type is week or
weekday.Valid value:
|
| weekday | No | String | The day of the week for the holiday. Note: Required when
type is week or
weekday.Valid value:
|
| date | No | String | The date or date range of the holiday. Note:
|
| time_period | No | String | The time period of the holiday, in the format HH:MM-HH:MM. Note: Required when
type is week or
weekday. |
| prompt | No | String | The name of the custom prompt file to use for the holiday. Note: You can query available custom prompts using the Search Custom Prompts interface. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| id | Integer | The ID of the created holiday. |
Example
Request example
POST /openapi/v1.0/holidays/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
"name": "Christmas",
"type": "date",
"date": "2026/12/25-2026/12/25"
}
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"submsg": "",
"id": 1
}