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.
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
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.