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
| Header | Required | Value | Description |
|---|---|---|---|
| Authorization | Yes | Bearer <token> | API key, server OTP key, or public OTP token depending on endpoint. |
| Content-Type | Yes | application/json | All POST requests expect JSON payloads. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to | string | string[] | Yes | Recipient email(s). |
| templateId | string | Yes | Template id from dashboard. |
| vars | object | No | Template interpolation values. |
| subject | string | No | Optional subject override. |
| html | string | No | Optional html override. |
| text | string | No | Optional text override. |
| priority | 'URGENT' | 'NORMAL' | No | Queue priority. |
| senderEmailId | string | No | Verified 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
| Status | Code | When |
|---|---|---|
| 400 | INVALID_INPUT | templateId missing or invalid payload. |
| 404 | TEMPLATE_NOT_FOUND | Template does not exist for account. |
| 429 | RATE_LIMITED | Send rate exceeded. |
Implementation notes
- Template vars are plain key-value pairs mapped into {{variable}} placeholders.