POST /v1/otp/validate Validates an end-user submitted OTP code.
POST
/v1/otp/validate
const url = 'https://example.com/v1/otp/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"123456","destination":"+6281234567890","otp_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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/validate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "123456", "destination": "+6281234567890", "otp_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
Request body to validate an end-user submitted OTP code.
object
code
required
Numeric OTP code entered by end user.
string
Example
123456 destination
Target destination phone number in E.164 format.
string | null
Example
+6281234567890 otp_id
Target OTP transaction ID (either otp_id or destination must be provided).
string | null format: uuid
Responses
Section titled “ Responses ”OTP validation attempt processed
Media type application/json
Result of OTP code validation.
object
otp_id
Associated OTP transaction ID.
string | null format: uuid
remaining_attempts
Remaining attempts before lockout (if status is “mismatch”).
integer | null format: int32
status
required
Validation status: “validated”, “mismatch”, “expired”, “locked”, or “already_used”.
string
Example
{ "status": "validated"}Invalid validation parameters
Unauthorized - Invalid API Key
Internal server error