Documentation

OTP API overview

Two JSON endpoints handle the whole flow: create and deliver a code, then verify it. Every request is authenticated with an API key from your dashboard.

Base URL

https://otp.dearprime.in/api/v1

Endpoints

MethodPathPurpose
POST/api/v1/send-otpGenerate and deliver a one-time passcode
POST/api/v1/verify-otpCheck a code against a request ID

Only POST is accepted; anything else returns METHOD_NOT_ALLOWED (405). Send Content-Type: application/json.

Quickstart

curl -X POST https://otp.dearprime.in/api/v1/send-otp \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_API_KEY","email":"user@example.com","purpose":"login"}'
curl -X POST https://otp.dearprime.in/api/v1/verify-otp \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_API_KEY","request_id":"REQ_XXXX","otp":"123456"}'

Response shape

Every response is JSON with a boolean success field. Failures also carry an error object.

{
  "success": false,
  "error": { "code": "INVALID_OTP", "message": "The code entered is incorrect." }
}

Quotas and rate limits

  • Daily and monthly verification quotas are set per account by your plan; the administrator can override them.
  • Per-IP and per-key request limits apply to every endpoint. When a limit is hit the API returns 429 with a Retry-After header.
  • Repeat sends to the same destination are blocked for a short cooldown window (RESEND_COOLDOWN).
  • X-RateLimit-Remaining is returned on authenticated calls.

Next: Authentication