Skip to main content
PUT
Replace a number's business hours

Authorizations

Authorization
string
header
required

HTTP Basic Authentication. Use your API Access Key ID as the username and your API Access Key Secret as the password. Generate keys in the CloudTalk Dashboard under Account -> Settings -> API Keys (https://dashboard.cloudtalk.io/menu/account/settings/API-keys).

Path Parameters

numberId
string
required

The number id, as List and search numbers returns it.

Example:

"1201"

Body

application/json

With useOwnHours: true, send every field but the read-only ones. With useOwnHours: false, send every field to store new hours for later, or useOwnHours alone to keep the stored ones.

useOwnHours
boolean
required

true: these hours decide when the number is open, and the company hours are ignored for it. false: the number follows the company hours, and these hours are kept for later.

openingHours
object[]

When it is open. Several intervals per day are allowed; they must not overlap. Up to 100 intervals.

Maximum array length: 100
specialDates
object[]

Up to 1,000 dates.

Maximum array length: 1000
holidaysClosed
boolean

Closed on public holidays of the number's country. See List public holidays.

closedAction
Closed action · object

What callers get when closed. null is accepted only in the object a read returns for hours never saved (useOwnHours: false and empty lists), sent back as it is; with opening hours or special dates it is 422 VALIDATION.INVALID_FIELD, target closedAction. With useOwnHours: false, a closed action a read shows with soundId, voicemailBoxId or phoneNumber null is accepted too, when openingHours, specialDates, holidaysClosed and closedAction are what a read returns now (in any order): useOwnHours is not compared, the number returns to the company hours, also when it used its own, and the stored closed action is kept. timeZone and updatedAt are ignored, as in every save. With useOwnHours: true, or with other settings, the null is 422 VALIDATION.INVALID_FIELD.

Response

The number's business hours as saved.

numberId
string
required
read-only

The number. Read-only.

Example:

"1201"

useOwnHours
boolean
required

true: these hours decide when the number is open, and the company hours are ignored for it. false: the number follows the company hours, and these hours are kept for later.

timeZone
string
required
read-only

IANA time zone in which all times are read: the account time zone. Read-only.

Example:

"Europe/Bratislava"

openingHours
object[]
required

When it is open. Several intervals per day are allowed; they must not overlap.

specialDates
object[]
required
holidaysClosed
boolean
required

Closed on public holidays of the number's country. See List public holidays.

closedAction
Closed action · object
required

What callers get when closed. null while the hours were never saved. A save that sends the hours needs one.

updatedAt
string<date-time> | null
required
read-only

Last change. Read-only. null while the hours were never saved, or when the stored date is missing or not valid.