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 the code for you — the code is sent directly to the user and is never exposed in the API response. Use POST /v3/send when your application needs to supply the code itself, for example when you want to display it in your own UI before delivering it. Both endpoints share the same channel options, optional parameters, and response shape.

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

Request body

Set brand to your product or company name so users immediately recognise the message. 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.

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". Your balance is 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. All other request parameters and response fields are identical to POST /v3/request.
The whatsapp_inbound channel is not supported by POST /v3/send. Use POST /v3/request for WhatsApp Inbound flows.

Additional request field

All fields from POST /v3/request (channel, number, brand, otp_length, ttl, external_id) apply here as well, with the exception that whatsapp_inbound is not a valid channel value.

Examples

Success response


Response field reference

Next steps