Skip to main content
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
phone-exists-batch
Batch verification
curl --request POST \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/phone-exists-batch \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phones": [
    {}
  ]
}
'
{
  "exists": true,
  "inputPhone": "<string>",
  "outputPhone": "<string>",
  "lid": "<string>"
}

Overview

Unlike the previous method that individually validates if a number has WhatsApp through a GET request, this API offers batch verification.
Maximum of 50,000 validations per request.
Use this API for form validation. It is not recommended to use this API to verify the number’s existence before sending a message, as Z-API already validates the number’s existence for each message sent.

Attributes

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

Body

phones
array
required
List of phone numbers in DDI DDD NUMBER format. E.g.: 551199999999

Request Body

{
  "phones": ["554499999999", "554488888888"]
}

Response

200

exists
boolean
Whether the number has WhatsApp
inputPhone
string
Number sent in the request
outputPhone
string
Formatted number per WhatsApp’s response
lid
string
WhatsApp’s unique private identifier (null if exists = false)
[
  {
    "exists": true,
    "inputPhone": "554499999999",
    "outputPhone": "554499999999",
    "lid": "999999999999999@lid"
  }
]

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