POST /v1/otp/request Generates and dispatches a new OTP code via WhatsApp to the recipient.
POST
/v1/otp/request
const url = 'https://example.com/v1/otp/request';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"app_ref":"onocuan-app","destination":"+6281234567890","locale":"id"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/otp/request \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "app_ref": "onocuan-app", "destination": "+6281234567890", "locale": "id" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
Request body to generate and send a new OTP code to recipient.
object
app_ref
Optional client application reference.
string | null
Example
onocuan-app destination
required
Recipient phone number in E.164 format (e.g. “+6281234567890”).
string
Example
+6281234567890 locale
Optional template locale (“id” | “en”). Defaults to “id”.
string | null
Example
idResponses
Section titled “ Responses ”OTP generated and delivery initiated
Media type application/json
Response returned upon successful OTP generation and delivery dispatch.
object
expires_at
required
Expiration timestamp in UTC ISO-8601 format.
string format: date-time
otp_id
required
Unique OTP transaction identifier.
string format: uuid
ttl_seconds
required
Expiration validity window in seconds.
integer format: int32
Example
{ "ttl_seconds": 60}Invalid request or validation error
Unauthorized - Invalid API Key
Rate limit exceeded or locked out
Internal server error