curl --request PATCH \
--url https://api.cal.com/v2/contacts/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jamie R.",
"note": "Prefers a scissor cut on top, short back and sides.\nWants a #2 fade."
}
'import requests
url = "https://api.cal.com/v2/contacts/{id}"
payload = {
"name": "Jamie R.",
"note": "Prefers a scissor cut on top, short back and sides.
Wants a #2 fade."
}
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({
name: 'Jamie R.',
note: 'Prefers a scissor cut on top, short back and sides.\nWants a #2 fade.'
})
};
fetch('https://api.cal.com/v2/contacts/{id}', 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/contacts/{id}",
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([
'name' => 'Jamie R.',
'note' => 'Prefers a scissor cut on top, short back and sides.
Wants a #2 fade.'
]),
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/contacts/{id}"
payload := strings.NewReader("{\n \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\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/contacts/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/contacts/{id}")
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 \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "0192f3a1-7c2b-7d4e-9a10-000000000001",
"name": "Jamie R."
}
}Update a personal contact
Updates one of the authenticated user’s personal contacts, changing only the fields given in the body; a body with no fields changes nothing and returns the contact as it is. note replaces the user’s private note on the contact, sanitized and limited as on the Contacts page, and an empty note clears it; read it with GET /v2/contacts/{id}/note. A contact on Cal (type: calUser) shows the name from their Cal account and can’t have its name changed, but it can have a note; a body with both is refused whole and stores neither. A contact the user does not have is not found. If accessed using an OAuth access token, the CONTACT_WRITE scope is required.
curl --request PATCH \
--url https://api.cal.com/v2/contacts/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jamie R.",
"note": "Prefers a scissor cut on top, short back and sides.\nWants a #2 fade."
}
'import requests
url = "https://api.cal.com/v2/contacts/{id}"
payload = {
"name": "Jamie R.",
"note": "Prefers a scissor cut on top, short back and sides.
Wants a #2 fade."
}
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({
name: 'Jamie R.',
note: 'Prefers a scissor cut on top, short back and sides.\nWants a #2 fade.'
})
};
fetch('https://api.cal.com/v2/contacts/{id}', 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/contacts/{id}",
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([
'name' => 'Jamie R.',
'note' => 'Prefers a scissor cut on top, short back and sides.
Wants a #2 fade.'
]),
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/contacts/{id}"
payload := strings.NewReader("{\n \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\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/contacts/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/contacts/{id}")
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 \"name\": \"Jamie R.\",\n \"note\": \"Prefers a scissor cut on top, short back and sides.\\nWants a #2 fade.\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "0192f3a1-7c2b-7d4e-9a10-000000000001",
"name": "Jamie R."
}
}Headers
Path Parameters
Body
The user's private note on the contact, which replaces the stored note. To add to it, read it with GET /v2/contacts/{id}/note and send the whole new note. An empty string or null clears it. It is trimmed, and scripts and event handlers are removed, as on the Contacts page. Any contact can have a note, including one on Cal.
2000"Prefers a scissor cut on top, short back and sides.\nWants a #2 fade."
Was this page helpful?