curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/webhooks \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"subscriberUrl": "<string>",
"triggers": [
"BOOKING_CREATED",
"BOOKING_RESCHEDULED",
"BOOKING_CANCELLED",
"BOOKING_CONFIRMED",
"BOOKING_REJECTED",
"BOOKING_COMPLETED",
"BOOKING_NO_SHOW",
"BOOKING_REOPENED"
],
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"secret": "<string>",
"version": "2021-10-20"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/webhooks"
payload = {
"active": True,
"subscriberUrl": "<string>",
"triggers": ["BOOKING_CREATED", "BOOKING_RESCHEDULED", "BOOKING_CANCELLED", "BOOKING_CONFIRMED", "BOOKING_REJECTED", "BOOKING_COMPLETED", "BOOKING_NO_SHOW", "BOOKING_REOPENED"],
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"secret": "<string>",
"version": "2021-10-20"
}
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({
active: true,
subscriberUrl: '<string>',
triggers: [
'BOOKING_CREATED',
'BOOKING_RESCHEDULED',
'BOOKING_CANCELLED',
'BOOKING_CONFIRMED',
'BOOKING_REJECTED',
'BOOKING_COMPLETED',
'BOOKING_NO_SHOW',
'BOOKING_REOPENED'
],
payloadTemplate: '{"content":"A new event has been scheduled","type":"{{type}}","name":"{{title}}","organizer":"{{organizer.name}}","booker":"{{attendees.0.name}}"}',
secret: '<string>',
version: '2021-10-20'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/webhooks', 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}/webhooks",
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([
'active' => true,
'subscriberUrl' => '<string>',
'triggers' => [
'BOOKING_CREATED',
'BOOKING_RESCHEDULED',
'BOOKING_CANCELLED',
'BOOKING_CONFIRMED',
'BOOKING_REJECTED',
'BOOKING_COMPLETED',
'BOOKING_NO_SHOW',
'BOOKING_REOPENED'
],
'payloadTemplate' => '{"content":"A new event has been scheduled","type":"{{type}}","name":"{{title}}","organizer":"{{organizer.name}}","booker":"{{attendees.0.name}}"}',
'secret' => '<string>',
'version' => '2021-10-20'
]),
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}/webhooks"
payload := strings.NewReader("{\n \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\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}/webhooks")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/webhooks")
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 \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"triggers": [],
"teamId": 123,
"id": 123,
"subscriberUrl": "<string>",
"active": true,
"secret": "<string>"
}
}Create a webhook
Required membership role: org admin. PBAC permission: webhook.create. 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_WEBHOOK_WRITE scope is required.
curl --request POST \
--url https://api.cal.com/v2/organizations/{orgId}/webhooks \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"subscriberUrl": "<string>",
"triggers": [
"BOOKING_CREATED",
"BOOKING_RESCHEDULED",
"BOOKING_CANCELLED",
"BOOKING_CONFIRMED",
"BOOKING_REJECTED",
"BOOKING_COMPLETED",
"BOOKING_NO_SHOW",
"BOOKING_REOPENED"
],
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"secret": "<string>",
"version": "2021-10-20"
}
'import requests
url = "https://api.cal.com/v2/organizations/{orgId}/webhooks"
payload = {
"active": True,
"subscriberUrl": "<string>",
"triggers": ["BOOKING_CREATED", "BOOKING_RESCHEDULED", "BOOKING_CANCELLED", "BOOKING_CONFIRMED", "BOOKING_REJECTED", "BOOKING_COMPLETED", "BOOKING_NO_SHOW", "BOOKING_REOPENED"],
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"secret": "<string>",
"version": "2021-10-20"
}
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({
active: true,
subscriberUrl: '<string>',
triggers: [
'BOOKING_CREATED',
'BOOKING_RESCHEDULED',
'BOOKING_CANCELLED',
'BOOKING_CONFIRMED',
'BOOKING_REJECTED',
'BOOKING_COMPLETED',
'BOOKING_NO_SHOW',
'BOOKING_REOPENED'
],
payloadTemplate: '{"content":"A new event has been scheduled","type":"{{type}}","name":"{{title}}","organizer":"{{organizer.name}}","booker":"{{attendees.0.name}}"}',
secret: '<string>',
version: '2021-10-20'
})
};
fetch('https://api.cal.com/v2/organizations/{orgId}/webhooks', 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}/webhooks",
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([
'active' => true,
'subscriberUrl' => '<string>',
'triggers' => [
'BOOKING_CREATED',
'BOOKING_RESCHEDULED',
'BOOKING_CANCELLED',
'BOOKING_CONFIRMED',
'BOOKING_REJECTED',
'BOOKING_COMPLETED',
'BOOKING_NO_SHOW',
'BOOKING_REOPENED'
],
'payloadTemplate' => '{"content":"A new event has been scheduled","type":"{{type}}","name":"{{title}}","organizer":"{{organizer.name}}","booker":"{{attendees.0.name}}"}',
'secret' => '<string>',
'version' => '2021-10-20'
]),
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}/webhooks"
payload := strings.NewReader("{\n \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\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}/webhooks")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/organizations/{orgId}/webhooks")
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 \"active\": true,\n \"subscriberUrl\": \"<string>\",\n \"triggers\": [\n \"BOOKING_CREATED\",\n \"BOOKING_RESCHEDULED\",\n \"BOOKING_CANCELLED\",\n \"BOOKING_CONFIRMED\",\n \"BOOKING_REJECTED\",\n \"BOOKING_COMPLETED\",\n \"BOOKING_NO_SHOW\",\n \"BOOKING_REOPENED\"\n ],\n \"payloadTemplate\": \"{\\\"content\\\":\\\"A new event has been scheduled\\\",\\\"type\\\":\\\"{{type}}\\\",\\\"name\\\":\\\"{{title}}\\\",\\\"organizer\\\":\\\"{{organizer.name}}\\\",\\\"booker\\\":\\\"{{attendees.0.name}}\\\"}\",\n \"secret\": \"<string>\",\n \"version\": \"2021-10-20\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"payloadTemplate": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}",
"triggers": [],
"teamId": 123,
"id": 123,
"subscriberUrl": "<string>",
"active": true,
"secret": "<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
Path Parameters
Body
BOOKING_CREATED, BOOKING_PAYMENT_INITIATED, BOOKING_PAID, BOOKING_RESCHEDULED, BOOKING_REQUESTED, BOOKING_CANCELLED, BOOKING_REJECTED, BOOKING_NO_SHOW_UPDATED, FORM_SUBMITTED, MEETING_ENDED, MEETING_STARTED, RECORDING_READY, INSTANT_MEETING, INSTANT_MEETING_ACCEPTED, RECORDING_TRANSCRIPTION_GENERATED, OOO_CREATED, AFTER_HOSTS_CAL_VIDEO_NO_SHOW, AFTER_GUESTS_CAL_VIDEO_NO_SHOW, FORM_SUBMITTED_NO_EVENT, ROUTING_FORM_FALLBACK_HIT, DELEGATION_CREDENTIAL_ERROR, WRONG_ASSIGNMENT_REPORT [
"BOOKING_CREATED",
"BOOKING_RESCHEDULED",
"BOOKING_CANCELLED",
"BOOKING_CONFIRMED",
"BOOKING_REJECTED",
"BOOKING_COMPLETED",
"BOOKING_NO_SHOW",
"BOOKING_REOPENED"
]The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information
"{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}"
The version of the webhook
2021-10-20 "2021-10-20"
Was this page helpful?