Validate using Contact Details
Validate OTP Using Contact Details
Validate a One-Time Password (OTP) that was generated using the Generate OTP Using Contact Details API.
This API verifies an OTP generated for a mobile number and/or email address without requiring a registered User ID.
PrerequisiteGenerate an OTP using the Generate OTP Using Contact Details API and retain the returned
otpUuid.
Endpoint
PUT /v1/otp-using-contact-detailsAuthentication
Authorization: Bearer <access_token>Request Body
| Field | Type | Required | Description |
|---|---|---|---|
otpUuid | string | ✅ | Unique identifier returned by the Generate OTP Using Contact Details API. |
otpValue | string | ✅ | OTP entered by the user. The value must be hashed using the same hashSpec used during OTP generation. |
Example Request
{
"otpUuid": "6c677c1e-e78e-4e19-a77c-1ee78efe1998",
"otpValue": "1f40fc92da241694750979ee6cf582f2..."
}Field Details
otpUuid
The unique identifier returned by the Generate OTP Using Contact Details API. It associates this validation request with a previously generated OTP.
otpValue
The OTP entered by the user. Hash the OTP using the same hashSpec that was used when generating the OTP.
Success Response
The API returns HTTP 200 for both successful and failed validation attempts.
Validation Successful
{
"otpUuid": "6c677c1e-e78e-4e19-a77c-1ee78efe1998",
"validationStatus": "SUCCESS",
"expiryTs": 1739964200556,
"jwt": "<JWT>",
"jwtStatus": "GENERATED"
}| Field | Description |
|---|---|
otpUuid | OTP identifier. |
validationStatus | Validation result. Returns SUCCESS. |
expiryTs | OTP expiry timestamp (Epoch milliseconds). |
jwt | JWT returned when generateJwt=true during OTP generation. |
jwtStatus | JWT generation status (GENERATED or FAILED). |
Validation Failed
{
"otpUuid": "6c677c1e-e78e-4e19-a77c-1ee78efe1998",
"validationStatus": "FAILED",
"attemptsLeft": 8,
"expiryTs": 1740050600556
}| Field | Description |
|---|---|
validationStatus | Returns FAILED. |
attemptsLeft | Remaining validation attempts. |
expiryTs | OTP expiry timestamp (Epoch milliseconds). |
Error Responses
| HTTP Status | Description |
|---|---|
| 400 | Missing mandatory fields. |
| 404 | OTP UUID not found. |
| 422 | Invalid OTP UUID or invalid OTP value. |
Example - Invalid OTP
{
"timestamp": "2025-02-20T09:00:26IST",
"status": 422,
"error": "Invalid data",
"message": "Invalid OTP",
"path": "/v1/otp-using-contact-details"
}Example - OTP UUID Not Found
{
"timestamp": "2025-02-20T09:27:25IST",
"status": 404,
"error": "Data not present.",
"message": "otpUuid not found",
"path": "/v1/otp-using-contact-details"
}Best Practices
- Store the
otpUuidreturned during OTP generation until validation is complete. - Use the same
hashSpecfor hashing the OTP value. - Handle both
SUCCESSandFAILEDresponses, even though both return HTTP 200. - Generate a new OTP when
attemptsLeftreaches zero. - Verify that
jwtStatusisGENERATEDbefore using the returned JWT.
Related APIs
- Generate OTP Using Contact Details
- Check OTP Status
Updated 28 days ago
Did this page help you?
