Follow view bindings live over one SSE stream
const url = 'https://example.com/api/v1/views:watch';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/views:watchStreams the rows that land for every binding, and a changed notice for every topic a write moved, as Server-Sent Events, one connection for all of them (ADR-1830, ADR-2731). Each binding resumes after its own cursor (the /views:run result’s), so history and live rows meet with no gap and no duplicate. A rows event carries each binding’s matching rows and has the cursor after them as its id; a mark event advances that position when nothing matched; a reconnecting EventSource sends it back as Last-Event-ID and every binding resumes from it or its own cursor, whichever is later. A reset event names bindings whose cursor the tail no longer holds (too old, or from before a server restart), and the stream ends: the client re-runs their history and reconnects. The tail is the ingest landing point of this server, not a poll; rows a calc or rule derives are not on it. Gated by view:read, with each binding’s
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “ Query Parameters ”The bindings followed, as a JSON array: each the body of a /views:run binding plus its cursor (the result’s cursor it resumes after; unset follows from now). Give bindings, topics, or both
The bindings followed, as a JSON array: each the body of a /views:run binding plus its cursor (the result’s cursor it resumes after; unset follows from now). Give bindings, topics, or both
The entities whose changes the stream names, comma separated, each kind:ref (component or system, by name, uuid or dotted address; at most 32). A changed event says one moved: refetch its route. Give bindings, topics, or both
The entities whose changes the stream names, comma separated, each kind:ref (component or system, by name, uuid or dotted address; at most 32). A changed event says one moved: refetch its route. Give bindings, topics, or both
The position the topics resume after: the last event id the client received. Unset, Last-Event-ID; unset too, the topics follow from now
The position the topics resume after: the last event id the client received. Unset, Last-Event-ID; unset too, the topics follow from now
Ends the stream after this many seconds, for a script or the CLI reading a bounded tail. Unset, or past it, the stream ends at its 900 second lifetime, and the client reconnects from its position
Ends the stream after this many seconds, for a script or the CLI reading a bounded tail. Unset, or past it, the stream ends at its 900 second lifetime, and the client reconnects from its position
Header Parameters
Section titled “ Header Parameters ”The last event id the client received, sent by an EventSource on reconnect: every binding resumes from it or its own cursor, whichever is later, and the topics from it
The last event id the client received, sent by an EventSource on reconnect: every binding resumes from it or its own cursor, whichever is later, and the topics from it
Responses
Section titled “ Responses ”The event stream
Each oneOf object is one possible event, serialized as UTF-8 text per the Server-Sent Events specification.
object
object
The stream’s position: every binding has every row up to it
The event name
The cursor after the event, the resume point; absent on reset
object
object
The bindings whose cursor the tail no longer holds; re-run their history
The topics’ position is one the tail no longer holds (too old, or from before a server restart): changes may have been missed, so refetch everything the topics show, and reconnect with no topics_cursor
The event name
The cursor after the event, the resume point; absent on reset
object
object
Each binding with rows in these commits
object
The binding’s index in the watch’s bindings
object
The alarm a rule’s event opened or resolved; history rows only
The deriving event rule’s name; history rows only
The owning entity’s uuid
The row’s id, the page order’s tiebreak
The event type’s name
Caught, caused, derived or scheduled
The occurrence’s lineage; history rows only
The transport that produced it; history rows only
object
History rows only
The writing component’s uuid
History rows only
When the server received the line, the order the read pages in
The channel it arrived on
The time the line carried, else its arrival
object
object
The cursor after these rows; also the event’s id
The event name
The cursor after the event, the resume point; absent on reset
object
object
The entity’s uuid
The entity’s kind: component or system
What happened to it: update (its state moved; refetch it)
The topic as the watch named it, kind:ref
The tail sequence of the newest change this notice stands for
The event name
The cursor after the event, the resume point; absent on reset
default
Section titled “ default ”Error
object
A URL to the JSON Schema for this object.
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "$schema": "/api/v1/schemas/ErrorModel.json", "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}