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:

  • date: By Date (E.g. January 1, 2025)
  • month: By Month (E.g. January 1st Every Year)
  • week: By Week (E.g. the Monday of the 1st Week of the Month Every Year)
  • weekday: By Weekday (E.g. the 1st Monday of the Month Every Year)
month No String The month of the holiday.
Note: Required when type is week or weekday.

Valid value:

  • jan: January.
  • feb: February.
  • mar: March.
  • apr: April.
  • may: May.
  • jun: June.
  • jul: July.
  • aug: August.
  • sep: September.
  • oct: October.
  • nov: November.
  • dec: December.
how_week No Integer The week of the month for the holiday.
Note: Required when type is week or weekday.

Valid value:

  • 1: The first week.
  • 2: The second week.
  • 3: The third week.
  • 4: The fourth week.
  • 5: The last week.
weekday No String The day of the week for the holiday.
Note: Required when type is week or weekday.

Valid value:

  • sun: Sunday.
  • mon: Monday.
  • tue: Tuesday.
  • wed: Wednesday.
  • thu: Thursday.
  • fri: Friday.
  • sat: Saturday.
date No String The date or date range of the holiday.
Note:
  • Required when type is date or month.
  • The date must follow the system date format. You can query the system date format using the Query PBX Information interface.
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.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
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
}