Skip to main content
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
mobile
/
request-registration-code
Request confirmation code
curl --request POST \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/mobile/request-registration-code \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ddi": "<string>",
  "phone": "<string>",
  "method": "<string>"
}
'
{
  "success": true,
  "captcha": "<string>",
  "blocked": true,
  "retryAfter": 123,
  "smsWaitSeconds": 123,
  "voiceWaitSeconds": 123,
  "waOldWaitSeconds": 123,
  "method": "<string>"
}

Overview

Method used to request the confirmation code to be sent.
Don’t forget that the phone number you send in this request must be the same one you verified in the previous API.If you receive a captcha in the response, confirm it via the captcha API before receiving the code.

Attributes

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

Body

ddi
string
required
Country code
phone
string
required
Phone number with area code (e.g.: 4499999999)
method
string
required
Code delivery method: sms, voice or wa_old

Request Body

{
  "ddi": "55",
  "phone": "4499999999",
  "method": "sms"
}

Response

200

success
boolean
Returns true if the code request was sent successfully
captcha
string
Base64 image with captcha code
blocked
boolean
Whether the number is banned or not
retryAfter
number
Time in seconds to wait before requesting a new code
smsWaitSeconds
number
Time to wait before requesting SMS
voiceWaitSeconds
number
Time to wait before requesting voice call
waOldWaitSeconds
number
Time to wait before requesting in-app pop-up
method
string
Code delivery method
Success:
{
  "success": true,
  "retryAfter": 165,
  "smsWaitSeconds": 125,
  "voiceWaitSeconds": 125,
  "waOldWaitSeconds": 125,
  "method": "sms"
}
Blocked number:
{
  "success": false,
  "blocked": true
}

400

Invalid request. Check if the data you are sending matches the documentation.

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