โ— Verification API v1

One-time passcodes
that just work.

Drop a single REST call into your signup, login or checkout flow and deliver 6-digit codes over email and SMS. Hashed at rest, expired on schedule, rate limited by IP, key and account.

< 300msMedian API response
6-digitCSPRNG generated codes
5 minDefault code lifetime
POST /api/v1/send-otp
curl -X POST https://otp.dearprime.in/api/v1/send-otp \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "otp_live_xxxxxxxxxxxx",
    "email": "user@example.com",
    "mobile": "9876543210",
    "purpose": "signup"
  }'

{
  "success": true,
  "message": "OTP sent successfully",
  "request_id": "REQ_3f2a91c0b7d5e468",
  "expires_in": 300
}
๐Ÿ”

Hashed at rest

Codes are stored as salted SHA-256 digests. Never logged, never shown.

โšก

Instant delivery

SMTP and SMS providers are called synchronously - no queue workers needed.

๐Ÿ“Š

Full visibility

Every request appears in your API log with status, latency and request ID.

๐Ÿ›ก๏ธ

Abuse controls

Per IP, per key, per account and per destination limits enforced in the database.

Features

Everything a verification flow needs

Two endpoints, one dashboard, zero infrastructure to babysit.

๐Ÿ“ง

Email + SMS channels

Send to an email address, a mobile number, or both in the same request.

โฑ๏ธ

Configurable expiry

Code length, lifetime, retry count and resend cooldown are all tunable.

๐Ÿ”

Resend cooldown

A 60 second per-destination cooldown stops accidental double sends.

๐Ÿšซ

Brute-force lockout

Codes lock after the configured number of failed verification attempts.

๐Ÿงพ

Masked OTP logs

Destinations are masked in the UI: 98******10 and us***@example.com.

๐Ÿงช

In-app test console

Fire real requests from your dashboard and inspect the raw JSON response.

How it works

Live in three steps

1

Create your key

Register, open API Keys and generate a cryptographically random secret. It is shown once.

2

Send a code

POST the destination and a purpose to /api/v1/send-otp and store the returned request_id.

3

Verify the code

POST the request_id plus the code the user typed to /api/v1/verify-otp. Done.

verify.php
$payload = [
  'api_key'    => getenv('OTP_API_KEY'),
  'request_id' => $_POST['request_id'],
  'otp'        => $_POST['otp'],
];

$ch = curl_init('https://otp.dearprime.in/api/v1/verify-otp');
curl_setopt_array($ch, [
  CURLOPT_POST           => true,
  CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS     => json_encode($payload),
  CURLOPT_RETURNTRANSFER => true,
]);
$res = json_decode(curl_exec($ch), true);

if (!empty($res['verified'])) {
  // mark the user as verified
}
For developers

Copy, paste, ship

Examples in cURL, PHP and JavaScript for every endpoint.

fetch()
const res = await fetch('/api/v1/send-otp', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    api_key: API_KEY,
    email: 'user@example.com',
    purpose: 'login'
  })
});
const data = await res.json();
console.log(data.request_id);

Predictable responses

Every failure returns a stable machine-readable code with the right HTTP status - never a stack trace.

StatusCode
401INVALID_API_KEY
422VALIDATION_ERROR
429RATE_LIMIT_EXCEEDED
400INVALID_OTP
Security

Built like an auth product

Hashed secrets

API keys and OTP codes are stored as peppered SHA-256 hashes - the plaintext leaves the server once.

Prepared statements

Every query uses PDO prepared statements with emulation disabled.

CSRF + XSS defence

Session-bound CSRF tokens on all forms and strict output escaping everywhere.

Hardened sessions

HttpOnly, SameSite cookies, id rotation on login and periodic regeneration.

Layered rate limits

IP, API key, account, destination and per-code attempt counters.

Audit trails

Admin actions, login attempts and API calls are all recorded.

Pricing

Simple, quota based

Every plan includes both channels, full logs and the test console.

Starter

โ‚น9 / per month
  • 200 verifications / day
  • 3,000 / month
  • Email + SMS channels
  • 1 API key
  • Full API logs
Get started

Scale

โ‚น99 / per month
  • Unlimited daily volume
  • Custom monthly quota
  • Dedicated sender IDs
  • Unlimited API keys
  • Priority support SLA
Get started
FAQ

Common questions

Can I send to email and mobile at once?

Yes. Provide both fields and the same code is delivered on both channels under one request_id.

Where is the OTP stored?

Only a peppered SHA-256 hash is stored. The plaintext code exists in memory for the duration of the send request.

What happens after a wrong code?

The attempt counter increments. After the configured maximum (5 by default) the code is locked and a new one must be requested.

Do I need a queue or cron job?

No. Delivery is synchronous and rate limiting is stored in MySQL, so the platform runs on ordinary shared hosting.

Can I bring my own SMS provider?

Yes. The SMS layer is an interface - configure any provider REST endpoint in the admin panel or add a class for it.

Start verifying in five minutes

Create an account, pick a plan, generate a key and send your first code today.