Skip to main content
OTP.ID gives you two ways to deliver a one-time password to your users. Use POST /v3/request when you want OTP.ID to generate or create the OTP transaction for you. Use POST /v3/send when your application needs to supply the code itself for message-based outbound channels. Missed Call and WhatsApp Inbound are request-only flows.

Option A: Server-generated code — POST /v3/request

When you call this endpoint, OTP.ID generates a numeric code, delivers it to the user over the channel you choose, and returns a transaction record. The code itself is never included in the response — only the user receives it.
The OTP code is never returned in the API response. OTP.ID delivers it directly to the user over the requested channel. Your server only ever sees the otp_id transaction reference.

Supported channels

Need channel-specific rules or UI details? See the WhatsApp guide, SMS guide, Email guide, Missed Call guide, and WhatsApp Inbound guide.

Request body

The legacy number field is still accepted for backward compatibility, but destination is the recommended field for all new integrations because it can represent either a phone number or an email address without ambiguity.
Set brand to your product or company name so users immediately recognise message-based OTPs. For example, "brand": "TokoKita" produces a message like “Your TokoKita verification code is 482913”. If you leave it out, OTP.ID falls back to the brand_name configured in your account settings. For misscall, omit brand because verification comes from the caller ID, not a message body.

Examples

Success response

A 200 OK response with "status": "sent" means the message was accepted for delivery.

Failed delivery response

When a delivery attempt fails (for example, the number is unreachable), OTP.ID still returns HTTP 200 with "status": "failed". Credits are not deducted for failed deliveries.
When status is "failed", last_balance is not reduced. Check status in your application code and decide whether to retry on a different channel.

Option B: Client-supplied code — POST /v3/send

Use this endpoint when your application generates the OTP code. Include your code in the otp field and OTP.ID will deliver it for you.
POST /v3/send supports only whatsapp, sms, and email.
The misscall and whatsapp_inbound channels are not supported by POST /v3/send. Use POST /v3/request for both flows.

Additional request field

Use the same common fields as POST /v3/request where applicable: channel, destination, and brand. otp_length is ignored because the length is inferred from the otp value you provide.

Examples

Success response


Response field reference

Next steps