Update a membership
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId} \
--header 'Content-Type: application/json' \
--data '
{
"accepted": true,
"disableImpersonation": true
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}"
payload = {
"accepted": True,
"disableImpersonation": 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({accepted: true, disableImpersonation: true})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}', 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}/memberships/{membershipId}",
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([
'accepted' => true,
'disableImpersonation' => 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}/memberships/{membershipId}"
payload := strings.NewReader("{\n \"accepted\": true,\n \"disableImpersonation\": 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}/memberships/{membershipId}")
.header("Content-Type", "application/json")
.body("{\n \"accepted\": true,\n \"disableImpersonation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}")
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 \"accepted\": true,\n \"disableImpersonation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"userId": 123,
"teamId": 123,
"accepted": true,
"user": {
"email": "<string>",
"avatarUrl": "<string>",
"username": "<string>",
"name": "<string>",
"bio": "<string>",
"metadata": {
"key": "value"
}
},
"attributes": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"option": "<string>",
"optionId": "<string>"
}
],
"disableImpersonation": true
}
}Memberships
Update a membership
Required membership role: org admin. PBAC permission: organization.changeMemberRole. Learn more about API access control at https://cal.com/docs/api-reference/v2/access-control. If accessed using an OAuth access token, the ORG_MEMBERSHIP_WRITE scope is required.
PATCH
/
v2
/
organizations
/
{orgId}
/
memberships
/
{membershipId}
Update a membership
curl --request PATCH \
--url https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId} \
--header 'Content-Type: application/json' \
--data '
{
"accepted": true,
"disableImpersonation": true
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}"
payload = {
"accepted": True,
"disableImpersonation": 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({accepted: true, disableImpersonation: true})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}', 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}/memberships/{membershipId}",
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([
'accepted' => true,
'disableImpersonation' => 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}/memberships/{membershipId}"
payload := strings.NewReader("{\n \"accepted\": true,\n \"disableImpersonation\": 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}/memberships/{membershipId}")
.header("Content-Type", "application/json")
.body("{\n \"accepted\": true,\n \"disableImpersonation\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/memberships/{membershipId}")
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 \"accepted\": true,\n \"disableImpersonation\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": 123,
"userId": 123,
"teamId": 123,
"accepted": true,
"user": {
"email": "<string>",
"avatarUrl": "<string>",
"username": "<string>",
"name": "<string>",
"bio": "<string>",
"metadata": {
"key": "value"
}
},
"attributes": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"option": "<string>",
"optionId": "<string>"
}
],
"disableImpersonation": true
}
}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
Was this page helpful?
⌘I