Send a one-time code
Sends a one-time code to an email address or phone number and returns the challenge, with what is known about the contact. Codes are valid for five minutes.
Sandbox. On sandbox and development keys nothing is sent. The code is all zeros at the length you asked for (000000 by default) and deliveryChannel is test.
Billing. Nothing is charged for sending. The check is charged when a code is accepted, in production only. In production the send is refused with 402 when your balance cannot cover that charge; the response then also carries required and balance as decimal strings.
Limits. Five codes per destination per hour, and an hourly ceiling per organisation across all destinations.
Countries. Phone codes currently go to Nigerian numbers (+234) only. Other countries are refused with 422 phone_country_not_supported before anything is priced or sent. Email codes work for every country.
Error codes
A missing or unknown key answers 401, where error is a short sentence rather than a code.
Requires a secret (sk_) key. A publishable key receives 403 secret_key_required.
Authentication
Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set flow.run, flow.config.read and verifications.status.read; a scoped secret key reaches what its scopes allow.
Request
The email address or phone number. A phone number in national format is resolved against country.
ISO 3166-1 alpha-2. Resolves national phone formats and selects the price. It is stored and reused when the check is charged.
The preferred phone delivery. whatsapp is accepted and currently delivers by SMS.
Send a code of capital letters and digits (no 0, O, 1, I or L) instead of digits only. It is checked case-insensitively. Outside production the code is still all zeros.
Codes one address may be sent per hour. Values are brought into the range 1 to 5. Defaults to 3. Past it the send answers send_rate_limited.
Email: refuse an address at a personal email service such as Gmail or Outlook before a code is sent. The refusal is invalid_destination with reason corporate_email_required.