Update an availability
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": 123,
"days": [
123
],
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"targetTimeZones": [
"<string>"
],
"Schedule": {
"userId": 123
},
"userId": 123,
"eventTypeId": 123,
"date": "2023-11-07T05:31:56Z",
"scheduleId": 123
},
"message": "<string>",
"meta": {
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}
}{
"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": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Availability
Update an availability
Update an availability
PATCH
/
availability
/
{availabilityId}
Update an availability
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": 123,
"days": [
123
],
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"targetTimeZones": [
"<string>"
],
"Schedule": {
"userId": 123
},
"userId": 123,
"eventTypeId": 123,
"date": "2023-11-07T05:31:56Z",
"scheduleId": 123
},
"message": "<string>",
"meta": {
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}
}{
"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": "<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.
Pattern:
^[1-9]\d*$Example:
"101"
Body
application/json
Schedule identifier that owns this availability block.
Required range:
x > 1Example:
42
Availability start timestamp stored as time-of-day in UTC-compatible format.
Minimum string length:
1Example:
"1970-01-01T09:00:00.000Z"
Availability end timestamp stored as time-of-day in UTC-compatible format.
Minimum string length:
1Example:
"1970-01-01T17:00:00.000Z"
Weekday numbers for recurring availability (0 = Sunday, 6 = Saturday).
Minimum array length:
1Example:
[1, 2, 3, 4, 5]
Related topics
Update a scheduleManage availability schedulesUpdate your profileCreate Availability in Cal IDUpdate an event typeWas this page helpful?
⌘I