Check availability
curl --request POST \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available \
--header 'Client-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"ddi": "<string>",
"phone": "<string>"
}
'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available"
payload = {
"ddi": "<string>",
"phone": "<string>"
}
headers = {
"Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({ddi: '<string>', phone: '<string>'})
};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ddi' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available"
payload := strings.NewReader("{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available")
.header("Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"blocked": true,
"appealToken": "<string>",
"smsWaitSeconds": 123,
"voiceWaitSeconds": 123,
"waOldWaitSeconds": 123,
"waOldEligible": true,
"reason": "<string>"
}Mobile
Check availability
Check registration availability for a phone number on the application
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
mobile
/
registration-available
Check availability
curl --request POST \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available \
--header 'Client-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"ddi": "<string>",
"phone": "<string>"
}
'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available"
payload = {
"ddi": "<string>",
"phone": "<string>"
}
headers = {
"Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({ddi: '<string>', phone: '<string>'})
};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ddi' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Client-Token: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available"
payload := strings.NewReader("{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available")
.header("Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/registration-available")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ddi\": \"<string>\",\n \"phone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available": true,
"blocked": true,
"appealToken": "<string>",
"smsWaitSeconds": 123,
"voiceWaitSeconds": 123,
"waOldWaitSeconds": 123,
"waOldEligible": true,
"reason": "<string>"
}Overview
Method used to check the registration availability of a number. This endpoint verifies if the number is available for registration and performs the application onboarding setup. It must be called before requesting the confirmation code.ATTENTIONDo not use this method if you do not have access to the phone where the number is currently linked. This method is useful for speeding up the code confirmation process without having to wait for an SMS or voice call, but it requires you to have the device in hand with the application open.
Banned number scenarioThere are some scenarios where the number is prevented from being connected even on the official application. In this case, the number availability check API is not able to identify this, and the number is only returned as blocked when requesting the code. Unfortunately, there is nothing we can do about this at the moment, because unlike the standard ban, no token (appealToken) is provided to submit an unban request.
Attributes
Header
Body
Request Body
{
"ddi": "55",
"phone": "4499999999"
}
Response
200
Available number:{
"available": true,
"smsWaitSeconds": 0,
"voiceWaitSeconds": 0,
"waOldWaitSeconds": 0,
"waOldEligible": true
}
{
"available": false,
"blocked": true,
"appealToken": "Ae0B_6FfVfyB8on0v76ALf1RkWXFFsfvliOdh02JyXTFcbnlTAwO5_h5Ju4L5zfa..."
}