Cascade provides a REST API. Below is a practical minimum in Rust with the reqwest client.
Set OTP_API_TOKEN and OTP_API_DOMAIN in your backend environment. Set OTP_API_DOMAIN to the domain bound to the key, such as example.kz. Send the 4- or 6-digit code the user entered as a string. The verification examples read it from OTP_CODE.
Useful links: API, send, verify, examples, FAQ, pricing, documentation.
Installation
[dependencies]
reqwest = { version = "0.12", features = ["json"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
An official Cascade crate may not exist.
Example
let client = reqwest::Client::new();
let token = std::env::var("OTP_API_TOKEN")?;
let send: serde_json::Value = client
.post("https://cascade.kz/api/otp/send")
.bearer_auth(&token)
.header("X-Cascade-Client-Domain", std::env::var("OTP_API_DOMAIN")?)
.header("Accept", "application/json")
.json(&serde_json::json!({"phone":"77001234567","purpose":"verification"}))
.send().await?.json().await?;
assert_eq!(send["success"], true);
Similarly for /otp/verify. Handle network errors and success=false. See errors, FAQ, sdk.