Docs·Notifications

GET/api/v1/spreelytics/notification-rules

List notification rules

Returns the audience's notification rules, newest first. Send startDate and endDate to also get each rule's triggeredCount and lastTriggeredAt for that window, the numbers the app's Rules tab shows.

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.
startDate?querystringOptional, sent together with endDate: a YYYY-MM-DD date or an ISO UTC time, included. Adds the triggered counts.
endDate?querystringOptional: the end of the window. It must come after startDate, and sending only one of the two answers 400.

Response

An array of NotificationRuleDto.

PropTypeNotes
idstringThe rule id.
namestringThe rule's name. Every notification it writes carries it as its title.
configNotificationRuleConfigWhat it watches for: its type and its events rows, as Create a notification rule describes them.
cooldownSecondsnumberThe snooze in seconds: after the rule writes a notification, it skips every match for this long. 0 notifies on every match.
enabledbooleanfalse while the rule is paused. A paused rule writes nothing.
emailEnabledbooleantrue when the rule also emails the team.
createdAtstringWhen it was created, in ISO 8601.
updatedAtstringWhen it last changed, in ISO 8601.
triggeredCountnumberOnly when the list was asked for a window: how many notifications the rule wrote in it, previews left out.
lastTriggeredAtstringOnly alongside triggeredCount: when the rule last wrote a notification, at any time, or null if it never has.

Request

curl 'https://app.spreelytics.com/api/v1/spreelytics/notification-rules?contactListId=…' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/notification-rules');
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/notification-rules",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"contactListId": "…"},
)
data = res.json()

Response

[
  {
    "id": "string",
    "name": "string",
    "config": {
      "type": "events",
      "events": [
        {
          "name": null,
          "filters": null
        }
      ]
    },
    "cooldownSeconds": 0,
    "enabled": true,
    "emailEnabled": true,
    "createdAt": "string",
    "updatedAt": "string",
    "triggeredCount": 0,
    "lastTriggeredAt": "string"
  }
]

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.