cURL
curl --request POST \
--url https://api.novacal.io/v1/availabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Working hours",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
}
}
'import requests
url = "https://api.novacal.io/v1/availabilities"
payload = {
"name": "Working hours",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
}
}
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({
name: 'Working hours',
timezone: 'Europe/Belgrade',
hours: {
monday: [{start: '09:00', end: '17:00'}],
tuesday: [{start: '09:00', end: '12:00'}, {start: '14:00', end: '17:00'}]
}
})
};
fetch('https://api.novacal.io/v1/availabilities', 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.novacal.io/v1/availabilities",
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([
'name' => 'Working hours',
'timezone' => 'Europe/Belgrade',
'hours' => [
'monday' => [
[
'start' => '09:00',
'end' => '17:00'
]
],
'tuesday' => [
[
'start' => '09:00',
'end' => '12:00'
],
[
'start' => '14:00',
'end' => '17:00'
]
]
]
]),
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.novacal.io/v1/availabilities"
payload := strings.NewReader("{\n \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\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.novacal.io/v1/availabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novacal.io/v1/availabilities")
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 \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 7,
"name": "Working hours",
"timezone": "Europe/Belgrade",
"is_default": true,
"working_days": [
"monday",
"tuesday"
],
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Availability Schedules
Create Availability
Create a Novacal availability schedule with its own timezone and open hours, then point event types at it.
POST
/
v1
/
availabilities
cURL
curl --request POST \
--url https://api.novacal.io/v1/availabilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Working hours",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
}
}
'import requests
url = "https://api.novacal.io/v1/availabilities"
payload = {
"name": "Working hours",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
}
}
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({
name: 'Working hours',
timezone: 'Europe/Belgrade',
hours: {
monday: [{start: '09:00', end: '17:00'}],
tuesday: [{start: '09:00', end: '12:00'}, {start: '14:00', end: '17:00'}]
}
})
};
fetch('https://api.novacal.io/v1/availabilities', 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.novacal.io/v1/availabilities",
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([
'name' => 'Working hours',
'timezone' => 'Europe/Belgrade',
'hours' => [
'monday' => [
[
'start' => '09:00',
'end' => '17:00'
]
],
'tuesday' => [
[
'start' => '09:00',
'end' => '12:00'
],
[
'start' => '14:00',
'end' => '17:00'
]
]
]
]),
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.novacal.io/v1/availabilities"
payload := strings.NewReader("{\n \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\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.novacal.io/v1/availabilities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novacal.io/v1/availabilities")
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 \"name\": \"Working hours\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"17:00\"\n }\n ],\n \"tuesday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n },\n {\n \"start\": \"14:00\",\n \"end\": \"17:00\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 7,
"name": "Working hours",
"timezone": "Europe/Belgrade",
"is_default": true,
"working_days": [
"monday",
"tuesday"
],
"hours": {
"monday": [
{
"start": "09:00",
"end": "17:00"
}
],
"tuesday": [
{
"start": "09:00",
"end": "12:00"
},
{
"start": "14:00",
"end": "17:00"
}
]
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}What you send
Onlyname is required.
{
"name": "Working hours",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [{ "start": "09:00", "end": "17:00" }],
"tuesday": [
{ "start": "09:00", "end": "12:00" },
{ "start": "14:00", "end": "17:00" }
]
}
}
- Times use the 24-hour
HH:MMformat, in the timezone of the schedule. - A weekday you leave out is closed. The example above is open on two days only.
- Two periods in one day make a break between them. They must not overlap, and
endmust be afterstart. - Without
timezone, the schedule takes your account timezone. - Without
hours, the schedule opens Monday to Friday, 09:00 to 17:00.
What happens next
The response contains the new schedule with its ID. Use that ID with Update Event Type to make an event type follow it. A new schedule is not your default one, so it changes nothing until an event type points at it. The one exception is the first schedule on an account, which becomes the default.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Availability schedule to create
The name of the schedule
Maximum string length:
255Example:
"Working hours"
IANA timezone the hours are expressed in. Defaults to your account timezone.
Example:
"Europe/Belgrade"
Open hours per weekday, in the schedule timezone. A weekday you leave out is closed. Defaults to monday to friday, 09:00 to 17:00.
Show child attributes
Show child attributes
Example:
{
"monday": [{ "start": "09:00", "end": "17:00" }],
"tuesday": [
{ "start": "09:00", "end": "12:00" },
{ "start": "14:00", "end": "17:00" }
]
}