Add permissions to an organization role (single or batch)
curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"eventType.read",
"booking.read"
]
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions"
payload = { "permissions": ["eventType.read", "booking.read"] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['eventType.read', 'booking.read']})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions', 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/organizations/{orgId}/roles/{roleId}/permissions",
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([
'permissions' => [
'eventType.read',
'booking.read'
]
]),
CURLOPT_HTTPHEADER => [
"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/organizations/{orgId}/roles/{roleId}/permissions"
payload := strings.NewReader("{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.com/v2/organizations/{orgId}/roles/{roleId}/permissions")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
"<string>"
]
}Permissions
Add permissions to an organization role (single or batch)
Required membership role: org admin. PBAC permission: role.update. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control
POST
/
v2
/
organizations
/
{orgId}
/
roles
/
{roleId}
/
permissions
Add permissions to an organization role (single or batch)
curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"eventType.read",
"booking.read"
]
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions"
payload = { "permissions": ["eventType.read", "booking.read"] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['eventType.read', 'booking.read']})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions', 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/organizations/{orgId}/roles/{roleId}/permissions",
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([
'permissions' => [
'eventType.read',
'booking.read'
]
]),
CURLOPT_HTTPHEADER => [
"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/organizations/{orgId}/roles/{roleId}/permissions"
payload := strings.NewReader("{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.com/v2/organizations/{orgId}/roles/{roleId}/permissions")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/roles/{roleId}/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n \"eventType.read\",\n \"booking.read\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
"<string>"
]
}Headers
For non-platform customers - value must be Bearer <token> where <token> is api key prefixed with cal_
For platform customers - OAuth client secret key
For platform customers - OAuth client ID
Body
application/json
Permissions to add (format: resource.action)
Available options:
*.*, role.create, role.read, role.readTeamRoles, role.readOrgRoles, role.update, role.delete, eventType.create, eventType.read, eventType.readTeamEventTypes, eventType.readOrgEventTypes, eventType.update, eventType.delete, team.create, team.read, team.readOrgTeams, team.readTeamSettings, team.readConferencing, team.readVerifiedResources, team.readMemberships, team.update, team.delete, team.invite, team.remove, team.listMembers, team.listMembersPrivate, team.changeMemberRole, team.impersonate, organization.create, organization.read, organization.readMemberships, organization.readManagedOrganizations, organization.readDelegationCredentials, organization.listMembers, organization.listMembersPrivate, organization.invite, organization.remove, organization.manageBilling, organization.changeMemberRole, organization.impersonate, organization.passwordReset, organization.editUsers, organization.update, organization.delete, booking.read, booking.readOrgBookings, booking.readRecordings, booking.update, booking.updateOrgBookings, booking.reassignOrgPastBookings, booking.readOrgAuditLogs, insights.read, workflow.create, workflow.read, workflow.readTeamWorkflows, workflow.update, workflow.delete, organization.attributes.read, organization.attributes.update, organization.attributes.delete, organization.attributes.create, organization.attributes.readSyncHistory, organization.attributes.editUsers, organization.attributes.readAuditLogs, routingForm.create, routingForm.read, routingForm.readTeamRoutingForms, routingForm.readOrgRoutingForms, routingForm.update, routingForm.delete, routingForm.readOrgAuditLogs, routingForm.readResponsePii, webhook.create, webhook.read, webhook.readOrgWebhooks, webhook.update, webhook.delete, availability.readTeamAvailability, availability.readOrgAvailability, availability.updateOrgAvailability, ooo.readOrgOoo, watchlist.create, watchlist.read, watchlist.update, watchlist.delete, featureOptIn.read, featureOptIn.update, organization.customDomain.create, organization.customDomain.read, organization.customDomain.update, organization.customDomain.delete, tag.create, tag.update, tag.delete Example:
["eventType.read", "booking.read"]
Was this page helpful?