Templates

Create a template

Create a template as a draft. Publish it with POST /v1/templates/{id}/publish before sending with it. Same body as Resend's create template; markdown, preview_text and category are SMTPfast additions. Requires the email:send scope.

post/v1/templates

Request

  • Base URL: https://smtpfa.st/api
  • URL: https://smtpfa.st/api/v1/templates
  • Auth: HTTP bearer

Request body

namestring required
aliasstring nullable

A second handle, unique in the team, that works wherever the id does.

fromstring nullable

Default sender, e.g. "Acme orders@acme.com". A send can override it.

subjectstring nullable

Default subject. Can use variables. A send can override it.

htmlstring

The HTML body. Variables are written {{{KEY}}}, optionally with an inline fallback: {{{KEY|default}}}.

textstring nullable

Plain-text body. When left out, the text part is generated from the HTML at send time. Exactly "" stops that, as in Resend; the email then carries an empty plain-text alternative.

markdownstring nullable

Not in Resend. A Markdown body, rendered into SMTPfast's email layout. Used when html is empty.

preview_textstring nullable

Not in Resend. The inbox preview line, put into the email as a hidden first line.

categorystring nullable

Not in Resend. A label for grouping templates in the dashboard.

Example request

{
  "name": "order-confirmation",
  "alias": "order-confirmation",
  "from": "Acme <orders@acme.com>",
  "subject": "Your order {{{ORDER_ID}}}",
  "variables": [
    {
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "key": "PRODUCT"
    }
  ]
}

Response

Template created as a draft

idstring
objectstring
updated_atstring date-time

Not in Resend. The revision this write created.

status'draft' | 'published'

Not in Resend.

published_atstring date-time nullable

Not in Resend.

has_unpublished_versionsboolean

Not in Resend.

Example response

{
  "id": "clx_tpl123",
  "object": "template"
}

Changes

No recorded changes to this operation across all 1 revision of this API.