Endpoints, parameters, and examples for integrating OTP API Service.
https://otpapi.cam
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your secret API key |
| string | Required | Recipient email address | |
| purpose | string | Optional | Purpose of the OTP (e.g., "signup", "login"). Used in email subject. |
POST https://otpapi.cam/send-otp
Content-Type: application/json
{
"api_key": "your_api_key",
"email": "user@example.com",
"purpose": "signup"
}
{
"status": "success",
"message": "OTP sent successfully"
}
{
"status": "error",
"message": "Rate limit exceeded."
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Required | Your secret API key |
| string | Required | Same email used in send-otp | |
| otp | string | Required | The 6-digit code from the email |
POST https://otpapi.cam/verify-otp
Content-Type: application/json
{
"api_key": "your_api_key",
"email": "user@example.com",
"otp": "482951"
}
{ "status": "verified" }
{
"status": "error",
"message": "Invalid or expired OTP."
}
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.
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<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>
| Code | Meaning |
|---|---|
| 400 | Bad Request — missing or invalid parameters |
| 401 | Unauthorized — invalid API key |
| 409 | Conflict — user already exists |
| 429 | Too Many Requests — rate limit or plan quota exceeded |
| 500 | Server Error — email delivery failed |