API Reference
Duplicate Template
POST /templates/:id/duplicate — create a copy of an existing template.
POST
/templates/:id/duplicateDuplicates a template, returning a new template with its own id and the same name, subject, and body as the source. The original is unchanged.
Path parameters
idstringrequiredThe id of the template to duplicate.
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.templates.duplicate('tmpl_8f5c2a1e');
console.log({ data, error });Response
{
"object": "template",
"id": "tmpl_3b9d7e2f"
}Returns
not_found if no template with that id belongs to you. See Errors.