/data-streams/user/{streamSlug}/replayReplay Stream
Reads a page of a user stream's retained messages, oldest first, between two sequence numbers.
Pass the page's nextCursor as fromSequence to read the next page; hasMore is true while pages come back full.
Needs PROJECT_ADMIN or PROJECT_AUDITOR.
| streamSlug * | path | The stream's slug, unique in the project. |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| fromSequence | any | Return messages after this stream sequence (exclusive). Pass the previous page's Omitted or 0, the read starts at the oldest retained message. An integer or a string of digits. |
| One of: integer | ||
| or: string | ||
| untilSequence | any | Stop at this stream sequence (inclusive). An integer or a string of digits. |
| One of: integer | ||
| or: string | ||
| limit | integer | The most messages to return, 1 to 10000. Default 100. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 403 | K9O_RBAC_DENY | Reading Pulse Streams requires PROJECT_ADMIN or PROJECT_AUDITOR. |
| 404 | K9O_STREAM_NOT_FOUND | No active Pulse Stream with that slug in this project. |
| 503 | K9O_STREAM_UNAVAILABLE | Pulse 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. |
| data * | object | One page of the stream's retained messages. |
| streamSlug * | string | The stream that was read. |
| events * | object[] | The messages in the range, in ascending sequence order. |
| sequence * | string | The message's stream sequence number, as a string of digits. It is the resume cursor. |
| subject * | string | The full subject the message was published on: the stream's |
| data * | any | The published payload, decoded from JSON: any JSON value. A message whose bytes are not JSON is delivered as |
| publishedAt * | string <date-time> | When the broker accepted the message. |
| nextCursor * | any | The sequence of the last message returned; pass it as When the page is empty it echoes the request's |
| One of: string | ||
| or: null | ||
| hasMore * | boolean | True when the page is full (as many messages as |
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.streams.replay('<streamSlug>', {})Showing example in TypeScript
{
"fromSequence": 0,
"untilSequence": 0,
"limit": 0
}{
"data": {
"streamSlug": "string",
"events": [
{
"sequence": "string",
"subject": "string",
"publishedAt": "string"
}
],
"nextCursor": "string",
"hasMore": false
}
}