Skip to main content
Use POST /v3/send when your system generates the OTP code and you want OTP.ID to handle only delivery. This is identical to POST /v3/request in every other respect — same channels, same response shape, same error codes — except you must supply the code in the otp field and the whatsapp_inbound channel is not supported. The code you supply is delivered to the user and is never echoed back in any API response.

Endpoint

Request Headers

Request Body

string
required
The OTP code to deliver. Must contain digits only and be between 4 and 8 characters long. Example: "482913".
string
required
The delivery channel for the OTP. Accepted values: whatsapp, sms, email, misscall.
The whatsapp_inbound channel is not supported by this endpoint. Passing whatsapp_inbound returns 400 INVALID_CHANNEL. Use POST /v3/request for inbound flows.
string
required
The destination phone number or email address.
  • Phone numbers: digits only, minimum 10 characters (e.g. "6281234567890")
  • Email: a valid email address (e.g. "user@example.com")
string
The brand name included in the OTP message. Defaults to the brand_name configured on your merchant account.
integer
Ignored when otp is provided — the length is inferred from the otp value you supply. Included for API compatibility; has no effect.
integer
Time-to-live in seconds before the OTP expires. Accepted range: 60900. Defaults to 300 (5 minutes). Values outside this range are clamped to the nearest bound — not rejected.
string
Your own idempotency key for this transaction. If you resubmit the same external_id, OTP.ID returns the original otp_id without resending the message and without changing your balance.

Response Fields

string
The unique transaction ID assigned by OTP.ID. Use this in POST /v3/verify and GET /v3/otp/{otp_id}.
string
Current delivery status: sent / success when delivered, failed if vendor delivery failed.
string
The channel used to deliver the OTP, echoed from your request.
string
The destination address used, echoed from your request.
integer
Transaction cost in IDR. Present even when delivery fails; no balance deduction occurs on failure.
integer
Your account balance in IDR after this transaction. Unchanged if delivery failed or if this was an idempotency replay.
string
The datetime at which this OTP expires, in YYYY-MM-DD HH:MM:SS format (WIB, UTC+7).

Examples

SMS

Success response:

WhatsApp

Success response:
The OTP code you sent is never returned in the response — you already know it on your side. Store it securely if you need to reference it later (e.g. for audit logs), but never log it in plaintext.

Error Responses

All errors follow the shape {"success": false, "data": null, "error": {"code": "...", "message": "..."}}. Example — otp validation error: