Edit a Holiday

Update a holiday's configuration.

Request URL

POST {base_url}/{api_path}/holidays/update?access_token={access_token}

Request parameters

Parameter Required Type Description
id Yes Integer The unique ID of a holiday.
Note: You can query holiday ID using the Search Holidays interface.
name No String The name of the holiday.
type No 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.

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.

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.

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: 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.
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.

Example

Request example

POST /openapi/v1.0/holidays/update?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
  "id": 1,
  "name": "Christmas"
}

Response example

HTTP/1.1 200 OK
{
  "errcode": 0,
  "errmsg": "SUCCESS",
  "submsg": ""
}