Create Holiday
curl --request POST \
--url https://api.voxo.co/v2/admin/holidays/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": 123,
"businessHoursId": 123,
"name": "<string>",
"isRecurring": true,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"isClosed": true,
"month": 1,
"day": 1,
"dayOfWeek": 0,
"weekOfMonth": 1,
"operatingHours": {},
"mediaFileId": 1,
"notifyDaysBefore": 1
}
'import requests
url = "https://api.voxo.co/v2/admin/holidays/"
payload = {
"tenantId": 123,
"businessHoursId": 123,
"name": "<string>",
"isRecurring": True,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"isClosed": True,
"month": 1,
"day": 1,
"dayOfWeek": 0,
"weekOfMonth": 1,
"operatingHours": {},
"mediaFileId": 1,
"notifyDaysBefore": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: 123,
businessHoursId: 123,
name: '<string>',
isRecurring: true,
startDate: '2023-12-25',
endDate: '2023-12-25',
isClosed: true,
month: 1,
day: 1,
dayOfWeek: 0,
weekOfMonth: 1,
operatingHours: {},
mediaFileId: 1,
notifyDaysBefore: 1
})
};
fetch('https://api.voxo.co/v2/admin/holidays/', 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.voxo.co/v2/admin/holidays/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenantId' => 123,
'businessHoursId' => 123,
'name' => '<string>',
'isRecurring' => true,
'startDate' => '2023-12-25',
'endDate' => '2023-12-25',
'isClosed' => true,
'month' => 1,
'day' => 1,
'dayOfWeek' => 0,
'weekOfMonth' => 1,
'operatingHours' => [
],
'mediaFileId' => 1,
'notifyDaysBefore' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.voxo.co/v2/admin/holidays/"
payload := strings.NewReader("{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.voxo.co/v2/admin/holidays/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxo.co/v2/admin/holidays/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"tenantId": 123,
"name": "<string>",
"isRecurring": true,
"startDate": "<string>",
"endDate": "<string>",
"isClosed": true,
"month": 123,
"day": 123,
"dayOfWeek": 123,
"weekOfMonth": 123,
"operatingHours": "<unknown>",
"notifyDaysBefore": 123,
"businessHours": {
"id": 123,
"name": "<string>"
},
"mediaFile": {
"id": 123,
"name": "<string>"
}
}Holidays
Create Holiday
Create a holiday (recurring or fixed-date) for a business hour
POST
/
v2
/
admin
/
holidays
/
Create Holiday
curl --request POST \
--url https://api.voxo.co/v2/admin/holidays/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": 123,
"businessHoursId": 123,
"name": "<string>",
"isRecurring": true,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"isClosed": true,
"month": 1,
"day": 1,
"dayOfWeek": 0,
"weekOfMonth": 1,
"operatingHours": {},
"mediaFileId": 1,
"notifyDaysBefore": 1
}
'import requests
url = "https://api.voxo.co/v2/admin/holidays/"
payload = {
"tenantId": 123,
"businessHoursId": 123,
"name": "<string>",
"isRecurring": True,
"startDate": "2023-12-25",
"endDate": "2023-12-25",
"isClosed": True,
"month": 1,
"day": 1,
"dayOfWeek": 0,
"weekOfMonth": 1,
"operatingHours": {},
"mediaFileId": 1,
"notifyDaysBefore": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: 123,
businessHoursId: 123,
name: '<string>',
isRecurring: true,
startDate: '2023-12-25',
endDate: '2023-12-25',
isClosed: true,
month: 1,
day: 1,
dayOfWeek: 0,
weekOfMonth: 1,
operatingHours: {},
mediaFileId: 1,
notifyDaysBefore: 1
})
};
fetch('https://api.voxo.co/v2/admin/holidays/', 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.voxo.co/v2/admin/holidays/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenantId' => 123,
'businessHoursId' => 123,
'name' => '<string>',
'isRecurring' => true,
'startDate' => '2023-12-25',
'endDate' => '2023-12-25',
'isClosed' => true,
'month' => 1,
'day' => 1,
'dayOfWeek' => 0,
'weekOfMonth' => 1,
'operatingHours' => [
],
'mediaFileId' => 1,
'notifyDaysBefore' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.voxo.co/v2/admin/holidays/"
payload := strings.NewReader("{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.voxo.co/v2/admin/holidays/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voxo.co/v2/admin/holidays/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": 123,\n \"businessHoursId\": 123,\n \"name\": \"<string>\",\n \"isRecurring\": true,\n \"startDate\": \"2023-12-25\",\n \"endDate\": \"2023-12-25\",\n \"isClosed\": true,\n \"month\": 1,\n \"day\": 1,\n \"dayOfWeek\": 0,\n \"weekOfMonth\": 1,\n \"operatingHours\": {},\n \"mediaFileId\": 1,\n \"notifyDaysBefore\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"tenantId": 123,
"name": "<string>",
"isRecurring": true,
"startDate": "<string>",
"endDate": "<string>",
"isClosed": true,
"month": 123,
"day": 123,
"dayOfWeek": 123,
"weekOfMonth": 123,
"operatingHours": "<unknown>",
"notifyDaysBefore": 123,
"businessHours": {
"id": 123,
"name": "<string>"
},
"mediaFile": {
"id": 123,
"name": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Minimum string length:
3Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$month
Option 1 · enum<number>Option 2 · enum<number>Option 3 · enum<number>Option 4 · enum<number>Option 5 · enum<number>Option 6 · enum<number>Option 7 · enum<number>Option 8 · enum<number>Option 9 · enum<number>Option 10 · enum<number>Option 11 · enum<number>Option 12 · enum<number>
required
Available options:
1 day
Option 1 · enum<number>Option 2 · enum<number>Option 3 · enum<number>Option 4 · enum<number>Option 5 · enum<number>Option 6 · enum<number>Option 7 · enum<number>Option 8 · enum<number>Option 9 · enum<number>Option 10 · enum<number>Option 11 · enum<number>Option 12 · enum<number>Option 13 · enum<number>Option 14 · enum<number>Option 15 · enum<number>Option 16 · enum<number>Option 17 · enum<number>Option 18 · enum<number>Option 19 · enum<number>Option 20 · enum<number>Option 21 · enum<number>Option 22 · enum<number>Option 23 · enum<number>Option 24 · enum<number>Option 25 · enum<number>Option 26 · enum<number>Option 27 · enum<number>Option 28 · enum<number>Option 29 · enum<number>Option 30 · enum<number>Option 31 · enum<number>
required
Available options:
1 dayOfWeek
Option 1 · enum<number>Option 2 · enum<number>Option 3 · enum<number>Option 4 · enum<number>Option 5 · enum<number>Option 6 · enum<number>Option 7 · enum<number>
required
Available options:
0 weekOfMonth
Option 1 · enum<number>Option 2 · enum<number>Option 3 · enum<number>Option 4 · enum<number>Option 5 · enum<number>
required
Available options:
1 Show child attributes
Show child attributes
Required range:
x > 0Required range:
x >= 0Response
200 - application/json
Created holiday
Holiday ID
Tenant ID
Holiday name
Whether the holiday recurs
Start date (non-recurring)
End date (non-recurring)
Whether closed for the whole day
Recurrence month (1-12)
Recurrence day (1-31)
Recurrence day of week (0-6)
Recurrence week of month (1-5)
Operating hours or null
Notify days before
Associated business hours profile
Show child attributes
Show child attributes
Associated media file
Show child attributes
Show child attributes
Was this page helpful?