Skip to main content

Statuses and error handling

Verification statuses

Every session has a status. It changes as the verification proceeds:

StatusWhat it meansWhat to do
sentVerification initiated, waiting for the userPoll the status
deliveredCode/call delivered to the userPoll the status
verifiedNumber confirmedLet the user through
expiredSession TTL elapsed (expires_at)Offer to start over
failedVerification could not completeOffer another method or retry

verified, expired and failed are terminal — no need to poll the session after them.

HTTP response codes

CodeWhenReaction
201Verification created successfullyShow the number / ask for the code
200Successful status, balance or code-check request
400Bad request: wrong code, bad number format, expired sessionShow the user a clear error
401Wrong api_key / api_secretCheck the credentials
402Insufficient balanceTop up the balance
404No session with that request_idCheck the identifier

The error body uses the Problem Details format:

{
"type": "https://verificahub.ru/errors/insufficient-funds",
"title": "Insufficient funds",
"status": 402,
"detail": "Not enough balance to initiate the verification."
}

Recommendations

  • Timeouts. If a session reaches expired, don't try to "push it through" — create a new one.
  • Idempotency on your side. Store the request_id and don't create a new verification while the current one is active.
  • Clear messages. On 400 during code entry, show "Invalid code" and let the user request a new one.
  • Balance monitoring. Catch 402 and warn about a low balance in advance — see Balance and usage.