OTP

Send OTP

Send or resend an idempotent email code for an email and purpose.

Copy page
POST/v1/send

Send code

cURL
curl --request POST \
  --url https://api.sendotp.email/v1/send \
  --header "Authorization: Bearer $SENDOTP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"email":"[email protected]","purpose":"report-access"}'

200

The code was accepted for delivery.
{
  "ok": true,
  "expiresAt": 1700000600
}

Overview

Creates a live code when none exists, or emails the same live code again for the same normalized email and purpose. The default live window is 10 minutes.

Authorization

Bearer API keyAuthorizationrequired

Send a server API key in the Authorization header. Browser-origin requests are rejected so keys stay on your backend.

Request

emailstringrequired

Recipient email address. It is trimmed, lowercased, and validated before lookup.

purposestringrequired

Stable flow key such as login, report-access, signup, or account-delete.

Responses

200

The code was accepted for delivery.

{
  "ok": true,
  "expiresAt": 1700000600
}
429

The email and purpose exceeded the account rate limit.

{
  "error": "rate_limited"
}