Skip to main content
POST
Send a one-time passcode

Authorizations

Authorization
string
header
required

Your API key, e.g. sk_live_... or sk_test_....

Headers

Idempotency-Key
string

Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.

Maximum string length: 255

Body

application/json
to
string
required
Maximum string length: 32
mode
enum<string>

Defaults to managed.

Available options:
managed,
delivery_only
code
string

Required for delivery_only.

Required string length: 4 - 10
Pattern: ^\d+$
template_name
string

An approved authentication template. Defaults to the workspace's configured OTP template. Without one, a code can only go as plain text while the recipient has messaged you in the last 24 hours; otherwise the request is refused with otp_template_required.

Maximum string length: 128
phone_number_id
string
Maximum string length: 64
connection_uuid
string<uuid>
language
string

The template language. Defaults to the template's only language in this workspace, and otherwise to the configured default.

Maximum string length: 15
Pattern: ^[a-z]{2,3}(_[A-Za-z]{2,4})?$
Example:

"en"

client_ip
string<ip>

Your end user's IP address. When given, one address may request codes for a limited number of different numbers an hour. Without it that rule is skipped, so a server sending every sign-in from one address is not capped.

Response

Sent.

id
string | null
to
string | null
status
string
expires_at
string<date-time> | null
mode
enum<string>
Available options:
managed,
delivery_only
message_uuid
string | null

Present in delivery_only mode.