Verify an OTP
POST https://api.telrioz.com/api/v1/otp/verify
Checks the code the person typed against the OTP you sent. A wrong, expired or used code still answers 200, with verified false and the reason. With a Gateway key, only that Gateway's OTPs verify: any other id answers 404 not_found.
Authentication
Send your key in the header Authorization: Bearer YOUR_API_KEY. See Authentication.
| Name | Type | Description |
|---|---|---|
idrequired | string | The id POST /otp returned, with a key of the same account (a Gateway key: of the same Gateway). |
coderequired | string | The digits the person received. |
Limits
- 10 requests a second per account, counted over all its keys.
See Limits.
Responses
200
The answer.
Fields of the 200 answer Name Type Description verifiedrequiredbooleanWhether the code is right. A right code verifies once.
reasonstringOnly when verified is false, checked in this order: already_verified (this OTP was verified before), too_many_attempts (after 3 wrong codes it no longer verifies), expired (past expiresAt), invalid_code (wrong code; it counts as an attempt). One of: already_verified, too_many_attempts, expired, invalid_code.
verified: Right code { "verified": true }wrong: Wrong code { "verified": false, "reason": "invalid_code" }400
invalid_request: The body is not JSON or a field is wrong; message says which. Read message, correct that field and send again.Error codes:
invalid_requestinvalid_request: The body is not JSON or a field is wrong; message says which. { "error": "invalid_request", "message": "code: the digits the recipient received" }401
unauthorized: No Bearer key, or a key we do not know. Send the header Authorization: Bearer <key> with a key from Developers โ Credentials.key_disabled: The key is switched off. Switch the key on in Developers โ Credentials, or use another key.key_expired: The key is past its last day (WIB). Make a new key, or ask your admin to move the key's expiry date.Error codes:
unauthorized,key_disabled,key_expiredunauthorized: No Bearer key, or a key we do not know. { "error": "unauthorized" }key_disabled: The key is switched off. { "error": "key_disabled", "message": "This key is disabled" }key_expired: The key is past its last day (WIB). { "error": "key_expired", "message": "This key expired after 2026-10-31" }403
ip_not_allowed: The request is not from one of the key's allowed IPs. Ask your admin to add this IP to the key's Allowed IPs, or remove the limit.not_active: The account is not active yet. Sign in to the portal and set your password, and finish what the welcome email asks (verify your WhatsApp number, or top up), then try again.suspended: The account is suspended. Contact Telrioz support.Error codes:
ip_not_allowed,not_active,suspendedip_not_allowed: The request is not from one of the key's allowed IPs. { "error": "ip_not_allowed", "message": "Requests from 203.0.113.7 are not allowed with this key" }not_active: The account is not active yet. { "error": "not_active" }suspended: The account is suspended. { "error": "suspended" }404
not_found: No such id on this account, or no such path under /api/v1. Check the path, and that the id is the one the send call returned and the key belongs to the same account.Error codes:
not_foundnot_found: No such id on this account, or no such path under /api/v1. { "error": "not_found" }429
The limit is 10 requests per second per account, counted over all its keys.
rate_limited: More than 10 requests a second on this account. Wait a second and send again; space calls out, or send many numbers in one call.Error codes:
rate_limitedrate_limited: More than 10 requests a second on this account. { "error": "rate_limited" }500
internal: Something failed on our side. Try again; if it keeps happening, contact Telrioz support.Error codes:
internalinternal: Something failed on our side. { "error": "internal" }