curl --request PUT \
--url https://api.cloudtalk.io/v1/business-hours \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": 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-12-24",
"closedAllDay": true
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": true,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
}
}
'import requests
url = "https://api.cloudtalk.io/v1/business-hours"
payload = {
"enabled": 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-12-24",
"closedAllDay": True
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": True,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
}
}
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({
enabled: 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-12-24', closedAllDay: true},
{date: '2026-12-31', from: '08:00', to: '12:00'}
],
holidaysClosed: true,
closedAction: {type: 'soundThenVoicemail', soundId: '79', voicemailBoxId: '88'}
})
};
fetch('https://api.cloudtalk.io/v1/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/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([
'enabled' => 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-12-24',
'closedAllDay' => true
],
[
'date' => '2026-12-31',
'from' => '08:00',
'to' => '12:00'
]
],
'holidaysClosed' => true,
'closedAction' => [
'type' => 'soundThenVoicemail',
'soundId' => '79',
'voicemailBoxId' => '88'
]
]),
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/business-hours"
payload := strings.NewReader("{\n \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\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/business-hours")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/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 \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"timeZone": "Europe/Bratislava",
"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-12-24",
"closedAllDay": true
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": true,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
},
"updatedAt": "2026-11-02T08:15:00Z"
}{
"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": "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 company business hours
Replaces the company business hours. Every field except the read-only ones is required. The object a read returns is accepted back as it is, the one for hours never saved (enabled: false and closedAction: null) included. With enabled: 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): enabled is not compared, the hours switch off, also when they were on, and the stored closed action is kept. timeZone and updatedAt are ignored, as in every save. With enabled: true, or with other settings, the null is 422 VALIDATION.INVALID_FIELD. It applies to the next call. Business hours run before the call flow: when closed, callers get the closed action instead of the flow. Business hours keep no versions: keep the previous object if you may want to switch back.
curl --request PUT \
--url https://api.cloudtalk.io/v1/business-hours \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": 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-12-24",
"closedAllDay": true
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": true,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
}
}
'import requests
url = "https://api.cloudtalk.io/v1/business-hours"
payload = {
"enabled": 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-12-24",
"closedAllDay": True
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": True,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
}
}
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({
enabled: 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-12-24', closedAllDay: true},
{date: '2026-12-31', from: '08:00', to: '12:00'}
],
holidaysClosed: true,
closedAction: {type: 'soundThenVoicemail', soundId: '79', voicemailBoxId: '88'}
})
};
fetch('https://api.cloudtalk.io/v1/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/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([
'enabled' => 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-12-24',
'closedAllDay' => true
],
[
'date' => '2026-12-31',
'from' => '08:00',
'to' => '12:00'
]
],
'holidaysClosed' => true,
'closedAction' => [
'type' => 'soundThenVoicemail',
'soundId' => '79',
'voicemailBoxId' => '88'
]
]),
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/business-hours"
payload := strings.NewReader("{\n \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\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/business-hours")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloudtalk.io/v1/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 \"enabled\": 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-12-24\",\n \"closedAllDay\": true\n },\n {\n \"date\": \"2026-12-31\",\n \"from\": \"08:00\",\n \"to\": \"12:00\"\n }\n ],\n \"holidaysClosed\": true,\n \"closedAction\": {\n \"type\": \"soundThenVoicemail\",\n \"soundId\": \"79\",\n \"voicemailBoxId\": \"88\"\n }\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"timeZone": "Europe/Bratislava",
"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-12-24",
"closedAllDay": true
},
{
"date": "2026-12-31",
"from": "08:00",
"to": "12:00"
}
],
"holidaysClosed": true,
"closedAction": {
"type": "soundThenVoicemail",
"soundId": "79",
"voicemailBoxId": "88"
},
"updatedAt": "2026-11-02T08:15:00Z"
}{
"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": "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).
Body
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 (enabled: false), sent back as it is. With enabled: 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): enabled is not compared, the hours switch off, also when they were on, and the stored closed action is kept. timeZone and updatedAt are ignored, as in every save. With enabled: 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 business hours as saved.