Consume messages

Retrieve messages from the topic. This resource provides the option to retrieve all messages within the topic or, by including parameters in the request body, to fetch messages after a specified ID or timestamp. The response is limited to a maximum of 50 messages in each batch. You can enable long polling mode by setting the `timeout_secs` parameter. In this mode, the API returns available messages instantly. If there are no messages, the API waits for a maximum of `timeout_secs` seconds. If a new message appears within this timeframe, it is instantly returned; otherwise, the API provides an empty list after the call times out. **WARNING:** Payloads for the Event streams public API are limited to 1 MB. **USING SINCE_TIME PARAMETER:** We recommend using `after_message_id` to control the topic message cursor. `since_time` should only be used for the first request (to poll messages from a specific timestamp without polling the whole topic), or if you need to re-retrieve messages from the topic. Using `since_time`, especially in combination with batch publish and long polling, doesn't guarantee message order and can lead to skipped messages.

Path parameters

topic_idintegerRequired
Topic ID.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
after_message_idstringOptional

Read messages after this message_id.

since_timestringOptional
Read messages starting from this time.
batch_sizeintegerOptional

Batch size. Default: 50. Maximum: 50.

Response

Success - List of messages retrieved successfully.

messageslist of objects
List of messages retrieved from the event stream.

Errors