Set a host's limit for a pool
curl --request PATCH \
--url https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"hostLimit": {
"perDay": 2,
"perWeek": 5,
"perMonth": 2,
"perYear": 2
}
}
'import requests
url = "https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}"
payload = { "hostLimit": {
"perDay": 2,
"perWeek": 5,
"perMonth": 2,
"perYear": 2
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostLimit: {perDay: 2, perWeek: 5, perMonth: 2, perYear: 2}})
};
fetch('https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}', 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/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}",
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([
'hostLimit' => [
'perDay' => 2,
'perWeek' => 5,
'perMonth' => 2,
'perYear' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}"
payload := strings.NewReader("{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hostLimit": {
"perDay": 4,
"perWeek": 20,
"perMonth": 60,
"perYear": 500
},
"effectiveLimit": {
"perDay": 4,
"perWeek": 20,
"perMonth": 60,
"perYear": 500
}
}
}Booking Limit Pools
Set a host's limit for a pool
Sets the host’s own limit for the intervals sent; null returns that interval to the pool’s limit. Only intervals the pool limits can be set, and each is capped at the host’s overall booking limit. If accessed using an OAuth access token, the TEAM_EVENT_TYPE_WRITE scope is required.
PATCH
/
v2
/
teams
/
{teamId}
/
booking-limit-pools
/
{poolId}
/
hosts
/
{userId}
Set a host's limit for a pool
curl --request PATCH \
--url https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"hostLimit": {
"perDay": 2,
"perWeek": 5,
"perMonth": 2,
"perYear": 2
}
}
'import requests
url = "https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}"
payload = { "hostLimit": {
"perDay": 2,
"perWeek": 5,
"perMonth": 2,
"perYear": 2
} }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({hostLimit: {perDay: 2, perWeek: 5, perMonth: 2, perYear: 2}})
};
fetch('https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}', 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/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}",
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([
'hostLimit' => [
'perDay' => 2,
'perWeek' => 5,
'perMonth' => 2,
'perYear' => 2
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}"
payload := strings.NewReader("{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/teams/{teamId}/booking-limit-pools/{poolId}/hosts/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostLimit\": {\n \"perDay\": 2,\n \"perWeek\": 5,\n \"perMonth\": 2,\n \"perYear\": 2\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"hostLimit": {
"perDay": 4,
"perWeek": 20,
"perMonth": 60,
"perYear": 500
},
"effectiveLimit": {
"perDay": 4,
"perWeek": 20,
"perMonth": 60,
"perYear": 500
}
}
}Headers
value must be Bearer <token> where <token> is api key prefixed with cal_, managed user access token, or OAuth access token
Path Parameters
Pool UUID; short UUID form is accepted too.
User UUID; short UUID form is accepted too.
Body
application/json
The intervals to change; an omitted interval is left alone and null returns it to the pool's limit.
Show child attributes
Show child attributes
Was this page helpful?