API Reference
Retrieve template
GET /templates/:id — fetch a single template.
GET
/templates/:idThe id path parameter also accepts an alias.
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.templates.get('tmpl_8f5c2a1e');
console.log({ data, error });Response
{
"object": "template",
"id": "tmpl_8f5c2a1e",
"current_version_id": "ver_a1b2c3d4e5f6",
"alias": null,
"name": "Welcome email",
"status": "published",
"published_at": "2026-06-23T10:05:00.000Z",
"has_unpublished_versions": false,
"from": "Acme <hello@yourdomain.com>",
"subject": "Welcome, {{first_name}}!",
"reply_to": null,
"html": "<h1>Hi {{first_name}}</h1>",
"text": null,
"variables": [
{
"id": "var_9e2b4a1f8c3d6e7b0f5a2c8d",
"key": "first_name",
"type": "string",
"fallback_value": "there",
"created_at": "2026-06-23T10:00:00.000Z",
"updated_at": "2026-06-23T10:00:00.000Z"
}
],
"created_at": "2026-06-23T10:00:00.000Z",
"updated_at": "2026-06-23T10:05:00.000Z"
}Returns
not_found if no template with that id (or alias) belongs to you.