Skip to main content
POST
Create and dispatch a PIN
This is the call that starts a verification. OneXtel generates the PIN, substitutes it into the template’s content for each channel you asked for, and dispatches to all of them in parallel — then returns a pinId and what each channel did. Hold on to the pinId. It is what you verify against, and what you resend on. The code itself is never returned to you and never stored in the clear.
Omit channels to send on the template’s default channel. Pass it to override — every channel you name must already have a channel account configured on that template, or the call fails with channel_not_configured.

Partial success

A 201 means at least one channel accepted the message, not all of them. Read channels[] to see which:
Response — SMS accepted, WhatsApp rejected
Only when every requested channel is rejected do you get 502 dispatch_failed. So do not retry on a 201 — the user has a code.
Always send the Idempotency-Key header on this call. Without it, a network timeout you retry will dispatch a second PIN and invalidate the first, and the user will be typing a code that no longer verifies. See Idempotency.

Authorizations

Authorization
string
header
required

An API key from the OneXtel portal, Developers → API Keys, sent as Authorization: Bearer <key>.

Headers

Idempotency-Key
string

Protects a send/resend against duplicate dispatch on retry. Replaying the same key + body within 24h returns the original response verbatim; the same key with a different body is rejected (idempotency_key_reuse); a concurrent request with the same key still in flight is rejected (idempotency_in_progress).

Body

application/json
destination
string
required

Destination, exactly as the active provider expects it — never reformatted.

Required string length: 1 - 64
Example:

"+919876543210"

templateId
string
required

The template to send under.

Minimum string length: 1
Example:

"tpl_abc123"

channels
enum<string>[]

Channels to dispatch on. Omit to use the template's default channel.

Minimum array length: 1
Available options:
sms,
whatsapp,
email
Example:
referenceId
string

Optional caller-supplied correlation id, searchable in Verifications.

Required string length: 1 - 200
Example:

"order_1234"

templateParams
object

Per-send override for a WhatsApp template's non-OTP placeholders, by position. Omitted positions fall back to the template's stored default.

Example:

Response

At least one channel accepted the message.

pinId
string
Example:

"pin_x9k2m1qz"

status
enum<string>
Available options:
PENDING,
VERIFIED,
EXPIRED,
BLOCKED
Example:

"PENDING"

expiresAt
string<date-time>
Example:

"2026-08-04T10:22:03.221Z"

attemptsRemaining
integer
Example:

3

channels
object[]