cURL
curl --request PUT \
--url https://api.novacal.io/v1/availabilities/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Mornings only",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "12:00"
}
]
}
}
'import requests
url = "https://api.novacal.io/v1/availabilities/{id}"
payload = {
"name": "Mornings only",
"timezone": "Europe/Belgrade",
"hours": { "monday": [
{
"start": "09:00",
"end": "12:00"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Mornings only',
timezone: 'Europe/Belgrade',
hours: {monday: [{start: '09:00', end: '12:00'}]}
})
};
fetch('https://api.novacal.io/v1/availabilities/{id}', 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/{id}",
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([
'name' => 'Mornings only',
'timezone' => 'Europe/Belgrade',
'hours' => [
'monday' => [
[
'start' => '09:00',
'end' => '12: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/{id}"
payload := strings.NewReader("{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.novacal.io/v1/availabilities/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novacal.io/v1/availabilities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12: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
Update Availability
Change the name, timezone, or open hours of a Novacal availability schedule.
PUT
/
v1
/
availabilities
/
{id}
cURL
curl --request PUT \
--url https://api.novacal.io/v1/availabilities/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Mornings only",
"timezone": "Europe/Belgrade",
"hours": {
"monday": [
{
"start": "09:00",
"end": "12:00"
}
]
}
}
'import requests
url = "https://api.novacal.io/v1/availabilities/{id}"
payload = {
"name": "Mornings only",
"timezone": "Europe/Belgrade",
"hours": { "monday": [
{
"start": "09:00",
"end": "12:00"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Mornings only',
timezone: 'Europe/Belgrade',
hours: {monday: [{start: '09:00', end: '12:00'}]}
})
};
fetch('https://api.novacal.io/v1/availabilities/{id}', 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/{id}",
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([
'name' => 'Mornings only',
'timezone' => 'Europe/Belgrade',
'hours' => [
'monday' => [
[
'start' => '09:00',
'end' => '12: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/{id}"
payload := strings.NewReader("{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.novacal.io/v1/availabilities/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12:00\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novacal.io/v1/availabilities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Mornings only\",\n \"timezone\": \"Europe/Belgrade\",\n \"hours\": {\n \"monday\": [\n {\n \"start\": \"09:00\",\n \"end\": \"12: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"
}
}Partial updates
Send only the fields you change. A field you leave out keeps its value.{ "name": "Mornings only" }
The hours replace the whole week
hours is one value, not a list you add to. The week you send becomes the week that is stored, and every weekday you leave out becomes closed.
{
"hours": {
"monday": [{ "start": "09:00", "end": "12:00" }]
}
}
working_days follows the days that have hours, so you never send it.
Two effects to know
- A new timezone moves the real times. The hours stay as written, so
09:00becomes09:00in the new timezone. A person in the old timezone sees a different hour. - Booked events do not move. A schedule only decides which times are free from now on.
Access
You can only change schedules on your own account. Another account’s schedule returns403 access_denied.Authorizations
Body
application/json
Availability fields to update. Partial updates are supported.
Fields to update. Send only the fields you want to change. Fields you omit keep their current value.