Events
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.
POST
/
admin
/
events
/
{eventId}
/
communications
/
preview
Preview an event communication
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
bearerAuthapiKeyAuth
Body
application/json
⌘I
Preview an event communication
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"
}