Features

Notifications

The in-app feed that tells people a run needs their attention, an agent sent them a message or a package was shared with them, and the unread state of their runs.

Notifications are the in-app inbox of a person or an end-user: the bell in the web app. They are not emails or push messages. To notify an external system, use webhooks.

Each notification belongs to one recipient and one space, and has its own read state. Marking a notification read affects only the person who read it.

The feed

The feed holds what needs the recipient's attention, decided when the notification is written.

TypeWhenRecipient
run_failedA run ends failed or timeout. The payload carries the packageId, the agent_name and the status.The member or end-user who launched it. A run with no actor is notified to the organization's owners and admins.
agent_messageA running agent calls the notify platform tool.The run's recipients, as for run_failed, at most once per run.

An agent_message payload carries the packageId, the title and the message the agent wrote, and its runId is the run that sent it. The notify call of an inline agent's run is refused. An agent has notify only when its manifest selects it under integrations_configuration["@appstrate/platform"].tools; it is not one of the integration's default tools. The message is not instant: the bell shows it at its next refresh, which happens when the run ends, when the live connection reconnects, and every five minutes. Opening the run reads it, like a run_failed.

A scheduled run that is refused before it starts (a missing package, a connection that no longer resolves) is a failed run like any other, and is notified. A run that succeeds or is cancelled is not notified: it is only unread (below). Runs of an inline agent are never notified, since their result is already in front of the caller.

# Newest first, unread only, 20 per page
curl "https://your-instance/api/notifications?unread=true&limit=20" \
  -H "Authorization: Bearer apst_your_key"

Each item has id, type, runId, payload, read_at and createdAt. Page with startingAfter=<id> and the Link: rel="next" header.

RoutePurpose
GET /api/notificationsThe recipient's feed. unread=true filters.
GET /api/notifications/unread-count{ "count": n }.
PUT /api/notifications/{id}/readMark one read. 204, idempotent, 404 when it is not yours.
PUT /api/notifications/read-allMark the whole feed read. Returns { "updated_count": n }.

The feed is the recipient's own, so no role permission is needed beyond being in the space. A delegated credential (an API key, for example) must be allowed to read runs.

There is no dedicated notification stream. The web app re-reads the feed when a run finishes (run_update on the realtime streams) and polls it otherwise.

Unread runs

Every finished run, notified or not, becomes unread for its recipients (the same people as above) when it reaches a terminal status (success, failed, timeout or cancelled). Runs of an inline agent are never unread. Opening a run reads it, and reads its notification too when it had one; reading a notification in the feed leaves the run unread.

That state is served with the runs, computed for the caller:

WhereField or route
A rununread
An agent (GET /api/agents)unread_count
A scheduleunread_count
The caller's unread runsGET /api/runs?unread=true (its total is the count)
Mark one readPUT /api/runs/{id}/read — 204, idempotent, opening a run does it
Mark them all readPUT /api/runs/read-all — returns { "updated_count": n }, reads their notifications too

To learn about completed runs live, follow run_update events on the realtime streams.

Housekeeping

Deleting an end-user deletes its notifications and run read state. A member who leaves an organization loses theirs in it. Deleting a space deletes those of that space.

On this page