Docs·Notifications

GET/api/v1/spreelytics/notifications

List notifications

Returns the notifications the audience's rules wrote, newest first, a page at a time, with how many are unread. Notifications are kept until the audience is deleted.

Read and unread are shared by everyone in the workspace: one marked read by anyone, in the app or through the API, is read for all. Every role can call it, Viewer included.

Keys: an account key or an audience key. Getting started explains both kinds.

Parameters

PropInTypeNotes
contactListIdquerystringThe audience id, a UUID. With an audience key it must be that key's own audience.
page?querynumberPage number, starting at 0. Defaults to 0.
pageSize?querynumberHow many per page, from 1 to 100. Defaults to 25.
startDate?querystringOptional, sent together with endDate: a YYYY-MM-DD date or an ISO UTC time, included. Narrows items and total, not unread.
endDate?querystringOptional: the end of the window. It must come after startDate, and sending only one of the two answers 400.

Response

PropTypeNotes
itemsNotificationDto[]This page of notifications, newest first.
totalnumberHow many notifications there are in the window, across all pages.
unreadnumberHow many notifications are unread at any time. The window does not narrow it.

Each item in items

PropTypeNotes
idstringThe notification id.
ruleIdstringThe rule that wrote it, or null once that rule is deleted.
ruleNamestringThe rule's name when the notification was written. It stays after the rule is renamed or deleted.
titlestringThe rule's name, or Preview: and the name for a preview.
messagestringWhat happened, as one sentence, such as Paid $49.00 for Pro plan or Visited /pricing.
payloadobjectWhat the match carried, or null. Depending on the rule: eventName, path, country, sessionId and visitorId; a funnel's type ("funnel") and its steps; a revenue or goal rule's type with its payment kind or its goalId and goalName; by, who did it (name, country, city, browser, os, device, each null when unknown, and a null name for an anonymous visitor); and "test": true on a preview.
readAtstringWhen it was marked read, by anyone in the workspace, or null while it is unread.
createdAtstringWhen it was written, in ISO 8601.

Request

curl 'https://app.spreelytics.com/api/v1/spreelytics/notifications?contactListId=…' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/notifications');
url.searchParams.set('contactListId', '…');

const res = await fetch(url, {
  headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const data = await res.json();
import requests

res = requests.get(
    "https://app.spreelytics.com/api/v1/spreelytics/notifications",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"contactListId": "…"},
)
data = res.json()

Response

{
  "items": [
    {
      "id": "string",
      "ruleId": "string",
      "ruleName": "string",
      "title": "string",
      "message": "string",
      "payload": "string",
      "readAt": "string",
      "createdAt": "string"
    }
  ],
  "total": 0,
  "unread": 0
}

See your own numbers today.

Free up to 100k events a month · no credit card

Contact

Tell us what you need.

A real person reads these. We usually reply within one working day.

Or email us directly at contact@spreelytics.com.