Skip to main content

Listing instances

Method#

/instances#

GET https://api.z-api.io/instances


Concept#

This method is used to list every instance created


Attributes#

Required#

AttributesTypeDescription
pageintegerUsed for pagination, you must inform here the page of chats you want to search
pageSizeintegerSpecifies the size of the return chats per page

Optionals#

AttributesTypeDescription
querynumberSearch by instance name and id
middlewarestring (web, mobile)Search instance by type: web or mobile. Empty will bring all types

Request Body#

Method

GET https://api.z-api.io/instances/

Example

Query params#

keyvaluedescription
query999999999999
middlewareweb
pageSize1
page1

Response#

201#

AttributesTypeDescription
idstringCreated instance’s ID
tokenstringTOKEN of the created instance
duetimestampInstance expiration date

Example

{
"total": 1,
"totalPage": 1,
"pageSize": 1,
"page": 1,
"content": [
{
"token": "",
"tenant": "",
"created": "",
"due": 1648565999675,
"paymentStatus": "",
"deliveryCallbackUrl": "",
"receivedCallbackUrl": "",
"disconnectedCallbackUrl": "",
"messageStatusCallbackUrl": "",
"receivedAndDeliveryCallbackUrl": "",
"presenceChatCallbackUrl": "",
"connectedCallbackUrl": "",
"receivedStatusCallbackUrl": "",
"phoneConnected": false,
"whatsappConnected": false,
"middleware": "web",
"name": "",
"id": ""
}
]
}

405#

In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.

415#

In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”


Webhook Response#

Link to webhook response (on receipt)

Webhook


Code#