curl --request PATCH \
--url https://api.cal.com/v2/slots/reservations/{uid} \
--header 'Content-Type: application/json' \
--header 'cal-api-version: <cal-api-version>' \
--data '
{
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotDuration": 30,
"reservationDuration": 5
}
'import requests
url = "https://api.cal.com/v2/slots/reservations/{uid}"
payload = {
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotDuration": 30,
"reservationDuration": 5
}
headers = {
"cal-api-version": "<cal-api-version>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'cal-api-version': '<cal-api-version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventTypeId: 1,
slotStart: '2024-09-04T09:00:00Z',
slotDuration: 30,
reservationDuration: 5
})
};
fetch('https://api.cal.com/v2/slots/reservations/{uid}', 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.com/v2/slots/reservations/{uid}",
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([
'eventTypeId' => 1,
'slotStart' => '2024-09-04T09:00:00Z',
'slotDuration' => 30,
'reservationDuration' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cal-api-version: <cal-api-version>"
],
]);
$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.com/v2/slots/reservations/{uid}"
payload := strings.NewReader("{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cal-api-version", "<cal-api-version>")
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.com/v2/slots/reservations/{uid}")
.header("cal-api-version", "<cal-api-version>")
.header("Content-Type", "application/json")
.body("{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/slots/reservations/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cal-api-version"] = '<cal-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotEnd": "2024-09-04T10:00:00Z",
"slotDuration": 30,
"reservationUid": "e84be5a3-4696-49e3-acc7-b2f3999c3b94",
"reservationDuration": 5,
"reservationUntil": "2023-09-04T10:00:00Z"
}
}Update a reserved slot
If you specify a custom reservation duration, you must authenticate using oAuth credentials, api key or access token.
curl --request PATCH \
--url https://api.cal.com/v2/slots/reservations/{uid} \
--header 'Content-Type: application/json' \
--header 'cal-api-version: <cal-api-version>' \
--data '
{
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotDuration": 30,
"reservationDuration": 5
}
'import requests
url = "https://api.cal.com/v2/slots/reservations/{uid}"
payload = {
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotDuration": 30,
"reservationDuration": 5
}
headers = {
"cal-api-version": "<cal-api-version>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'cal-api-version': '<cal-api-version>', 'Content-Type': 'application/json'},
body: JSON.stringify({
eventTypeId: 1,
slotStart: '2024-09-04T09:00:00Z',
slotDuration: 30,
reservationDuration: 5
})
};
fetch('https://api.cal.com/v2/slots/reservations/{uid}', 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.com/v2/slots/reservations/{uid}",
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([
'eventTypeId' => 1,
'slotStart' => '2024-09-04T09:00:00Z',
'slotDuration' => 30,
'reservationDuration' => 5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"cal-api-version: <cal-api-version>"
],
]);
$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.com/v2/slots/reservations/{uid}"
payload := strings.NewReader("{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cal-api-version", "<cal-api-version>")
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.com/v2/slots/reservations/{uid}")
.header("cal-api-version", "<cal-api-version>")
.header("Content-Type", "application/json")
.body("{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/slots/reservations/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cal-api-version"] = '<cal-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventTypeId\": 1,\n \"slotStart\": \"2024-09-04T09:00:00Z\",\n \"slotDuration\": 30,\n \"reservationDuration\": 5\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"eventTypeId": 1,
"slotStart": "2024-09-04T09:00:00Z",
"slotEnd": "2024-09-04T10:00:00Z",
"slotDuration": 30,
"reservationUid": "e84be5a3-4696-49e3-acc7-b2f3999c3b94",
"reservationDuration": 5,
"reservationUntil": "2023-09-04T10:00:00Z"
}
}Headers
Must be set to 2024-09-04. If not set to this value, the endpoint will default to an older version.
"2024-09-04"
value must be Bearer <token> where <token> is api key prefixed with cal_, managed user access token, or OAuth access token
For platform customers - OAuth client ID
Path Parameters
Body
The ID of the event type for which slot should be reserved.
1
ISO 8601 datestring in UTC timezone representing available slot.
"2024-09-04T09:00:00Z"
By default slot duration is equal to event type length, but if you want to reserve a slot for an event type that has a variable length you can specify it here as a number in minutes. If you don't have this set explicitly that event type can have one of many lengths you can omit this.
30
ONLY for authenticated requests with api key, access token or OAuth credentials (ID + secret).
For how many minutes the slot should be reserved - for this long time noone else can book this event type at `start` time. If not provided, defaults to 5 minutes.
5
Was this page helpful?