curl --request PATCH \
--url https://api.cal.id/availability/{availabilityId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scheduleId": 42,
"days": [
1,
2,
3,
4,
5
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z"
}
'import requests
url = "https://api.cal.id/availability/{availabilityId}"
payload = {
"scheduleId": 42,
"days": [1, 2, 3, 4, 5],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scheduleId: 42,
days: [1, 2, 3, 4, 5],
startTime: '1970-01-01T09:00:00.000Z',
endTime: '1970-01-01T17:00:00.000Z'
})
};
fetch('https://api.cal.id/availability/{availabilityId}', 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.cal.id/availability/{availabilityId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'scheduleId' => 42,
'days' => [
1,
2,
3,
4,
5
],
'startTime' => '1970-01-01T09:00:00.000Z',
'endTime' => '1970-01-01T17:00:00.000Z'
]),
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.cal.id/availability/{availabilityId}"
payload := strings.NewReader("{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cal.id/availability/{availabilityId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.id/availability/{availabilityId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 7788,
"userId": null,
"eventTypeId": null,
"days": [
1,
2,
3,
4
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T16:00:00.000Z",
"date": null,
"scheduleId": 2214,
"targetTimeZones": [],
"Schedule": {
"userId": 4021
}
},
"message": "Availability updated"
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "Rate limit exceeded",
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests. Please retry after the rate limit window resets."
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Update an availability
Replaces an availability block. This is a full update rather than a patch — scheduleId, startTime, endTime and days are all required, so send the complete block even if only one value is changing. Times are interpreted against the parent schedule’s time zone, which means shifting hours here shifts them for every event type attached to that schedule.
curl --request PATCH \
--url https://api.cal.id/availability/{availabilityId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scheduleId": 42,
"days": [
1,
2,
3,
4,
5
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z"
}
'import requests
url = "https://api.cal.id/availability/{availabilityId}"
payload = {
"scheduleId": 42,
"days": [1, 2, 3, 4, 5],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scheduleId: 42,
days: [1, 2, 3, 4, 5],
startTime: '1970-01-01T09:00:00.000Z',
endTime: '1970-01-01T17:00:00.000Z'
})
};
fetch('https://api.cal.id/availability/{availabilityId}', 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.cal.id/availability/{availabilityId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'scheduleId' => 42,
'days' => [
1,
2,
3,
4,
5
],
'startTime' => '1970-01-01T09:00:00.000Z',
'endTime' => '1970-01-01T17:00:00.000Z'
]),
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.cal.id/availability/{availabilityId}"
payload := strings.NewReader("{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cal.id/availability/{availabilityId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.id/availability/{availabilityId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scheduleId\": 42,\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"startTime\": \"1970-01-01T09:00:00.000Z\",\n \"endTime\": \"1970-01-01T17:00:00.000Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 7788,
"userId": null,
"eventTypeId": null,
"days": [
1,
2,
3,
4
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T16:00:00.000Z",
"date": null,
"scheduleId": 2214,
"targetTimeZones": [],
"Schedule": {
"userId": 4021
}
},
"message": "Availability updated"
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "Rate limit exceeded",
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests. Please retry after the rate limit window resets."
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Use the Authorization header with Bearer scheme.
Examples:
- API Key: Authorization: Bearer calid_xxxxx
Path Parameters
Numeric availability identifier.
^[1-9]\d*$"101"
Body
Schedule identifier that owns this availability block.
x > 142
Availability start timestamp stored as time-of-day in UTC-compatible format.
1"1970-01-01T09:00:00.000Z"
Availability end timestamp stored as time-of-day in UTC-compatible format.
1"1970-01-01T17:00:00.000Z"
Weekday numbers for recurring availability (0 = Sunday, 6 = Saturday).
1[1, 2, 3, 4, 5]
Was this page helpful?