curl --request PUT \
--url https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": true,
"opens_at": "<string>",
"closes_at": "<string>"
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/"
payload = {
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": True,
"opens_at": "<string>",
"closes_at": "<string>"
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
date: '2023-12-25',
name: '<string>',
repeats_yearly: true,
opens_at: '<string>',
closes_at: '<string>'
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/', 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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/",
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([
'date' => '2023-12-25',
'name' => '<string>',
'repeats_yearly' => true,
'opens_at' => '<string>',
'closes_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <api-key>"
],
]);
$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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Initdesk-Token", "<api-key>")
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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": true,
"opens_at": "<string>",
"closes_at": "<string>"
}Replace business hours exception
Date exceptions. Members read. Owners, admins, and tokens write.
curl --request PUT \
--url https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/ \
--header 'Content-Type: application/json' \
--header 'X-Initdesk-Token: <api-key>' \
--data '
{
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": true,
"opens_at": "<string>",
"closes_at": "<string>"
}
'import requests
url = "https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/"
payload = {
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": True,
"opens_at": "<string>",
"closes_at": "<string>"
}
headers = {
"X-Initdesk-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Initdesk-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
date: '2023-12-25',
name: '<string>',
repeats_yearly: true,
opens_at: '<string>',
closes_at: '<string>'
})
};
fetch('https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/', 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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/",
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([
'date' => '2023-12-25',
'name' => '<string>',
'repeats_yearly' => true,
'opens_at' => '<string>',
'closes_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Initdesk-Token: <api-key>"
],
]);
$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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/"
payload := strings.NewReader("{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Initdesk-Token", "<api-key>")
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.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/")
.header("X-Initdesk-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.initdesk.com/organizations/{organization_id}/business-hours/exceptions/{pk}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Initdesk-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"date\": \"2023-12-25\",\n \"name\": \"<string>\",\n \"repeats_yearly\": true,\n \"opens_at\": \"<string>\",\n \"closes_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"date": "2023-12-25",
"name": "<string>",
"repeats_yearly": true,
"opens_at": "<string>",
"closes_at": "<string>"
}Authorizations
Path Parameters
A unique integer value identifying this Business hours exception.
^[-a-zA-Z0-9_]+$Body
One date that replaces that weekday. Both times null means closed.
Set both opens_at and closes_at for one custom range, or leave both null. Times may be HH:MM or HH:MM:SS. A close earlier than the open continues overnight. This is not the weekly_hours object.
Calendar date, YYYY-MM-DD.
Label for this date. May be empty.
64Repeat this month and day every year. February 29 repeats on leap years.
24-hour time as HH:MM or HH:MM:SS. Null together with closes_at means the date is closed.
24-hour time as HH:MM or HH:MM:SS. Earlier than opens_at continues overnight. Null together with opens_at means the date is closed.
Response
One date that replaces that weekday. Both times null means closed.
Set both opens_at and closes_at for one custom range, or leave both null. Times may be HH:MM or HH:MM:SS. A close earlier than the open continues overnight. This is not the weekly_hours object.
Calendar date, YYYY-MM-DD.
Label for this date. May be empty.
64Repeat this month and day every year. February 29 repeats on leap years.
24-hour time as HH:MM or HH:MM:SS. Null together with closes_at means the date is closed.
24-hour time as HH:MM or HH:MM:SS. Earlier than opens_at continues overnight. Null together with opens_at means the date is closed.
Was this page helpful?

