Documentation

Verify OTP

POST https://otp.dearprime.in/api/v1/verify-otp

Checks a code against the request ID returned by send-otp. A successful verification consumes the code, so it cannot be replayed.

Parameters

FieldTypeRequiredNotes
api_keystringYes**Or the X-API-Key header.
request_idstringYesThe ID returned by send-otp.
otpstringYesThe code the user entered.

Request

{
  "api_key": "YOUR_API_KEY",
  "request_id": "REQ_8F2A1C4B9D",
  "otp": "123456"
}

Success - 200

{
  "success": true,
  "verified": true,
  "message": "OTP verified successfully"
}

Failures

CodeHTTPMeaning
VALIDATION_ERROR422request_id or otp missing / malformed.
REQUEST_NOT_FOUND404Unknown request ID, or it belongs to another account.
OTP_EXPIRED410The code passed its expiry window.
ALREADY_VERIFIED409This request was already verified.
INVALID_OTP401Wrong code; attempts remaining are decremented.
MAX_ATTEMPTS_REACHED429Attempt limit for this request exhausted - send a new code.
RATE_LIMIT_EXCEEDED429Too many verify calls from this IP for the same request.

Failed responses include "verified": false alongside the error object.

Next: Error codes