Skip to main content

Batch Validate Numbers

Method#

/phone-exists-batch#

POST https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/phone-exists-batch

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Unlike the previous method that individually validates whether a number has WhatsApp through a GET request, this API provides batch verification.

Attention

Batch Validation Limit: The maximum number of batch validations per request is 50,000 numbers.

Important

This method remains the ideal choice when you need to check if a number has WhatsApp, especially useful for form validation. However, it is crucial to note that it is not recommended to use this API to verify the existence of the number before sending a message. The Z-API automatically performs this validation with every message sent, and duplicate use of this method can lead to issues.


Attributes#

Required#

AtributosTipoDescrição
phonesarrayPhone numbers to be validated should be in the format: Country Code Area Code Number, for example, 551199999999. IMPORTANT Send only numbers without formatting or masks.

Request Params#

URL example#

Method

POST https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/phone-exists-batch

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

Response#

200#

AttributesTypeDescription
existsbooleantrue if it exists, false for cases where the number doesn't have WhatsApp
inputPhonestringNumber sent in the request, may or may not include the ninth digit.
outputPhonestringFormatted number according to the WhatsApp response, reflecting the WhatsApp registration and including the ninth digit if applicable.

Example

[
{
"exists": true,
"inputPhone": "554499999999",
"outputPhone": "554499999999"
},
{
"exists": false,
"inputPhone": "554488888888",
"outputPhone": "554488888888"
}
]

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”


Code#