Create a Business Hour

Prev Next
Post
/api/v1/livechat/business-hours.save

Use this endpoint to create a new Omnichannel business hour.

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example 1
{
  "name": "api-BH",
  "timezoneName": "Asia/Bangkok",
  "daysOpen": [
    "Monday",
    "Wednesday"
  ],
  "departmentsToApplyBusinessHour": "TEST-DEPT",
  "active": true,
  "type": "custom",
  "workHours": [
    {
      "day": "Monday",
      "start": "08:00:00",
      "finish": "16:00:00",
      "open": true
    },
    {
      "day": "Wednesday",
      "start": "08:00:00",
      "finish": "16:00:00",
      "open": true
    }
  ],
  "_id": "6953b3bc6ff48667974be88e"
}
Expand All
object
name
string Required

Enter a name for the business hour.

ExampleSupport Business Hour
timezoneName
string Required

Enter the timezone for the business hour. You can view the list of time zones from the Business Hours settings in the workspace.

ExampleAsia/Bangkok
daysOpen
Array of string Required

Enter the days of the week that the business hour will apply to.

string
Example["Monday", "Tuesday", "Wednesday"]
departmentsToApplyBusinessHour
string Required

Enter the department ID to which the business hour must be applied.

Example68304887113ac52640bc1ca6
active
boolean Required

Enter whether or not the business hour must be active as soon as it is created.

type
string Required

Enter the type of the business hour. It can be default or custom.

workHours
Array of object Required

Enter the work hours for each open day. Make sure to include the day you have added to the daysOpen parameter. Otherwise, it will not be included in the business hour.

object
day
string Required

Enter the day of the week.

ExampleMonday
start
string Required

Enter the start time of the business hour.

Example08:00:00
finish
string Required

Enter the end time of the business hour.

Example16:00:00
open
boolean Required

Enter whether or not this work hour is active. If you set this as false, the work hour will not be included in the business hour.

Defaulttrue
_id
string

Use this parameter to update an existing business hour.

Example668c72e86dfe572b40b90e30
Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "errorType": "invalid-params",
  "error": "must have required property 'name'"
}
object
success
boolean
errorType
string
error
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string