Stream events as they happen
Opens a Server-Sent Events stream of everything that happens in the mailboxes this credential can read: mail arriving, a send leaving, a delivery outcome returning.
Pass the cursor from the last frame you processed to resume exactly
where you stopped. An empty cursor starts at the tail, which is what a
fresh client wants: one cheap call for a usable cursor instead of
replaying history.
Every frame carries a cursor, and each event carries seq, its
position in its mailbox. Store a frame’s cursor only after you have
acted on its events, or a crash between the two loses them.
The stream is three kinds of line. It always starts with an open
frame carrying the cursor the stream starts from: yours, re-encoded for
the mailboxes in scope, with the current tail for every mailbox it does
not name. Store it, and a reconnect misses nothing even if no batch
ever arrived. Each batch frame carries events and the cursor after
them. A : keepalive comment arrives while nothing is happening, so a
silent connection is distinguishable from a dead one.
The data of an open frame is a WatchOpenFrame, and of a batch
frame a WatchBatchFrame.
A request that is wrong is refused before the stream opens, with an
ordinary JSON error: a cursor that does not parse or an unknown event
type is 400, a mailbox this credential cannot read is 403. An error
after open is a failure in flight, arrives as a batch frame
carrying error and the cursor the stream had reached, and ends the
stream: store that cursor and reconnect with it.
It stays open until you disconnect or the server is replaced; reconnect with your last cursor and nothing is lost.
Authorizations
Bearer credential for one agent: an API key or an access
token (a JWT). Pass as Authorization: Bearer <credential>.
A key is shown once when it is issued and is not recoverable afterwards; an access token lives five minutes and is fetched with the agent's own client key from the access service. Treat both as secrets: they reach one agent's mail, and anything a delegation has extended to it. An access token's scope is a ceiling on what the agent may do with it.
Body
Only these event types. Empty matches everything; an unknown type is refused.
mail.received and mail.quarantined are mail arriving, the second
filed in quarantine. mail.queued, mail.held, mail.approved, mail.rejected,
mail.sent, mail.delivered, mail.bounced and mail.complained
follow a send: accepted, held for a person, released by a person,
refused or lapsed while held (the budget is given back), handed to the
provider, accepted by the receiving side, refused for good, reported as
unwanted. mail.read is a message marked read or unread. mail.moved
is a message filed in another folder; its folder is where it went,
while the folder on mail.received is where it arrived. Its actor is
the agent that moved it, or the server when a removed folder sent the
message back to inbox.
render.failed means a rendering was withheld as unsafe and a
degraded one shown instead.
mail.received, mail.quarantined, mail.queued, mail.held, mail.approved, mail.rejected, mail.sent, mail.delivered, mail.bounced, mail.complained, mail.read, mail.moved, render.failed Response
An SSE stream of events.
The response is of type string.

