Skip to content

Set the business-hours schedule for a number

PUT
/voice/inbound-routing/business-hours

Create or REPLACE the open-hours / after-hours rule pair.

A PUT because it is a replace: calling it twice leaves two rules, not four. It writes into the same rule list /voice/inbound-routing/rules manages, so a hand-made rule at a lower priority still wins over it.

timezone is an IANA name and voice rejects anything it cannot load, so a schedule cannot silently run in UTC.

Authorizations

Parameters

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

Create or REPLACE the business-hours / after-hours pair for a number.

This is a two-rule bulk setup, not an addition: calling it again replaces both rules rather than adding more.

object
after_hours_target
required

Where a call goes in one half of the schedule.

object
target_id
Any of:
string
target_type
required
string
Allowed values: ai_agent department extension voicemail
business_hours
required

The open hours themselves.

object
days
required
Array<string>
>= 1 items
Allowed values: mon tue wed thu fri sat sun
end_time
required

24h HH:MM.

string
/^\d{2}:\d{2}$/
start_time
required

24h HH:MM.

string
/^\d{2}:\d{2}$/
business_hours_target
required

Where a call goes in one half of the schedule.

object
target_id
Any of:
string
target_type
required
string
Allowed values: ai_agent department extension voicemail
phone_number
required
string
>= 1 characters
timezone
required

IANA name (e.g. America/New_York). Voice rejects anything pytz cannot load.

string
>= 1 characters

Responses

200

Successful Response

object
data
required

One voice object - a collection, an agent, a route, a chat.

Open-shaped: voice adds fields to these bodies on its own release cadence and a dropped-or-added key must not be a 500 in this service.

object
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
notes
Any of:
Array<string>
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer
total_available
Any of:
integer
total_is_lower_bound
Any of:
boolean

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string