Skip to content

Server-Sent Events (SSE)

An event stream request opens a Server-Sent Events (SSE) stream, the text/event-stream format that EventSource in browsers reads, and shows each event as it arrives. Streams only go one way: from the server to you.

In the Collection sidebar, open the New menu (+) and choose New Event stream (SSE). Enter the URL, for example https://example.com/events. The request has Params, Headers, Auth, Settings and Docs tabs, like an HTTP request without a body.

Press Connect (or Mod+Enter). Zorvik sends a GET request, resolved like an HTTP request (variables, folder and workspace headers, auth including OAuth 2.0, cookies, proxy and TLS settings), and adds two headers unless you set them yourself:

Accept: text/event-stream
Cache-Control: no-cache

When the answer is a 2xx with Content-Type: text/event-stream, the log shows Connected · 200 OK · 45 ms and events start to appear. Otherwise the start of the body is shown as an error and the stream ends:

  • Response is not an event stream (Content-Type is not text/event-stream). Body: … for a 2xx answer of another type.
  • Server responded with an error. Body: … for any other status.

Disconnect closes the stream. The log says how a stream ended: Server closed the stream, Connection lost or Closed by you.

Events are parsed the way browsers do (the WHATWG “event stream interpretation”):

LineEffect
event: nameThe event’s name. Events without one are named message.
data: textA line of data. Several data: lines are joined with line breaks.
id: valueThe event id; it stays in effect for later events.
retry: msRead, but not used.
: anythingA comment (keep-alive), ignored.
empty lineEnds the event.

Line breaks may be LF, CR or CRLF, and a leading byte order mark is ignored. A single line or event larger than 16 MB is cut at 16 MB.

Each row shows the time, the event name as a badge, the start of the data and its size. Click a row to see the whole data (JSON pretty-printed) and the event’s id. The status line counts the events; the filter box searches event data and names; the bin icon clears the log.

In collection runs (the runner and zorvik run) and for AI agents, a stream can’t stay open forever, so the request’s Settings tab has an In collection runs section. Reading stops at the first of these:

SettingDefaultMeaning
Stop at eventemptyStop after the first event with this name (message for events without a name). Empty: any event may be the last.
Stop after100Stop after this many events. 0: only the time limit counts.
Time limit10000 msStop after this long (at least 100 ms).

The server closing the stream also ends it. The post-response scripts then test the events through pm.response.events; see Scripts & tests. A run keeps at most 1,000 events and 64 KB of data per event, and never reads for longer than 5 minutes.

The Repeat until settings (send again until a condition holds) are available for event streams in collection runs too.

requests/Build log.yaml
name: Build log
kind: sse
url: "{{baseUrl}}/builds/{{buildId}}/events"
headers:
- key: Authorization
value: Bearer {{token}}
settings:
stream:
event: done
maxEvents: 0
timeoutMs: 60000
FieldDefaultDescription
kindsse.
settings.stream.eventemptyStop at event.
settings.stream.maxEvents100Stop after (events).
settings.stream.timeoutMs10000Time limit in milliseconds.