Lewati ke konten

POST /v1/otp/request Generates and dispatches a new OTP code via WhatsApp to the recipient.

POST
/v1/otp/request
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" }'
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
id

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