Skip to content

Validate OTP

POST {api-url}/validateOTP?ns={community}

Use this endpoint to verify an OTP string provided by a user. The State parameter must strictly match the Reference string that was passed into the /sendOTP call.

Once an OTP is successfully validated via this endpoint, it is immediately cleared from the user’s account and becomes invalid. This allows integrators to securely build their own custom OTP-gated flows using the Celbux platform.

FieldTypeRequirementDescription
UsernameStringRequiredThe username of the user.
IDNumberStringOptionalThe ID number of the user.
OTPStringRequiredThe 6-digit OTP string provided by the user.
StateStringRequiredThe Reference string used when generating the OTP.
MetadataStringOptionalAny other detail to store with this transaction.
{
"Username": "27820000000",
"IDNumber": "",
"OTP": "789230",
"State": "REF123",
"Metadata": ""
}
Terminal window
curl -X POST '{api-url}/validateOTP?ns={community}' \
-H 'Authorization: bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"Username":"27820000000","IDNumber":"","OTP":"789230","State":"REF123","Metadata":""}'