Read an OTP request's status through the API: pending, verified or expired
The reference for the status address of ArabyBot's OTP API: the five statuses, the response shape, and the refusals.
On this page 7
The short answer
With a GET request to the status address followed by the request id. The response returns its status: pending, verified, expired, consumed or failed, with the number of attempts, when it expires and when it was verified, if it was. It sends nothing and costs nothing.
Also asked as: «اعرف حالة كود التحقق من الكود» · «check otp request status api»
The address and authentication
GET https://app.arabybot.com/wa_otp_api/status/{request_id} Send the OTP app's public key in the header X-Public-Key: ab_otp_…. You create the app in the OTP section of the dashboard, which gives you the public key and a secret shown once. If you switched request signing on for the app, add the header X-Signature: sha256=…, an HMAC-SHA256 of the raw request body keyed with the app secret.
The fields
request_id(required) The request id at the end of the address.
An example request
cURL
curl https://app.arabybot.com/wa_otp_api/status/3f6c2a9e-41b7-4c0d-9a51-7e2b8d4f1c60 \ -H "X-Public-Key: ab_otp_YOUR_PUBLIC_KEY"
PHP
$ch = curl_init('https://app.arabybot.com/wa_otp_api/status/3f6c2a9e-41b7-4c0d-9a51-7e2b8d4f1c60');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-Public-Key: ab_otp_YOUR_PUBLIC_KEY'],
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch); Python
import requests
r = requests.get(
'https://app.arabybot.com/wa_otp_api/status/3f6c2a9e-41b7-4c0d-9a51-7e2b8d4f1c60',
headers={
"X-Public-Key": "ab_otp_YOUR_PUBLIC_KEY",
},
timeout=30,
)
print(r.status_code, r.json()) Node.js
// Node.js 18+
const r = await fetch('https://app.arabybot.com/wa_otp_api/status/3f6c2a9e-41b7-4c0d-9a51-7e2b8d4f1c60', {
headers: {"X-Public-Key": "ab_otp_YOUR_PUBLIC_KEY"},
});
console.log(r.status, await r.json());
The response
200
{ "success": true, "request_id": "3f6c2a9e-41b7-4c0d-9a51-7e2b8d4f1c60",
"status": "pending", "attempts": 1,
"expires_at": "2026-11-16 18:09:10", "verified_at": null } statusis one of: pending, verified, expired, consumed, failed.verified_atstays null until the user verifies.
The refusals
Every refusal comes back as JSON with "success": false, an error_code and a message, plus retry_after in seconds when the cause is a rate limit:
- 404
not_found: No request with this id. - 422
missing_request_id: The request id is missing from the address. - 429: You passed the per-minute request limit.
The limits
This address sends no message and costs nothing, and it has a per-minute request limit generous enough for polling while the user types their code.
The OTP API guide · All APIs for developers
Frequently asked questions
Can I rely on this address instead of the verify address?
No. Checking the code is done with the verify address. This address only reads the status, and suits a waiting page or a monitoring panel.
What does the status consumed mean?
That the request was resolved and no longer takes a code: a new verification against it comes back as already resolved. Request a new code.
Read next
Try the agent before you pay anything
The agent that will answer your customers is the one answering you now: ask it from the chat button here or on WhatsApp. Your account is free with no credit card, and the free trial on your own number or page is activated after you contact our team on customer-service WhatsApp.