Documentation version: Latest (v1)

API endpoint

Queue an email

Queues transactional or template mail with optional sender routing and priority.

POST/api/v1/emails

Auth: Bearer API key with mail_api 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
tostring | string[]YesSingle recipient or list (max 100).
subjectstringYesEmail subject line (max 998 chars).
htmlstringNoHTML body.
textstringNoText fallback body.
imageUrlstringNoOptional https image URL included in body.
templateIdstringNoUse saved template instead of inline html/text.
varsobjectNoTemplate variables for {{key}} placeholders.
priority'URGENT' | 'NORMAL'NoURGENT can bypass freeze mode.
senderEmailIdstringNoVerified sender identity id.

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/emails" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["user@example.com"],"subject":"Welcome to Risu Mail","html":"<h1>Hello</h1><p>Your onboarding flow is active.</p>"}'

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": [
        "id",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      }
    }
  }
}

Success response example

{
  "success": true,
  "data": {
    "id": "mail_01J...",
    "status": "QUEUED"
  }
}

Common error cases

StatusCodeWhen
400INVALID_INPUTMissing to/subject or body/template.
403SENDER_NOT_VERIFIEDsenderEmailId does not belong to caller.
429RATE_LIMITEDIP or API-key window exceeded.
503SMTP_NOT_CONFIGUREDOutbound SMTP is unavailable.

Implementation notes

  • At least one of html/text/imageUrl or templateId must be provided.
  • If SMTP pool daily warmup is exhausted, endpoint returns a limit message with reset timing.