Skip to content

POST /otp/send — send OTP

Call POST /api/otp/send from your backend to send a one-time code.

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

Request

Set OTP_API_DOMAIN to the domain bound to the key.

curl -sS -X POST "https://cascade.kz/api/otp/send" \
  -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","purpose":"verification"}'

Fields

Field Required Description
phone yes Recipient phone
purpose no Scenario, default verification
channel no Defaults to auto. Values are whatsapp, telegram, sms, max, and auto
link no URL, shortened and added to the message
link_expires_in no Short link TTL, 60…2592000 sec
locale no OTP text language: ru, kk, or en (defaults to ru)

With channel omitted or set to auto, Cascade tries the enabled channels in the order configured for the API key under Channels. To select a specific enabled channel, use whatsapp, telegram, sms, or max.

For WhatsApp and Telegram, Cascade remembers the sender after a successful send and reuses it while it is available.

Success

{
  "success": true,
  "message": "OTP отправлен через WhatsApp",
  "expires_in": 300,
  "otp_id": 1241,
  "channel": "whatsapp",
  "locale": "ru",
  "credits_charged": 3,
  "short_url": "https://cascade.kz/s/Ab3xK9"
}

The response includes short_url when the request contains link.

A successful response means the send request was accepted. An otp.sent event reports a successful channel send. Device delivery confirmation, where supported, appears separately.

Next: verify, responses, examples, FAQ.