curl --request GET \
--url https://brew.new/api/v1/analytics/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://brew.new/api/v1/analytics/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://brew.new/api/v1/analytics/events', 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://brew.new/api/v1/analytics/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://brew.new/api/v1/analytics/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://brew.new/api/v1/analytics/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://brew.new/api/v1/analytics/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyUnified events feed
Read-only feed of the brand’s analytics events (email, automation, trigger, inbound), newest first, over a from/to window that defaults to the last 7 days, except for a sendId or automationRunId read, which is bounded by that send or run. Email rows carry the send behind them (sendId, emailId), so a page joins back to GET /v1/sends/{sendId}.
Use when you need per-event or per-recipient detail. For windowed totals and rates use getAnalyticsOverview; for one send’s events in one bounded page use GET /v1/sends/{sendId}?include=events (getSend).
Input Equality filters: eventType, sendId (not windowed unless from/to are given), emailId, automationId, messageClass (marketing or transactional; absent stamps count as marketing). Run scope: automationRunId returns one run’s events across every domain (its lifecycle rows and the deliveries it produced), newest first and not windowed unless from/to are given; only eventType combines with it. Recipient rules recipient (csv, max 10): a full address matches exactly, @domain matches everyone on the domain, other text matches as a substring, a ! prefix excludes (recipient=@clay.com,!ceo@clay.com); includes OR together, excludes always apply. Send facets source (csv), audienceId (csv, max 20), domain (sending domain), triggerEventId (csv, max 10, resolved to the automations they wire). Any facet or recipient rule narrows the feed to email events and adds sendSource, sendContext and messageClass to each row (plus triggerProvider and triggerTitle on triggered rows). Machine-classified opens and clicks (scanner detonation, Apple proxy prefetch) are excluded unless includeMachineOpens=true or includeMachineClicks=true (audit only).
Grouped counts groupBy (one or two csv fields: eventType, emailId, automationId, sendId, source, link, recipientDomain, unsubscribeReason) and/or bucket (day, week or month, UTC, Monday weeks) count the email events the same filters list instead of returning them: link with eventType=clicked is clicks per link, unsubscribeReason counts an unsubscribe once per reason it gave. The count reads the newest 20,000 events; a busier window answers truncated: true with coveredFrom (narrow from/to or add eventType). count counts events, so repeat opens each count; a group of opened, clicked or delivered events (not grouped by link) also carries recipients, each recipient counted once per message within range.
Returns 200 { data: Event[], pagination: { limit, cursor, hasMore }, range }; page with cursor until it is null. Rows carry the run join keys when stamped: automationRunId, triggerInstanceId, audienceRunId (plus sendId, nodeId). With groupBy/bucket: 200 { count, groups: [{ key, bucket?, count, recipients? }], otherCount, range, truncated, coveredFrom? }, the largest 200 groups first. Requires the emails scope.
Errors 400 INVALID_REQUEST for an inverted window, an unknown eventType, or more than 10 recipient rules or 20 audience ids; with groupBy/bucket, for an unknown or repeated field, more than two fields, a non-email eventType, cursor or automationRunId (limit is ignored).
See also getAnalyticsOverview, listSends, listAutomationRuns.
curl --request GET \
--url https://brew.new/api/v1/analytics/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://brew.new/api/v1/analytics/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://brew.new/api/v1/analytics/events', 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://brew.new/api/v1/analytics/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://brew.new/api/v1/analytics/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://brew.new/api/v1/analytics/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://brew.new/api/v1/analytics/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAuthorizations
Headers
The brand this request acts on. REQUIRED for organization-scoped credentials (otherwise 400 BRAND_ID_REQUIRED — there is no default brand); list ids with GET /v1/brands. Brand-scoped credentials may omit it, and sending a different brand returns 403 BRAND_SCOPE_MISMATCH. A brand outside your organization returns 404 BRAND_NOT_FOUND.
1 - 64Query Parameters
CSV of recipient rules (max 10) matching who RECEIVED the email: a full address matches exactly, @domain matches the domain, any other text matches as a substring; prefix ! to exclude (e.g. @clay.com,!ceo@clay.com). Includes OR together; excludes always apply. Narrows the feed to email events.
1 - 2048One event type, spelled exactly (opened, not open; clicked, not click).
sent, delivered, delivery_delayed, opened, clicked, bounced, complained, failed, provider_suppressed, suppressed, quota_skipped, received, unsubscribed, automation_started, automation_completed, automation_failed, automation_skipped_suppressed, automation_step_succeeded, automation_step_failed, trigger_success, trigger_failure, trigger_received, trigger_deduplicated, trigger_signature_failed, trigger_rejected, trigger_dead_letter Was this page helpful?