Preview an event communication
Reviews selected, eligible, suppressed and missing-email recipient counts, sender, schedule and private-address effects without creating or sending anything. The structured schedule must match legacy send_at when both are supplied. Requires events_manage.
curl --request POST \
--url https://api.gratona.com/v1/admin/events/{eventId}/communications/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "Example",
"trigger": "Example",
"channel": "email",
"status": "draft",
"segment": "Example",
"subject": "Example",
"body": "Example",
"send_at": "2026-12-20T18:00:00Z",
"sent_at": "2026-12-20T18:00:00Z",
"metadata": {},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/events/{eventId}/communications/preview"
payload = {
"type": "Example",
"trigger": "Example",
"channel": "email",
"status": "draft",
"segment": "Example",
"subject": "Example",
"body": "Example",
"send_at": "2026-12-20T18:00:00Z",
"sent_at": "2026-12-20T18:00:00Z",
"metadata": {},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'Example',
trigger: 'Example',
channel: 'email',
status: 'draft',
segment: 'Example',
subject: 'Example',
body: JSON.stringify('Example'),
send_at: '2026-12-20T18:00:00Z',
sent_at: '2026-12-20T18:00:00Z',
metadata: {},
schedule: {
kind: 'instant',
localDatetime: '2026-12-19T18:00:00',
timezone: 'Africa/Kampala',
offsetMinutes: 180,
utcAt: '2026-12-19T15:00:00Z',
source: 'calendar',
recommendationId: 'recommendation-42'
}
})
};
fetch('https://api.gratona.com/v1/admin/events/{eventId}/communications/preview', 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.gratona.com/v1/admin/events/{eventId}/communications/preview",
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([
'type' => 'Example',
'trigger' => 'Example',
'channel' => 'email',
'status' => 'draft',
'segment' => 'Example',
'subject' => 'Example',
'body' => 'Example',
'send_at' => '2026-12-20T18:00:00Z',
'sent_at' => '2026-12-20T18:00:00Z',
'metadata' => [
],
'schedule' => [
'kind' => 'instant',
'localDatetime' => '2026-12-19T18:00:00',
'timezone' => 'Africa/Kampala',
'offsetMinutes' => 180,
'utcAt' => '2026-12-19T15:00:00Z',
'source' => 'calendar',
'recommendationId' => 'recommendation-42'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.gratona.com/v1/admin/events/{eventId}/communications/preview"
payload := strings.NewReader("{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/events/{eventId}/communications/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/events/{eventId}/communications/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"selected_count": 42,
"audience_count": 42,
"suppressed_count": 42,
"excluded_count": 42,
"channel": "email",
"sender": {
"name": "Example Foundation",
"address": "hello@example.org"
},
"template": {
"type": "reminder",
"subject": "Reminder: [event_name]"
},
"schedule": {
"status": "draft",
"send_at": "2026-10-20T12:00:00Z",
"intent": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
},
"address_release_effect": "Only the public location will be included.",
"communications_hold": false
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Record ID in the authenticated organization.
42
Body
Type.
80"Example"
Trigger.
80"Example"
Channel.
email, sms, task "email"
Status.
draft, scheduled, sent, paused "draft"
Purchaser audience; registered_attendees, attended_and_gave, attended_no_gift, no_show, sponsor_package_buyers or potential_child_sponsors select completed paid/free/offline order subsets. Unknown values use all completed purchasers.
120"Example"
Subject.
255"Example"
Body.
"Example"
Send at. Date without offset is interpreted in the event timezone.
"2026-12-20T18:00:00Z"
Sent at. Date without offset is interpreted in the event timezone.
"2026-12-20T18:00:00Z"
Metadata.
Closed instant/relative intent; a supplied legacy send_at must match the resolved instant.
Show child attributes
Show child attributes
Response
Preview an event communication completed.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/events/{eventId}/communications/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "Example",
"trigger": "Example",
"channel": "email",
"status": "draft",
"segment": "Example",
"subject": "Example",
"body": "Example",
"send_at": "2026-12-20T18:00:00Z",
"sent_at": "2026-12-20T18:00:00Z",
"metadata": {},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/events/{eventId}/communications/preview"
payload = {
"type": "Example",
"trigger": "Example",
"channel": "email",
"status": "draft",
"segment": "Example",
"subject": "Example",
"body": "Example",
"send_at": "2026-12-20T18:00:00Z",
"sent_at": "2026-12-20T18:00:00Z",
"metadata": {},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'Example',
trigger: 'Example',
channel: 'email',
status: 'draft',
segment: 'Example',
subject: 'Example',
body: JSON.stringify('Example'),
send_at: '2026-12-20T18:00:00Z',
sent_at: '2026-12-20T18:00:00Z',
metadata: {},
schedule: {
kind: 'instant',
localDatetime: '2026-12-19T18:00:00',
timezone: 'Africa/Kampala',
offsetMinutes: 180,
utcAt: '2026-12-19T15:00:00Z',
source: 'calendar',
recommendationId: 'recommendation-42'
}
})
};
fetch('https://api.gratona.com/v1/admin/events/{eventId}/communications/preview', 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.gratona.com/v1/admin/events/{eventId}/communications/preview",
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([
'type' => 'Example',
'trigger' => 'Example',
'channel' => 'email',
'status' => 'draft',
'segment' => 'Example',
'subject' => 'Example',
'body' => 'Example',
'send_at' => '2026-12-20T18:00:00Z',
'sent_at' => '2026-12-20T18:00:00Z',
'metadata' => [
],
'schedule' => [
'kind' => 'instant',
'localDatetime' => '2026-12-19T18:00:00',
'timezone' => 'Africa/Kampala',
'offsetMinutes' => 180,
'utcAt' => '2026-12-19T15:00:00Z',
'source' => 'calendar',
'recommendationId' => 'recommendation-42'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.gratona.com/v1/admin/events/{eventId}/communications/preview"
payload := strings.NewReader("{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/events/{eventId}/communications/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/events/{eventId}/communications/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"Example\",\n \"trigger\": \"Example\",\n \"channel\": \"email\",\n \"status\": \"draft\",\n \"segment\": \"Example\",\n \"subject\": \"Example\",\n \"body\": \"Example\",\n \"send_at\": \"2026-12-20T18:00:00Z\",\n \"sent_at\": \"2026-12-20T18:00:00Z\",\n \"metadata\": {},\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-19T18:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-19T15:00:00Z\",\n \"source\": \"calendar\",\n \"recommendationId\": \"recommendation-42\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"selected_count": 42,
"audience_count": 42,
"suppressed_count": 42,
"excluded_count": 42,
"channel": "email",
"sender": {
"name": "Example Foundation",
"address": "hello@example.org"
},
"template": {
"type": "reminder",
"subject": "Reminder: [event_name]"
},
"schedule": {
"status": "draft",
"send_at": "2026-10-20T12:00:00Z",
"intent": {
"kind": "instant",
"localDatetime": "2026-12-19T18:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-19T15:00:00Z",
"source": "calendar",
"recommendationId": "recommendation-42"
}
},
"address_release_effect": "Only the public location will be included.",
"communications_hold": false
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}