Documentation version: Latest (v1)

API endpoint

Send using a template

Queues email from a saved template with runtime vars.

POST/api/v1/templates/send

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[]YesRecipient email(s).
templateIdstringYesTemplate id from dashboard.
varsobjectNoTemplate interpolation values.
subjectstringNoOptional subject override.
htmlstringNoOptional html override.
textstringNoOptional text override.
priority'URGENT' | 'NORMAL'NoQueue priority.
senderEmailIdstringNoVerified sender override.

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/templates/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["user@example.com"],"templateId":"tpl_welcome_series","vars":{"firstName":"Vivek","plan":"PRO"}}'

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

Success response example

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

Common error cases

StatusCodeWhen
400INVALID_INPUTtemplateId missing or invalid payload.
404TEMPLATE_NOT_FOUNDTemplate does not exist for account.
429RATE_LIMITEDSend rate exceeded.

Implementation notes

  • Template vars are plain key-value pairs mapped into {{variable}} placeholders.