Lewati ke konten

POST /v1/otp/validate Validates an end-user submitted OTP code.

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

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