Skip to main content
PATCH
Update an email template
Changes a template. Send only the fields you want to change; everything else keeps its value. Only the template’s author can change it. Anyone else gets 403, team admins included.

Example

When an edit takes effect

The template is read each time a step sends, so the next email from every step that uses it, in running sequences too, has the new text. Two things do not change:
  • Manual email tasks that already exist keep the draft they were created with.
  • Emails already sent.

Variables and if_empty

Variables work as described on Create an email template.
  • They are checked only when you send subject or body_html, on the subject and body as they will be saved. A token that is not a variable is refused with the same 400 (code: unknown_variables) as on create. An update that sends neither, such as a rename, archiving or a new if_empty, is not checked, so a template saved before the check can still be renamed or archived. Use Preview a rendered template to see what its next edit must fix.
  • Leave if_empty out to keep the template’s setting. Send wait or send to change it. null is refused.
  • Adding an AI line to a template that a step without personalization uses stops that step from sending it on its own: the email goes to the rep as a manual_email task instead.
  • The template’s attachments stay as they are.

Archiving

"archived": true only affects the archived filter on List email templates. Steps that use the template keep sending it, and it can still be attached to steps. To stop a template being sent, take it off its steps with Update a step. No field may be null. Sending the same body twice leaves the same result, so a retry is safe.

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.

Path Parameters

id
string
required

24-character template id.

Body

application/json
user_id
string
required

The team member making the change. Must be the template's author, and have an active plan or seat; anyone else, a team admin included, gets 403. A 24-character hexadecimal ID.

Example:

"507f1f77bcf86cd799439011"

name
string

Template name, 1 to 200 characters.

Maximum string length: 200
Example:

"Follow-up - logistics report"

subject
string

Subject line, up to 500 characters. Takes the same variables as body_html, 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"

body_html
string

HTML body, 1 to 100,000 characters, with variables filled in for each contact when the step runs. Write {{key}}, or {{key|fallback}} for what to use when the contact has no value (at most 64 characters, with no braces or line breaks; {{key|}} leaves it blank on purpose). Keys are not case-sensitive, and values are HTML-escaped.

  • Person: first_name, last_name, full_name, title, company (the contact's account), email, linkedin.
  • Company, from the contact's company record: company.website, company.industry, company.employees, company.city, company.state, company.country, company.tools.
  • Sender, the rep who owns the enrollment: sender.first_name, sender.last_name, sender.full_name, sender.title, sender.company, sender.phone, sender.meeting_link, sender.linkedin.
  • Custom fields your team has: custom.<key or label> on the contact, company.custom.<key or label> on its company.
  • AI lines: {{ai:name}} or {{ai:name|what to write}}, with no spaces outside the hint, written for each person when the step has personalization on. The name is 1 to 32 lowercase letters, digits and underscores; the hint is optional and at most 200 characters.

Anything else in double braces is refused with 400 and code: unknown_variables.

Maximum string length: 100000
if_empty
enum<string>

What happens when a variable is empty for a contact and has no fallback: wait holds the email for the rep, and send sends it with the gap left blank. Leave it out to keep the template's setting. A template saved before this setting existed has none, and behaves as send. null is refused.

Available options:
send,
wait
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 updated template.

A reusable email: a subject and an HTML body, with variables.

_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 variables. 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 variables.

if_empty
enum<string>

What happens when a variable is empty for a contact and has no fallback: wait holds the email for the rep, send sends it with the gap. Absent on a template saved before the setting existed, which behaves as send.

Available options:
send,
wait
attachments
object[]

Files sent with every email from this template, added in the Salesfinity app: as download links at the end of an email that starts a thread, and attached to a reply. Read-only: this API cannot add or remove them.

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.