Skip to content

API

Verify OTP

Confirm the code the user received in WhatsApp, Telegram or SMS.

Quick Answer

Send phone, code and the same purpose to /otp/verify.

Summary

POST /api/otp/verify with the same phone and purpose as at send. The code is one-time.

Key Takeaways

  • The code is one-time — verifying the same code again is an error.
  • HTTP 429 is possible on frequent attempts.
  • Check the success field in JSON.

Related Questions

Request

curl -sS -X POST "https://cascade.kz/api/otp/verify" \
  -H "Authorization: Bearer $OTP_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"phone":"77001234567","code":"482910","purpose":"verification"}'

Fields

Field Required
phone yes
code yes
purpose no (same as in send)

Responses

Success:

{ "success": true, "message": "Number confirmed" }

Error:

{ "success": false, "message": "Invalid or expired code" }

See send, errors, statuses, documentation.