Skip to content

POST /otp/verify — verify code

Verify the one-time code the user received.

On this page
  1. Request
  2. Fields
  3. Responses

Request

Use the same API key, phone number, and purpose as for the send. Submit the received code as a string of 4 or 6 digits according to the key setting.

Set OTP_API_DOMAIN to the domain bound to the key. For verification, set OTP_CODE to the code received in the message.

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

Fields

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

Responses

Success:

{ "success": true, "message": "Номер подтверждён" }

Error:

{ "success": false, "error_code": "invalid_code", "message": "Неверный или просроченный код" }

See send, errors, statuses, documentation.