curl --request PUT \
--url https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"useOwnHours": true,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": true
}
],
"holidaysClosed": true,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
}
}
'import requests
url = "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours"
payload = {
"useOwnHours": True,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": True
}
],
"holidaysClosed": True,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
useOwnHours: true,
openingHours: [
{day: 'monday', from: '08:00', to: '12:00'},
{day: 'monday', from: '13:00', to: '17:00'},
{day: 'friday', from: '08:00', to: '15:00'}
],
specialDates: [{date: '2026-11-23', closedAllDay: true}],
holidaysClosed: true,
closedAction: {type: 'redirect', phoneNumber: '+12025550172'}
})
};
fetch('https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'useOwnHours' => true,
'openingHours' => [
[
'day' => 'monday',
'from' => '08:00',
'to' => '12:00'
],
[
'day' => 'monday',
'from' => '13:00',
'to' => '17:00'
],
[
'day' => 'friday',
'from' => '08:00',
'to' => '15:00'
]
],
'specialDates' => [
[
'date' => '2026-11-23',
'closedAllDay' => true
]
],
'holidaysClosed' => true,
'closedAction' => [
'type' => 'redirect',
'phoneNumber' => '+12025550172'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours"
payload := strings.NewReader("{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}"
response = http.request(request)
puts response.read_body{
"numberId": "1201",
"timeZone": "Europe/Bratislava",
"useOwnHours": true,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": true
}
],
"holidaysClosed": true,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
},
"updatedAt": "2026-11-23T06:58:10Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "You are not authorized to access this resource."
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "CONFLICT",
"message": "Another change of these settings is in progress. Retry the request."
},
"requestId": "5e2a9c71d0"
}{
"error": {
"code": "VALIDATION.INVALID_BODY",
"message": "Request body is too large."
},
"requestId": "8c1f4a2e60"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "BUSINESS_HOURS.OVERLAPPING_HOURS",
"message": "Two opening intervals of the same day overlap.",
"target": "openingHours[1]"
},
"requestId": "c41f0a9e2b"
}<string>{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "TIMEOUT",
"message": "The request did not finish in time and may still complete. Read the resource before you retry; retry a create with the same Idempotency-Key."
},
"requestId": "5e2a9c71d0"
}Replace a number's business hours
Replaces a number’s own hours. Send useOwnHours: false alone to return the number to the company hours; its own hours are kept for later. With useOwnHours: true, send every field. It applies to the next call. The number’s other settings do not change.
Emergency redirect. To send every call of a number to one phone number today, set useOwnHours: true, add a special date for today with closedAllDay: true, and set a closedAction of type redirect. Business hours keep no versions: keep the previous object, and to switch back, send the object you kept as it is. The object a read returns for hours never saved (useOwnHours: false, closedAction: null and empty lists) is accepted too, as useOwnHours: false alone. 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. After an emergency redirect the stored hours are no longer the ones you kept, so a kept object with such a null is refused: set a value in it before you send it back. With useOwnHours: true a save always needs one.
curl --request PUT \
--url https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"useOwnHours": true,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": true
}
],
"holidaysClosed": true,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
}
}
'import requests
url = "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours"
payload = {
"useOwnHours": True,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": True
}
],
"holidaysClosed": True,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
useOwnHours: true,
openingHours: [
{day: 'monday', from: '08:00', to: '12:00'},
{day: 'monday', from: '13:00', to: '17:00'},
{day: 'friday', from: '08:00', to: '15:00'}
],
specialDates: [{date: '2026-11-23', closedAllDay: true}],
holidaysClosed: true,
closedAction: {type: 'redirect', phoneNumber: '+12025550172'}
})
};
fetch('https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'useOwnHours' => true,
'openingHours' => [
[
'day' => 'monday',
'from' => '08:00',
'to' => '12:00'
],
[
'day' => 'monday',
'from' => '13:00',
'to' => '17:00'
],
[
'day' => 'friday',
'from' => '08:00',
'to' => '15:00'
]
],
'specialDates' => [
[
'date' => '2026-11-23',
'closedAllDay' => true
]
],
'holidaysClosed' => true,
'closedAction' => [
'type' => 'redirect',
'phoneNumber' => '+12025550172'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours"
payload := strings.NewReader("{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/numbers/{numberId}/business-hours")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"useOwnHours\": true,\n \"openingHours\": [\n {\n \"day\": \"monday\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n },\n {\n \"day\": \"monday\",\n \"from\": \"13:00\",\n \"to\": \"17:00\"\n },\n {\n \"day\": \"friday\",\n \"from\": \"08:00\",\n \"to\": \"15:00\"\n }\n ],\n \"specialDates\": [\n {\n \"date\": \"2026-11-23\",\n \"closedAllDay\": true\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"redirect\",\n \"phoneNumber\": \"+12025550172\"\n }\n}"
response = http.request(request)
puts response.read_body{
"numberId": "1201",
"timeZone": "Europe/Bratislava",
"useOwnHours": true,
"openingHours": [
{
"day": "monday",
"from": "08:00",
"to": "12:00"
},
{
"day": "monday",
"from": "13:00",
"to": "17:00"
},
{
"day": "friday",
"from": "08:00",
"to": "15:00"
}
],
"specialDates": [
{
"date": "2026-11-23",
"closedAllDay": true
}
],
"holidaysClosed": true,
"closedAction": {
"type": "redirect",
"phoneNumber": "+12025550172"
},
"updatedAt": "2026-11-23T06:58:10Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"code": "UNAUTHORIZED",
"message": "You are not authorized to access this resource."
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "CONFLICT",
"message": "Another change of these settings is in progress. Retry the request."
},
"requestId": "5e2a9c71d0"
}{
"error": {
"code": "VALIDATION.INVALID_BODY",
"message": "Request body is too large."
},
"requestId": "8c1f4a2e60"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "BUSINESS_HOURS.OVERLAPPING_HOURS",
"message": "Two opening intervals of the same day overlap.",
"target": "openingHours[1]"
},
"requestId": "c41f0a9e2b"
}<string>{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"target": "<string>"
}
],
"target": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "TIMEOUT",
"message": "The request did not finish in time and may still complete. Read the resource before you retry; retry a create with the same Idempotency-Key."
},
"requestId": "5e2a9c71d0"
}Authorizations
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
The number id, as List and search numbers returns it.
"1201"
Body
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.
Closed on public holidays of the number's country. See List public holidays.
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.
- Closed action
- Closed action
- Closed action
- Closed action
- No value
Show child attributes
Show child attributes
Response
The number's business hours as saved.