Verify a one-time password (OTP) sent to a user’s phone number for secure authentication and validation. This endpoint is used to confirm OTPs during login, signup, multi-factor authentication (MFA), and transaction verification flows. It ensures that the OTP entered by the user matches the one issued and is still valid. Authentication is handled via secure headers, ensuring your credentials remain protected and are never exposed in the request body.Documentation Index
Fetch the complete documentation index at: https://docs.antryk.com/llms.txt
Use this file to discover all available pages before exploring further.
For Node.js applications, it is recommended to use the official
@antryk/sdk. The SDK simplifies
OTP verification by handling authentication, validation, and error handling
internally.Authentication is handled via headers (
x-access-key, x-secret-key). The
request body should only include OTP verification data such as phone number,
service ID, and the OTP code.New OTP Verification Approach (Recommended)
This is the recommended and modern approach for verifying OTPs:- Authentication is passed via headers instead of request body.
- Request body contains only verification-related fields.
- Improved security and cleaner API design.
- Easier integration across backend services.
⚠️ The older approach (sending
accessKey and secretKey in the request
body) may still work for backward compatibility, but it is strongly
recommended to migrate to header-based authentication.Request Parameters
Your Antryk access key used for authentication.
Your Antryk secret key used to authorize the request securely.
The phone number (in E.164 format, e.g.
+919876543210) that received the
OTP.UUID v4 identifier of your configured SMS verification service.
The OTP code entered by the user. Must be a 4–10 digit numeric value.
Examples
Example: YOUR_ACCESS_KEY
Example: YOUR_SECRET_KEY
Example: +919876543210
Example: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
Example: 482193
Additional Notes
- OTP verification is a critical step in authentication workflows.
- Ensure that verification is performed securely on the backend.
- Avoid exposing sensitive validation logic on the frontend.
- Use retry limits and session-based controls to enhance security.
- SDK usage is recommended for simplified integration and consistent error handling.
Response
Returns a JSON object indicating whether the OTP is valid and verifiedError Scenarios
- 400 otp_invalid – Incorrect or invalid OTP entered
- 404 otp_not_found – No pending OTP found for the given number and service
- 401 invalid_credentials – Invalid x-access-key or x-secret-key
- 410 otp_expired – OTP exists but has expired
- 429 rate_limited – Too many verification attempts in a short time

