Queue
Message Queue
Queue
Returns messages from the queue awaiting processing with cursor-based pagination
POST
Queue
Overview
This method returns messages in the queue awaiting processing, with cursor-based pagination support. Unlike the GET endpoint, this one allows more efficient pagination usingpagingState.
Attributes
Required
Your instance ID. Available in the Z-API panel under Instances.
Your Z-API instance token.
Body (Optional)
Number of messages returned per request. Default: 20, max: 30.
Pagination cursor. When not provided, returns the first page. Use the value returned in the response to fetch the next pages.
Request Body
First page:Response
200
List of queue messages
Cursor for the next page
Indicates if more pages exist
Pagination
- If you don’t send
pagingState, the first page will be returned automatically - If you don’t provide
pageSize, the default value of 20 messages will be used - The maximum number of messages that can be returned per page is 30
- Use the returned
pagingStateto fetch the next pages - When
hasMoreisfalse, there are no more messages available