API Reference
List templates
GET /templates — list your templates.
GET
/templatesReturns your templates, newest first, as a paginated list. This endpoint is always paginated: limit defaults to 20 even when you do not send it, so an account with more templates than that gets one page plus has_more: true. Page through the rest with after.
Query parameters
limitnumberoptionalNumber of templates to retrieve. Minimum 1, maximum 100, default 20.
afterstringoptionalThe template id after which to retrieve more templates (the next page). Not included in the result. Cannot be combined with before.
beforestringoptionalThe template id before which to retrieve more templates (the previous page). Not included in the result. Cannot be combined with after.
import { Mailblastr } from 'mailblastr';
const mb = new Mailblastr('mb_xxxxxxxxx');
const { data, error } = await mb.templates.list();
console.log({ data, error });Response
{
"object": "list",
"has_more": false,
"data": [
{
"id": "43f68331-0622-4e15-8202-246a0388854b",
"name": "Welcome email",
"subject": "Welcome, {{first_name}}!",
"html": "<h1>Hi {{first_name}}</h1>",
"status": "draft",
"published_at": null,
"alias": null,
"created_at": "2026-06-23T10:00:00.000Z",
"updated_at": "2026-06-23T10:00:00.000Z"
}
]
}Returns validation_error if limit is outside 1–100 or if both after and before are supplied. See Errors and Pagination.