Skip to main content
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
queue
Queue (Deprecated)
curl --request GET \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/queue \
  --header 'Client-Token: <api-key>'
This endpoint is obsolete, as the pagination model has been updated to a cursor-based format (pagingState). Please use the new POST /queue endpoint. Scheduled discontinuation: This endpoint will be removed on 04/30.

Overview

This method is responsible for returning all messages in your queue awaiting processing.

Attributes

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

Query Parameters

page
integer
required
Used for pagination, specify the message page you want to fetch
pageSize
integer
required
Specifies the number of messages returned per page
To return only the total message count in the queue, use: GET /queue/count

Response

200

{
  "messages": [
    {
      "_id": "39BB1684570F00E91090F6BBC7EE7646",
      "DelayMessage": -1,
      "Message": "Queue message 1",
      "IsTrial": false,
      "InstanceId": "3A5D07856DC26A1C9E2E08E691E63271",
      "Phone": "5511999999999",
      "ZaapId": "39BB1684570F00E91090F6BBC7EE7646",
      "DelayTyping": 0,
      "MessageId": "7AD29EAA5EF34C301F0B",
      "Created": 1624977905648
    }
  ]
}

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”.