Verify profiles: fallback chains and advanced factors
A verify profile is a reusable, tenant-owned configuration object that controls how OTP verifications behave: which channels the code travels on, how long the code is, how long it stays valid, how many wrong guesses are allowed, and what the message says. You create a profile once, then pass itsprofile_id on every /verify/send call that should follow those rules.
This guide walks through the profile lifecycle end to end — create a profile, attach an ordered fallback chain, customize code length, TTL, and templates, send and check a code against it — and then covers the factor suite (push, TOTP, passkey, voice biometrics) that runs alongside OTP profiles.
Everything below is under your control as the tenant. Profiles only apply to API keys and verifications in your own organization; nothing here is mandated by the platform.
Before you start
- A live API key (
dv_live_sk_…). Profiles are write-guarded: the key must carry theverify:writescope (dashboard callers need an owner, admin, or developer role). - The channel providers you plan to use must be connected first. A profile that lists
whatsappis rejected withWHATSAPP_NOT_CONNECTEDuntil a WhatsApp Business Account finishes onboarding;voice,telegram,viber, andemaileach require their own provider configuration. Keep the chain to channels your tenant can actually deliver on — the API rejects a profile that references an unconnected channel with a422 VALIDATION_ERRORnaming the channel.
1. Create a verify profile
POST /api/v1/verify/profiles creates the profile. Minimum viable body:
id (format vprof_<hex>) — you pass it as profile_id on /verify/send.
Profile fields
Update any subset of these later with
PATCH /api/v1/verify/profiles/{id}; delete with DELETE. The /configs paths are an alias of /profiles with identical behavior — use whichever your integration already references.
Profile usage is optional everywhere. A
/verify/send call with no profile_id falls back to platform defaults (6-digit code, 600s TTL, 3 attempts, channel chosen per send). Profiles exist so you can pin behavior once instead of repeating per-send parameters.2. Channel fallback chains
Thechannels array is the fallback chain. By default, the order you author is the order the engine walks: index 0 is the channel the first send attempt uses, and the rest are tried in order when the previous channel cannot deliver. (If you enable costOptimization on the profile, the engine can reorder or trim the candidate chain before the first attempt; see Least-cost cascade optimization and spend cap.)
How attempts advance
Fallback advances are asynchronous. The initial/verify/send call fires only the first channel. A background engine then advances through the remaining channels when either condition trips:
- Delivery failure — the provider for the current channel rejected or failed the outbound message.
- Timeout — no successful delivery confirmation within
channel_timeout_seconds(configurable per send viafallback_config, 10–600s, default 60s).
sms, whatsapp, email, voice, viber, telegram, rcs, flashcall. Factor-style channels (totp, push, passkey ceremonies, backup_code, sna, magic_link) have their own endpoints (§4) and do not participate in the async chain.
Voice in the chain requires a voice template
Ifvoice appears anywhere in channels, the profile must carry a templates.voice script containing the {{code}} placeholder. The voice OTP is read aloud by a TTS greeting, so the template is the script the recipient hears. Saving a voice-bearing profile without one is rejected:
Watching a chain run
Subscribe toverification.fallback_triggered to observe each advance — one event per channel hop, carrying the channel just entered and its chain index. verification.fallback_exhausted fires when every channel in the chain failed without an approval; treat it as a hard failure and surface a “verify another way” prompt to the user. Both events, plus the rest of the verification.* set, are listed in the webhook events reference.
Least-cost cascade optimization and spend cap
WhencostOptimization is unset or enabled is not true, everything above holds exactly: the authored channels order is tried as written. The optimizer is a per-profile, tenant-owned opt-in. When you enable it, Orbit ranks the verification’s candidate channels by your organization’s own resolved per-channel price (your rate card and overrides, read at send time purely for ranking; billing still charges per attempt on the channel that actually sent), and maxCascadeCostCents bounds how much one verification’s entire fallback walk may estimate to. Neither field changes the billed price of any channel.
What enabled: true changes
The send path still builds the same candidate chain (your per-send channel first, then the remaining profile entries), but before the first attempt it sorts that chain cheapest-first:
- Ranking uses your resolved prices, so two organizations with different overrides can see different orders for the same profile. Channels that resolve to the same cost for you keep their authored relative order, which makes the result stable and keeps your authored order meaningful where your prices genuinely tie.
- The same profile can therefore send on a different channel than index 0. Reordering is a property of the profile, not of a particular send: every send bound by the profile candidates the chain in ranked order.
- If your profile has
fraud.channelEscalationenabled and a send steps up, the fraud guard’s security ordering always wins: the cost ranking sorts only within each security tier and never re-promotes a demoted weak channel ahead of the step-up factor.
Capping cascade spend with maxCascadeCostCents
Set maxCascadeCostCents to a positive integer number of cents (the API validates 1–100,000). After ranking, the engine walks the ranked chain and drops the costliest tail once the running total of estimated costs would exceed the cap:
- Dropped channels are simply never attempted on that verification.
- Omit the field to reorder without a cap.
- The cheapest channel is always kept, even if it alone exceeds the cap. A verification is never stranded with zero channels because the cap was set too tight.
Worked example
A 5-channel profile with these resolved costs for your organization:
With
costOptimization: { enabled: true, maxCascadeCostCents: 6 }:
- Reorder cheapest-first:
sms(1) →flashcall(2) →email(3) →sna(4) →voice(9). - Apply the cap: keep
sms(running total 1),flashcall(3),email(6). Addingsnawould reach 10 > 6, sosnaandvoiceare dropped from the tail.
sms → flashcall → email with an estimated cascade cost of 6 cents. The authored chain on the profile is unchanged: the optimizer derives the candidate order per send, prices move, and no other profile you own is affected.
Observing the channel actually used
The effective order is visible per verification after the fact, without enabling anything:- The
/verify/send(and/verify/check) response carrieschannel, the channel that actually delivered. When the profile’s optimizer or fallback moved the verification off your first choice,fallback_attemptedistrueandfallback_attemptslists every channel tried, in the order tried, each with its outcome. GET /verify/verifications/{id}/detail(the dashboard’s verification drawer) exposes the same picture aschannelAttemptsandfallbackChain.- The
verification.fallback_triggeredwebhook event fires once per hop with the channel just entered, so you can log the climbed chain in real time and reconcile it against your own per-channel spend expectations.
Interplay with per-send channel and the fraud ladder
- A
channelyou pass on the send body still enters the candidate chain first, like any other authored chain, and is then ranked with the rest when the optimizer is on. If you need one specific channel tried first for a particular send, keep the optimizer off for that profile or pass a single-channel chain. - The fraud guard is independent. Its step-up verdicts run first, and the cost pass ranks within the guard’s security tiers, never across them.
costOptimizationwill neither undo a step-up nor reopen a channel the guard suppressed.
Enabling it on a profile
Both fields patch like any other profile setting:200 with the profile object (echoing costOptimization as saved) confirms it; sends bound by that profile_id pick the policy up from the next send. Setting enabled: false (or deleting the field with a partial update) restores the authored-order behavior immediately.
When to leave it off. If your chain’s order encodes success rate or user experience rather than cost. For example, a step-up flow where the most reliable factor must lead, or a flow where SMS before voice is a deliberate UX choice. Reordering by price can move a cheaper-but-slower or cheaper-but-less-reliable channel to the front. The spend cap is also a poor fit when the last leg must always be reachable (such as voice for users who cannot receive text): tail-drop removes exactly those expensive last resorts. If you want cost visibility without reordering, leave costOptimization unset and read fallback_attempts / channelAttempts to see what each verification actually spent its walk on.
3. Code length, TTL, and templates
Code length and TTL
codeLength accepts only 4, 6, or 8 digits; expirySeconds is 30–3600 seconds. Short codes with short TTLs fit high-traffic login flows where you want the verification row to expire fast; longer codes with longer TTLs fit email-delivered OTPs and lower-frequency flows where a recipient might take minutes to switch apps.
The TTL shows up on the send response as expires_at. After that moment, /verify/check returns EXPIRED_TOKEN (410) and the row can no longer be approved — create a fresh verification rather than re-checking.
Per-channel templates
templates is a map of channel name → message body. Each body may reference these placeholders, resolved at send time:
Any other
{{…}} token is delivered verbatim (it is not substituted), so a typo in the placeholder name silently reaches the recipient.
4. Push factor, TOTP, and passkeys
Beyond OTP delivery, Verify ships factor endpoints for proof-of-possession MFA. These have no carrier delivery and no wallet charge — they validate a device-held secret instead of a code in transit. All factor endpoints are per-tenant and API-only by design (enroll, verify, and revoke from inside your own application where the end user is present).
TOTP and backup-code write operations require the
verify:write scope. Backup codes are the natural recovery leg for users enrolled in any other factor who lose their device.
The Verify overview lists every endpoint in each factor suite with its method and path.
5. Voice biometrics (optional)
Voice biometrics is an optional, separate surface under/api/v1/verify/voice-biometrics that verifies a caller by their voiceprint rather than by a code. It is independent of OTP profiles — you use it alongside them, not inside a fallback chain.
The flow is two calls:
- Enroll —
POST /api/v1/verify/voice-biometrics/enrollcaptures a caller’s voice samples and builds a voiceprint (id returned; pollGET /enroll/{id}for status). - Verify — on a later call,
POST /api/v1/verify/voice-biometrics/challengeissues a challenge phrase, thenPOST /api/v1/verify/voice-biometrics/verifyscores the fresh sample against the enrolled voiceprint.
PATCH /api/v1/verify/voice-biometrics/settings; GET /overview summarizes fleet state. The full endpoint shapes are in the voice biometrics API reference.
6. Send and check against the profile
With a profile created, pass its id on send:channel you pass on the send body is tried first; on a delivery rejection the remaining profile chain entries are tried in profile order. Passing a channel that is not in the profile’s chain tacks it on front of the chain rather than erroring — pass the chain’s first entry to keep behavior aligned with the profile as designed.
Check the code exactly as you would without a profile:
status: "approved" means the profile’s rules passed end to end. The full send/check error matrix (attempts_remaining, expiry, resend semantics) is covered in Verify integration without our SDK.
Troubleshooting
See also
- Fallback chains unified guide — how Verify-profile step-up chains compare with campaign
channels[]ladders and per-messagecascade_policy. - Verify overview — channel catalog, send/check reference, MFA factor endpoint list.
- Verify integration without our SDK — the plain-HTTP send/check flow, webhooks, rate limits, and error envelope.
- Verify API reference — every endpoint including profile CRUD.
- Voice biometrics API reference — enroll / challenge / verify shapes.