API Reference

Publish Template

POST /templates/:id/publish — publish a template so it can be used in sends.

POST/templates/:id/publish

Publishes a template. Publishing makes the template’s current content the live version used when you reference it by id in `POST /emails` or a campaign.

Path parameters
idstringrequired

The id of the template to publish.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.templates.publish('tmpl_8f5c2a1e');
console.log({ data, error });

Response

{
  "id": "tmpl_8f5c2a1e",
  "object": "template"
}
Returns not_found if no template with that id belongs to you. See Errors.