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 hold waiting on somebody, a delivery outcome returning.
Pass the cursor from the last event 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 event carries a cursor. Store it only after you have acted on the event, or a crash between the two loses the event.
The stream is three kinds of line. It always starts with an open
frame carrying the cursor you supplied. Without one, the stream starts
at the latest event and you have no resumable position until the first
batch; to resume without a gap, call wait first and stream from its
cursor. 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.
A request that is wrong is refused before the stream opens, with an
ordinary JSON error: a cursor that does not parse is 400, a
credential that reaches no mailbox is 403. An error after open is a
failure in flight, arrives as a batch frame carrying error, and ends
the stream.
It stays open until you disconnect or the server is replaced; reconnect with your last cursor and nothing is lost.
Authorizations
Bearer token for one agent. Pass as
Authorization: Bearer <token>.
A token is shown once when it is issued and is not recoverable afterwards. Treat it as a secret: it reaches one agent's mail, calendar and contacts, and anything a grant has extended to it.
Body
Where to resume. Empty starts at the tail.
Narrow to one mailbox. Empty means every mailbox this credential can read.
How long each quiet interval lasts before a keepalive is sent, in seconds, at most 25. It does not end the stream.
Only these event types. Empty matches everything.
Only messages carrying a machine-readable part.
Response
An SSE stream of events.
The response is of type string.

