Documentation version: Latest (v1)

API endpoint

Get a single template

Returns full template payload including html/text body.

GET/api/v1/templates/{templateId}

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.

Query parameters

FieldTypeRequiredDescription
templateIdpath stringYesTemplate id path param.

Code examples (all supported languages)

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

curl -X GET "https://risumail.risu.in/api/v1/templates/tpl_welcome" \
  -H "Authorization: Bearer YOUR_API_KEY"

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",
        "name",
        "subject",
        "htmlBody",
        "textBody"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "htmlBody": {
          "type": "string"
        },
        "textBody": {
          "type": "string"
        }
      }
    }
  }
}

Success response example

{
  "success": true,
  "data": {
    "id": "tpl_welcome",
    "name": "Welcome",
    "subject": "Welcome {{firstName}}",
    "htmlBody": "<h1>Welcome {{firstName}}</h1>",
    "textBody": "Welcome {{firstName}}"
  }
}

Common error cases

StatusCodeWhen
404TEMPLATE_NOT_FOUNDTemplate does not exist for account.
401UNAUTHORIZEDAPI key invalid.

Implementation notes

  • Minimum template id length is validated on route entry.