Skip to main content
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 using pagingState.

Attributes

Required

string
required
Your instance ID. Available in the Z-API panel under Instances.
string
required
Your Z-API instance token.

Body (Optional)

integer
Number of messages returned per request. Default: 20, max: 30.
string
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:
Next pages:

Response

200

array
List of queue messages
string
Cursor for the next page
boolean
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 pagingState to fetch the next pages
  • When hasMore is false, there are no more messages available

405

Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.