Skip to main content
POST
Preview a rendered template
Renders the template’s subject and body for one contact, exactly as a send would, without sending or changing anything. It is a POST only because the contact travels in the body, so a retry is safe and it takes no Idempotency-Key.

Example

Things to know

  • Without contact, the template is rendered for a sample person and company: Jordan Rivera, VP of Operations at Northwind Logistics, with no custom fields. Every {{custom.<field>}} variable therefore comes back in missing_fields.
  • sender.* variables read the profile of the user_id member, as a send reads the rep who owns the enrollment.
  • missing_fields lists the variables that were empty for the contact and had no fallback. They render blank here: the gaps a real send to that person would have. A preview does not apply if_empty, so it never holds anything.
  • unknown lists every token that is not a variable, in the same shape as the unknown_variables error a save returns. Those tokens stay in subject and body_html exactly as written, except a custom.<field> your team does not have, which renders blank and is also listed in missing_fields. A template saved before the check can still hold one: until it is fixed, each email from it is held for the rep instead of sent.
  • unknown can list more than a save refuses. For a custom.<field> your team has no field definition for, a save searches your contacts and companies and accepts it when one carries the field; the preview does not search.
  • Any team member can preview any template. It counts toward the Sequencer writes rate limit, because it is a POST.

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 this call acts as. Must be an active member of the team the API key belongs to. A 24-character hexadecimal ID.

Example:

"507f1f77bcf86cd799439011"

contact
string

A contact on your team to render for (404 if not found). Without it, a sample person and company are used: Jordan Rivera, VP of Operations at Northwind Logistics, with no custom fields. A 24-character hexadecimal ID.

Response

The rendered subject and body.

subject
string
required

The rendered subject.

body_html
string
required

The rendered HTML body. Substituted values are HTML-escaped.

missing_fields
string[]
required

Variables, as written in the template, that were empty for this contact and had no fallback. They render blank.

unknown
object[]
required

Tokens that are not variables, left as written in subject and body_html, in the same shape as the 400 a save answers with. It can list a custom.<field> that a save accepts, because only a save searches your records for it. Empty when every token is a variable.