Skip to main content
POST
Create an email template
Creates a reusable email: a subject and an HTML body_html, both with merge fields. Attach it to an email step by id, in templates on Add a step. user_id becomes the template’s author, and only the author can change or delete it later. Team admins cannot.

Example

Merge fields

Merge fields are filled from the contact when the step runs.
  • Field names are case-insensitive, and spaces just inside the braces are ignored: {{ First_Name }} works.
  • A known field the contact has no value for renders as empty. Anything else in double braces, including a misspelling such as {{frist_name}} or a field that does not exist such as {{account}}, is sent exactly as written.
  • Values are HTML-escaped in the body, and line breaks in a value become spaces.
  • A field name can be up to 64 characters.
Preview the template before you use it: it shows the rendered text and lists the fields that came out empty.

Subjects

The subject is only sent by an email step that starts a thread: the sequence’s first email step, or a step with new_thread: true. Later steps reply in the same thread, and the prospect sees the thread’s original subject. So a template used only by steps that reply in a thread can leave subject out, or send "". An auto_email step that starts a thread needs a subject on every template it uses: a step that would start one without it is refused with a 400. Without an Idempotency-Key, a retry creates a second template.

Authorizations

x-api-key
string
header
required

Team-scoped API key generated in the Salesfinity dashboard under Settings → Connections → API & Webhooks. A missing or invalid key returns HTTP 403.

Headers

Idempotency-Key
string

Makes this write safe to retry. Send a unique value, such as a UUID, and send the same value again when you retry the same request. A retry with the same key and the same request (method, path including the query string, and JSON body) returns the original successful response without acting twice. The same key with a different body or path returns 409, and so does a retry while the first request is still running; that one is safe to repeat after a moment. A request that fails frees its key, so a retry runs the write again: after a 5xx on a create, confirm with a GET before retrying. Keys are kept for 24 hours and are scoped to your team.

Body

application/json
name
string
required

Template name, 1 to 200 characters.

Maximum string length: 200
Example:

"Follow-up - logistics report"

body_html
string
required

HTML body, 1 to 100,000 characters. Merge fields, case-insensitive, filled from the contact when the step runs: {{first_name}}, {{last_name}}, {{company}} (the contact's account), {{title}}, and {{custom.<label>}} for a custom field by label. A known field with no value renders empty; anything else in double braces, including a misspelled name, is sent exactly as written. Values are HTML-escaped.

Maximum string length: 100000
user_id
string
required

The team member creating the template; it becomes the author, the only member who can later change or delete it. Must be an active team member with an active plan or seat. A 24-character hexadecimal ID.

Example:

"507f1f77bcf86cd799439011"

subject
string

Subject line, up to 500 characters, with merge fields such as {{first_name}}. Only sent by an email step that starts a thread (the first email step, or one with new_thread: true). Leave it out, or send "", for a template used only by steps that reply in a thread.

Maximum string length: 500
Example:

"{{first_name}}, the Q3 logistics numbers"

tags
string[]

Up to 20 labels, each up to 50 characters.

Maximum array length: 20
Maximum string length: 50
archived
boolean

Archiving only affects the archived filter on the list: steps that use the template keep sending it.

Response

The new template.

A reusable email: subject and HTML body with merge fields.

_id
string

24-character hexadecimal id.

Example:

"507f1f77bcf86cd799439011"

team
string

The team that owns the template (24-character id).

user
string

Author's team member id. Only the author can change or delete the template.

name
string

Template name.

subject
string

Subject line, with merge fields. Only sent by email steps that start a thread. Empty on a template written for steps that reply in a thread.

body_html
string

HTML body, with merge fields.

tags
string[]
archived
boolean

Whether the template is archived. Archiving only affects the archived filter on the list: steps that use it keep sending it, and it can still be attached to steps.

send_count
integer

Emails sent from this template. Rebuilt every 15 minutes.

open_count
integer

Number of opens on emails sent from this template, counted as events. Rebuilt every 15 minutes.

reply_count
integer

Number of replies on emails sent from this template, counted as events. Rebuilt every 15 minutes.

bounce_count
integer

Number of bounces on emails sent from this template, counted as events. Rebuilt every 15 minutes.

click_count
integer

Number of link clicks on emails sent from this template, counted as events. Rebuilt every 15 minutes.

opt_out_count
integer

Number of opt-outs on emails sent from this template. Rebuilt every 15 minutes.

created_at
string<date-time>

When the template was created.

updated_at
string<date-time>

When it last changed.