POST
/
api
/
http_pull_consumers
/
{consumer_name_or_id}
/
receive
You can use either POST or GET to receive messages from a Sequin Stream.

Request parameters

name_or_id
string
required

The ID or name of the Sequin Stream.

batch_size
integer

Number of messages to try to fetch from the stream. Defaults to 1.

The count of returned messages may be less than the requested batch size if there are fewer messages available for the consumer.

wait_for
integer | string

Amount of time to wait for messages to become available in the stream, in milliseconds. Defaults to 0.

When wait_for is greater than 0, the request will block until any messages are available or wait_for milliseconds have passed.

Therefore, you can use wait_for to implement long polling.

Instead of passing in an integer, you can also pass in a duration string, like "60s", "5000ms", or "5m".

Response fields

The response is an object with a data property that contains a list of messages. Within each message is an ack_id and a data property that contains the message data.

data
list
required