Skip to main content
Validate a previously issued OTP against the target phone number.
curl --request POST \
  --url https://ses.antryk.com/api/v1/sms/verify-otp \
  --header 'Content-Type: application/json' \
  --data '{
    "accessKey": "YOUR_ACCESS_KEY",
    "secretKey": "YOUR_SECRET_KEY",
    "to": "+1XXXXXXXXXX",
    "serviceId": "YOUR_SERVICE_ID",
    "otp": "USER_OTP"
  }'

Request Parameters

accessKey
string
required
Authentication key generated for verification workflows.
secretKey
string
required
Private secret that must accompany the access key.
to
string
required
Recipient phone number (e.g. +1XXXXXXXXXX) that received the OTP. If a different number is provided the API returns 404 otp_not_found.
serviceId
string
required
Verification service identifier. Missing or invalid IDs return 404 service_not_found.
otp
string
required
The numeric OTP code the user received. Expired or incorrect codes return 400 otp_invalid.

Successful Response

{
  "success": true,
  "message": "Otp Verified Successfully!",
  "data": {
    "valid": true,
    "to": "+1XXXXXXXXXX",
    "status": "verified"
  }
}

Error Scenarios

  • 400 otp_invalid – incorrect or expired otp
  • 404 otp_not_found – no pending OTP for the supplied to + serviceId
  • 401 invalid credentials – authentication failure
  • 410 otp_expired – OTP exists but expiresIn has elapsed
  • 429 rate_limited – too many verification attempts; wait before retrying

Invalid OTP Example

{
  "success": true,
  "message": null,
  "data": {
    "valid": false,
    "status": "pending",
    "to": "+1XXXXXXXXXX"
  }
}
Limit verification retries per user session to prevent brute-force attempts. Lock the service after repeated otp_invalid responses.