Skip to main content
GET
Stream watcher changes (SSE)

SSE Events

The stream emits exactly five event types: heartbeat is a connection keep-alive on the stream’s own short drain cadence. It is not tied to the watcher’s pollInterval and does not mean an upstream poll just completed. If the watcher is briefly unavailable, the stream stays open and heartbeats pause until it recovers, for at most the rest of the stream’s 5-minute lifetime. The connection is still alive, so don’t treat a missing heartbeat as a dropped stream or reconnect because of one. The stream ends with reconnect or stopped, or when your client disconnects. The stream requires Business or Internal tier, and returns 400 if the watcher is paused.

Change events

The eventType on a change event, and what listingId, oldValue and newValue hold, depend on the watch type: A listing watcher can also receive a change that Borough’s scheduled refresh detected for the same listing, so the same price or status change can arrive twice. De-duplicate on eventType and newValue. While live fetching is held back for Borough’s scheduled updates, or paused, a listing watcher skips its own polls, and skipped polls are not counted. Changes Borough’s scheduled refresh detects for the listing can still arrive; otherwise the stream sends only heartbeat events. No separate signal is sent.

Resuming

Every change, heartbeat, reconnect, and stopped event carries an SSE id: a cursor into the watcher’s change buffer, which retains the last 50 detected changes. Send that cursor back and the server resumes from it rather than from the current tip.
  • Last-Event-ID: <id> header — what browser EventSource and the Borough SDK replay automatically on reconnect. Wins if both are supplied.
  • ?since=<id> query parameter — for a first connect from a client that cannot set request headers.
A connection with no cursor starts at the buffer tip, so it delivers only changes detected from that point on. The connected event carries no id. See the streaming guide for worked examples and the retention caveats.

Authorizations

Authorization
string
header
required

Polar.sh license key. Format: BOROUGH-<uuid>

Path Parameters

id
string
required

Watcher ID (UUID)

Query Parameters

since
integer

Resume cursor — the SSE id of the last event you processed. Changes recorded after it are replayed, bounded by how many the watcher retains. Ignored when Last-Event-ID is present, which takes precedence. A connect with neither starts at the current tip instead of replaying.

Required range: x >= 0

Response

Server-Sent Events stream

The response is of type string.