Docs

Events

Server-Sent Events emitted on GET /events, and how to subscribe to individual event types

Every event consumed from agrirouter flows through the GET /events Server-Sent Events stream. This page catalogs each event type, its data: payload fields, and a sample frame as it appears on the wire.

Each event is a pair of lines:

event: <EVENT_TYPE>
data: <single-line JSON object>

The data value is a JSON object. Every payload carries an event_type discriminator field whose value matches the preceding event: line. See the SSE specification for the wire format.

Subscribe to a subset of event types with the event_types query parameter on GET /events, for example ?event_types=MESSAGE_RECEIVED&event_types=FILE_RECEIVED. If omitted, all event types stream on the connection.

Two families of events

The events on the stream fall into two groups:

  • Data-flow events describe messages and files arriving on your endpoints' feeds: MESSAGE_RECEIVED and FILE_RECEIVED.
  • Tenant-state events describe changes to the access and visibility your application has across tenants: AUTHORIZATION_ADDED, AUTHORIZATION_REVOKED, ENDPOINT_DELETED, and ENDPOINTS_LIST_CHANGED. Use them to keep your local view of authorized tenants and visible endpoints in sync without polling.

Event types

Next steps

On this page