Skip to content

Cascade webhooks

Connected webhooks support otp.sent, otp.verified, and otp.failed and are signed using HMAC-SHA256.

On this page
  1. Current integration model
  2. Webhooks

Current integration model

Typical Cascade scenario:

  1. Backend calls POST /otp/send.
  2. User enters the code.
  3. Backend calls POST /otp/verify.
  4. The decision is made from success in JSON.

This is enough for login, registration and operation confirmation.

Webhooks

Contact support about connecting webhooks. For a connected webhook, provide an HTTPS handler on your backend and store the issued secret there.

Event When it fires
otp.sent The channel accepted the message. Device delivery confirmation appears separately where supported
otp.verified The code was verified successfully
otp.failed The send attempt failed

Cascade makes a JSON POST request with id, event, created_at, company_id, and a data object. Use data.otp_log_id to match the event to the send request.

Check X-Webhook-Signature before parsing JSON. Compute the HMAC-SHA256 of the raw request body with the webhook secret, encode it as hex, and prepend sha256=. Compare the result with the header in constant time. X-Webhook-Event contains the event name. Return 2xx after processing.