Skip to main content
POST
/
office-hours
Create an office hours schedule
curl --request POST \
  --url https://api.open.cx/office-hours \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "iana_timezone": "<string>",
  "shifts": [
    {
      "day_of_week": "everyday",
      "start_time": "<string>",
      "end_time": "<string>"
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "iana_timezone": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "shifts": [
    {
      "day_of_week": "everyday",
      "start_time": "<string>",
      "end_time": "<string>",
      "id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Schedule name (e.g. "Business Hours", "Weekend Support")

iana_timezone
string
required

IANA timezone for the schedule (e.g. "America/New_York", "Europe/London", "Asia/Tokyo")

shifts
object[]
required

Time blocks when support is available. Use day ranges like "monday_to_friday" for convenience.

Response

Default Response

id
string
required

Office hours schedule ID

name
string
required

Schedule name (e.g. "Weekday Support", "Weekend Hours")

iana_timezone
string
required

IANA timezone (e.g. "America/New_York", "Europe/London")

created_at
string<date-time>
required
updated_at
string<date-time>
required
shifts
object[]
required

The time blocks when support is available