curl --request POST \
--url https://api.cal.com/v2/events/{uuid}/messages \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"body": "<string>",
"scheduledAt": "2030-01-01T09:00:00Z",
"locationId": "<string>",
"checkedIn": true,
"contactTagId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.cal.com/v2/events/{uuid}/messages"
payload = {
"subject": "<string>",
"body": "<string>",
"scheduledAt": "2030-01-01T09:00:00Z",
"locationId": "<string>",
"checkedIn": True,
"contactTagId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
body: JSON.stringify('<string>'),
scheduledAt: '2030-01-01T09:00:00Z',
locationId: '<string>',
checkedIn: true,
contactTagId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.cal.com/v2/events/{uuid}/messages', 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/events/{uuid}/messages",
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([
'subject' => '<string>',
'body' => '<string>',
'scheduledAt' => '2030-01-01T09:00:00Z',
'locationId' => '<string>',
'checkedIn' => true,
'contactTagId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/events/{uuid}/messages"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cal.com/v2/events/{uuid}/messages")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/events/{uuid}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "<string>",
"status": "QUEUED",
"recipientCount": 123,
"textRecipientCount": 123,
"skippedPhoneCount": 123,
"scheduledAt": "2023-11-07T05:31:56Z"
}
}Message an Event's guests
Emails one segment of the Event’s guests, optionally narrowed to one location, to guests who did or did not check in, or to guests among your contacts with one of your contact tags. Guests who have only a phone number are texted instead when texting is available; textRecipientCount says how many. The message is queued and sent in the background, or at scheduledAt when you give one; list the Event’s messages to follow its status. The authenticated user must be the Event’s owner, one of its hosts, or a member of the owning team. Co-hosts cannot message guests. PBAC permission for team events: calEvent.update. If accessed using an OAuth access token, the EVENT_WRITE scope is required.
curl --request POST \
--url https://api.cal.com/v2/events/{uuid}/messages \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"body": "<string>",
"scheduledAt": "2030-01-01T09:00:00Z",
"locationId": "<string>",
"checkedIn": true,
"contactTagId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.cal.com/v2/events/{uuid}/messages"
payload = {
"subject": "<string>",
"body": "<string>",
"scheduledAt": "2030-01-01T09:00:00Z",
"locationId": "<string>",
"checkedIn": True,
"contactTagId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
body: JSON.stringify('<string>'),
scheduledAt: '2030-01-01T09:00:00Z',
locationId: '<string>',
checkedIn: true,
contactTagId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.cal.com/v2/events/{uuid}/messages', 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/events/{uuid}/messages",
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([
'subject' => '<string>',
'body' => '<string>',
'scheduledAt' => '2030-01-01T09:00:00Z',
'locationId' => '<string>',
'checkedIn' => true,
'contactTagId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/events/{uuid}/messages"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.cal.com/v2/events/{uuid}/messages")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.com/v2/events/{uuid}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"scheduledAt\": \"2030-01-01T09:00:00Z\",\n \"locationId\": \"<string>\",\n \"checkedIn\": true,\n \"contactTagId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "<string>",
"status": "QUEUED",
"recipientCount": 123,
"textRecipientCount": 123,
"skippedPhoneCount": 123,
"scheduledAt": "2023-11-07T05:31:56Z"
}
}Headers
Path Parameters
Body
When to send the message, as an ISO 8601 date-time such as 2030-01-01T09:00:00Z. It must be at least 5 minutes from now and earlier than 7 days after the Event ends. Omit it to send the message now. Cancel a scheduled message before this time with the cancel endpoint.
"2030-01-01T09:00:00Z"
Was this page helpful?