curl --request POST \
--url https://api.cal.id/availability/ \
--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/"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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/', 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/",
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([
'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/"
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("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.cal.id/availability/")
.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/")
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 \"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,
5
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z",
"date": null,
"scheduleId": 2214,
"targetTimeZones": [],
"Schedule": {
"userId": 4021
}
},
"message": "Availability created"
}{
"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>"
}
}Create an availability
Adds an availability block to one of the user’s schedules. Supply the parent scheduleId, a startTime/endTime pair and days as an array of weekday numbers (0 = Sunday through 6 = Saturday). The stored block is returned with its generated id. Blocks are additive — creating one that overlaps an existing block widens the bookable window rather than replacing it.
curl --request POST \
--url https://api.cal.id/availability/ \
--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/"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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/', 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/",
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([
'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/"
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("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.cal.id/availability/")
.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/")
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 \"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,
5
],
"startTime": "1970-01-01T09:00:00.000Z",
"endTime": "1970-01-01T17:00:00.000Z",
"date": null,
"scheduleId": 2214,
"targetTimeZones": [],
"Schedule": {
"userId": 4021
}
},
"message": "Availability created"
}{
"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
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?