OTP Auth Request

Send a one-time password (OTP) to a recipient. TextPeak generates the code, delivers it using your OTP settings, and returns a request_uuid.

Channels and fallback. Your OTP settings list the channels to try in order (SMS, WhatsApp Business, voice, Telegram). When a channel fails to deliver, the next one is tried automatically. provider pins one channel for a single attempt instead.

Resending. While a code is active, a second request for the same recipient returns 409. Send retry: true to resend on the next channel — the request_uuid stays the same. When no channels are left, retry returns 409 too.

Your end user's IP. Pass client_ip when you call from your backend, so the per-IP limit applies to your user rather than to your server.

Configured in your OTP settings (not request fields): code length (default 5 digits), how long a code stays valid (default 300 seconds), how many codes a recipient may request (default 10) and from one IP, how many wrong codes are allowed (default 5), and the cool-down that resets those counters (default 1800 seconds).

Errors. 401 invalid token · 402 balance depleted · 403 blocked · 409 code already active, or nothing left to retry · 422 invalid phone number or provider · 429 too many requests for this recipient or IP. Errors use the standard error envelope.

Authentication: OTP token (the stream token of an OTP stream) in the Authorization header (see Authentication in the API Overview).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

The phone number to send the code to, in international format.

Your end user's IP address. Used for the per-IP request limit. Defaults to the IP address of the server calling the API, so set it when you call from a backend.

Resend while a code is still active: the code goes out again on the next channel of your OTP settings, under the same request_uuid. Without retry, a second request for the same recipient returns 409.

enum

Send on this one channel instead of the configured channel order. It must be one of your configured channels. A pinned request is a single attempt: no fallback to other channels, and it cannot be retried.

Message template for the code, by its eventKey. Defaults to the template in your OTP settings.

object | null

Extra template values. When your OTP settings say you generate codes yourself, template_variables.code is the code to send and is required.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json