API Documentation

Endpoints, parameters, and examples for integrating OTP API Service.

Base URL: https://otpapi.cam
POST /send-otp Generate and email an OTP
ParameterTypeRequiredDescription
api_keystringRequiredYour secret API key
emailstringRequiredRecipient email address
purposestringOptionalPurpose of the OTP (e.g., "signup", "login"). Used in email subject.
Request
POST https://otpapi.cam/send-otp
Content-Type: application/json

{
  "api_key": "your_api_key",
  "email":   "user@example.com",
  "purpose": "signup"
}
Responses
{
  "status":  "success",
  "message": "OTP sent successfully"
}

{
  "status":  "error",
  "message": "Rate limit exceeded."
}
POST /verify-otp Verify a provided OTP
ParameterTypeRequiredDescription
api_keystringRequiredYour secret API key
emailstringRequiredSame email used in send-otp
otpstringRequiredThe 6-digit code from the email
Request
POST https://otpapi.cam/verify-otp
Content-Type: application/json

{
  "api_key": "your_api_key",
  "email":   "user@example.com",
  "otp":     "482951"
}
Responses
{ "status": "verified" }

{
  "status":  "error",
  "message": "Invalid or expired OTP."
}
White-Label Branding

OTP API Service allows you to customize the branding for the emails sent to your customers. You can set your own Business/App Name and Custom HTML Template directly from the Branding Settings in your dashboard.

Custom Template Logic

If a template is saved in your dashboard, our API will prioritize it over our system default. You must use the following placeholders in your HTML to inject dynamic data:

  • {{otp}} — The 6-digit verification code
  • {{brand}} — Your custom app name
  • {{name}} — Recipient's email/name
  • {{purpose}} — The purpose of verification
Example Custom HTML Template
<div style="background:#f9f9f9; padding:20px;">
  <h1>Welcome to {{brand}}!</h1>
  <p>Hello, your verification code is:</p>
  <div style="font-size:30px; font-weight:800;">{{otp}}</div>
</div>
HTTP Error Codes
CodeMeaning
400Bad Request — missing or invalid parameters
401Unauthorized — invalid API key
409Conflict — user already exists
429Too Many Requests — rate limit or plan quota exceeded
500Server Error — email delivery failed