Skip to content
Agentpost robot in sunglasses on a red circleAgentpost

Notifications

A notification tells one principal about one event in their inbox, such as a request assigned to them. A subscription with a notification target makes them: for each event it matches, one notification for each recipient it names, on its topic, with text from its template.

Topics

A topic is what notifications are about, such as assignments, with a name a principal sees in their preferences. Every topic write sets defaults.inbox, defaults.push, and required explicitly. The first two decide whether a notification reaches the inbox and push when a principal has set nothing. A required topic reaches both channels whatever the principal sets. Their preferences show required: true, so your preference page can lock the control. A saved preference takes effect only while the topic is optional.

Recipients

A recipient is your own ID for a principal, such as u_ana, of up to 200 printable characters without spaces. EventWolf can notify that ID before a recipient record exists. It makes a record when you write follows or preferences, or when the principal marks their inbox seen. The record holds:

  • Follows: the topics they follow, which a subscription with followers: true notifies.
  • Preferences: for each topic, whether it reaches each channel, apart from the topic’s defaults.
  • Where they’ve seen to: the newest notification they have seen.

Deleting a recipient deletes their follows, preferences, notifications, and push addresses, as when a principal leaves your product.

Preferences

Before a notification is made, its topic’s defaults and the recipient’s preferences decide separately whether it reaches the inbox and whether it reaches their phones by push. If the inbox is off, the notification is still recorded as skipped with the reason preference_off. A principal sets their own preferences in their inbox. Your server can set them for any recipient.

The inbox

A principal’s inbox holds the notifications delivered to them, newest first. Each is unread until it is marked read, and archiving one hides it from the inbox’s default list. The count gives unread, and unseen, the ones newer than where they’ve seen to in the inbox. Phone badges keep separate seen positions. A live stream sends new notifications as they are made.

Your server manages topics, subscriptions, and recipients with the project’s secret key. An inbox read with that key answers forbidden.

For a user token your server mints, EventWolf uses the token’s externalId as the inbox’s recipient ID. A user token exchanged from a session, an IdentityHound session token, or an IdentityHound API key reaches the inbox for the signed-in principal’s ID. An IdentityHound delegated token reaches the delegator’s inbox.

A live stream stops within 30 seconds after its credential stops working. An expired user token gets unauthenticated, and a fresh token can resume from the last notification or cursor while the needed history is retained. Withdrawn access, such as a revoked issuing key or an ended session, gets forbidden. A deleted project’s stream may close without an error.

A notification’s text is made from the template once, when its event is accepted. Erasure of any field of its event scrubs that frozen text: the notification keeps its place in the inbox with erasedAt and no title, body, or url, for your app to show in its own words or leave out.

Limits

  • A notification’s title is at most 500 characters, its body 4,000, and its URL 2,048.
  • A recipient follows at most 200 topics.
  • Notifications are kept for the config’s retention.notifications, measured from creation. Agentpost starts projects at 180 days. EventWolf silently skips notifications removed by retention when you resume with a numeric cursor and answers invalid_request when retention has removed the notification ID you send.

Where to act on it