Documentation version: Latest (v1)

API endpoint

Send instant OTP

Generates and sends OTP immediately over SMTP in request cycle.

POST/api/v1/instant-otp/send

Auth: Bearer public OTP token OR server API key with server_otp scope

Required headers

HeaderRequiredValueDescription
AuthorizationYesBearer <token>API key, server OTP key, or public OTP token depending on endpoint.
Content-TypeYesapplication/jsonAll POST requests expect JSON payloads.

Request body

FieldTypeRequiredDescription
emailstringYesTarget email.
fromstringNoFrom address override.
subjectstringNoOTP email subject.
verificationLinestringNoInstruction line before code.
expiresInSecondsnumberNo60-3600, default 600.
otpDigitsnumberNo4-10 digits, default 6.

Code examples (all supported languages)

Snippets use placeholder tokens. Replace them with real credentials from your dashboard.

curl -X POST "https://risumail.risu.in/api/v1/instant-otp/send" \
  -H "Authorization: Bearer risu_otp_PUBLIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","expiresInSeconds":600,"otpDigits":6}'

Response schema

Canonical schema inferred from the documented success payload. Copy this block when generating typed clients.

{
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "required": [
        "sessionId",
        "expiresAt",
        "email",
        "sent"
      ],
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "sent": {
          "type": "boolean"
        }
      }
    }
  }
}

Success response example

{
  "success": true,
  "data": {
    "sessionId": "otp_sess_01J...",
    "expiresAt": "2026-04-19T11:50:00.000Z",
    "email": "user@example.com",
    "sent": true
  }
}

Common error cases

StatusCodeWhen
403OTP_PUBLIC_IP_NOT_ALLOWEDPublic token IP allowlist blocked.
429OTP_RATE_LIMITEDOTP send rate limit exceeded.
503SMTP_NOT_CONFIGUREDNo usable SMTP route.

Implementation notes

  • Public tokens enforce allowlist on send.
  • Prefer instant-otp routes for browser and edge integrations.