Skip to main content
GET/data-streams/user/{streamSlug}/subscribe

Subscribe to Stream

Opens a Server-Sent Events stream of a user stream's messages, starting after a sequence number and following new messages as they arrive.

The connection closes after about 25 seconds; reconnect with Last-Event-ID to continue where it stopped.

Needs PROJECT_ADMIN or PROJECT_AUDITOR.

Parameters
streamSlug *path

The stream's slug, unique in the project.

fromSequencequery

Start after the message with this sequence.

The Last-Event-ID header wins when both are sent.

Omit it, or send 0, to start at the oldest retained message.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200A Server-Sent Events stream of the stream's messages.
403K9O_RBAC_DENYReading Pulse Streams requires PROJECT_ADMIN or PROJECT_AUDITOR.
404K9O_STREAM_NOT_FOUNDNo active Pulse Stream with that slug in this project.
503K9O_STREAM_UNAVAILABLEPulse Stream messaging is not configured in this deployment, or the project's stream account is not provisioned, so no messages can be read. Retry later.
Response body (200)
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.streams.subscribe('<streamSlug>')

Showing example in TypeScript

Response example (200)
"retry: 1000\n:ok\n\nid: 1201\ndata: {\"sequence\":\"1201\",\"subject\":\"k9o.us01.org_5t2q8m1x.proj_8x2k4m9q1z7w.user.pstr_01hx8k2m9q4w7z3n5r6t._\",\"data\":{\"orderId\":\"ord_1042\"},\"publishedAt\":\"2026-11-02T14:05:31.512Z\"}\n\n"

More in Realtime Feeds & Streams