Update delegation credentials of your organization
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId} \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"serviceAccountKey": [
{
"private_key": "<string>",
"client_email": "<string>",
"client_id": "<string>"
}
],
"optOutAutoSecretRotation": true
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}"
payload = {
"enabled": True,
"serviceAccountKey": [
{
"private_key": "<string>",
"client_email": "<string>",
"client_id": "<string>"
}
],
"optOutAutoSecretRotation": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
serviceAccountKey: [{private_key: '<string>', client_email: '<string>', client_id: '<string>'}],
optOutAutoSecretRotation: true
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}', 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}/delegation-credentials/{credentialId}",
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([
'enabled' => true,
'serviceAccountKey' => [
[
'private_key' => '<string>',
'client_email' => '<string>',
'client_id' => '<string>'
]
],
'optOutAutoSecretRotation' => true
]),
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}/delegation-credentials/{credentialId}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "clsx1234567890",
"enabled": true,
"domain": "example.com",
"organizationId": 123,
"workspacePlatform": {
"name": "Google",
"slug": "google"
},
"createdAt": "2024-04-01T00:00:00.000Z",
"updatedAt": "2024-04-01T00:00:00.000Z"
}
}Delegation Credentials
Update delegation credentials of your organization
Required membership role: org admin. PBAC permission: organization.update. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control
PATCH
/
v2
/
organizations
/
{orgId}
/
delegation-credentials
/
{credentialId}
Update delegation credentials of your organization
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId} \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"serviceAccountKey": [
{
"private_key": "<string>",
"client_email": "<string>",
"client_id": "<string>"
}
],
"optOutAutoSecretRotation": true
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}"
payload = {
"enabled": True,
"serviceAccountKey": [
{
"private_key": "<string>",
"client_email": "<string>",
"client_id": "<string>"
}
],
"optOutAutoSecretRotation": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
serviceAccountKey: [{private_key: '<string>', client_email: '<string>', client_id: '<string>'}],
optOutAutoSecretRotation: true
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}', 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}/delegation-credentials/{credentialId}",
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([
'enabled' => true,
'serviceAccountKey' => [
[
'private_key' => '<string>',
'client_email' => '<string>',
'client_id' => '<string>'
]
],
'optOutAutoSecretRotation' => true
]),
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}/delegation-credentials/{credentialId}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/delegation-credentials/{credentialId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"serviceAccountKey\": [\n {\n \"private_key\": \"<string>\",\n \"client_email\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"optOutAutoSecretRotation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "clsx1234567890",
"enabled": true,
"domain": "example.com",
"organizationId": 123,
"workspacePlatform": {
"name": "Google",
"slug": "google"
},
"createdAt": "2024-04-01T00:00:00.000Z",
"updatedAt": "2024-04-01T00:00:00.000Z"
}
}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
- Option 1
- Option 2
Show child attributes
Show child attributes
When true, Cal.com will not mint or promote managed Microsoft 365 client secrets for this delegation credential. Use this when the credential owner wants to rotate the active secret outside Cal.com. Only supported for Microsoft/office365 delegation credentials; attempting to set this on a Google delegation credential returns a 400 error.
Was this page helpful?
⌘I