Skip to main content
CampaignsVersion: v3New

Preview Email Campaign

POST/emails/locations/{locationId}/campaigns/emails/{campaignId}/preview

Return the stored rendered HTML, subject and preview text of this campaign exactly as saved, with the merge fields ({{...}}) it still contains. Shows version A unless variationIndex picks an A/B version (1 = B, 2 = C, ...). Sends no email; merge fields are filled in per contact at send time.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:emails/campaigns.readonly
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

API Version

Available optionsv3
Example:v3

Path Parameters

locationIdstringrequired

Location ID

Example:ve9EPM428h8vShlRW1KT
campaignIdstringrequired

Campaign ID

Example:67f15c2ae99226d5bcccb8f3

Query Parameters

variationIndexnumber

A/B version to preview: 1 = version B, 2 = version C, ... (see abVersions in Get Email Campaign). Omit for version A, the campaign itself. 404 when that version does not exist; nothing is created.

Possible values: >= 1 and <= 9

Example:1

Response

Success

htmlstringrequired

Stored rendered HTML, exactly as saved.

Example:<html><body><p>Hello {{contact.first_name}}</p></body></html>
subjectstringrequired

Stored subject. Empty if no subject was saved.

Example:Holiday sale starts now
previewTextstring

Stored inbox preview text.

Example:Our biggest offer of the year
unresolvedMergeFieldsstring[]required

Distinct {{...}} tokens remaining in HTML, subject or preview text after rendering. These may require send-time context.

Example:["{{contact.first_name}}"]