logo
CampaignsPreview a personalized email
Campaigns

Preview a personalized email

Returns the fully personalized subject and body for a given sequence step, lead, and mailbox. All variables ({{firstName}}, custom fields, {{senderName}}, etc.), conditional blocks (IF/ELSE), and spintax ({option1|option2}) are resolved.

Use contentOverride to preview unsaved draft content without modifying the campaign.

curl -X POST "https://api.sendkit.ai/v1/campaigns/example_string/preview-email" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "sequenceStep": 0,
  "leadId": "665d4e5f6a7b8c9d0e1f2a3b",
  "mailboxId": "665b1c2d3e4f5a6b7c8d9e0f"
}'
{
  "success": true,
  "data": {
    "subject": "Quick question, John",
    "body": "<p>Hi John,</p><p>I noticed Acme Corp is growing fast...</p>",
    "to": {
      "name": "John Doe",
      "email": "john@acme.com"
    },
    "from": {
      "name": "Sarah from SendKit",
      "email": "sarah@sendkit.ai"
    }
  }
}
POST
/v1/campaigns/{id}/preview-email
POST
API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Bearer Token
Bearer Tokenstring
Required

API key as Bearer token

API key as Bearer token
Content-Typestring
Required

The media type of the request body

Options: application/json
sequenceStepinteger
Required

Zero-based index of the sequence step to preview

leadIdstring
Required

Lead ID to personalize with

mailboxIdstring
Required

Mailbox ID for sender variables and signature

variantstring

A/B variant label (e.g. "B") — uses main step if omitted

contentOverrideobject

Override step content for unsaved drafts

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

header
Authorizationstring
Required

Bearer token. API key as Bearer token

Path Parameters

idstring
Required

Resource ID

Body

application/json
sequenceStepinteger
Required

Zero-based index of the sequence step to preview

leadIdstring
Required

Lead ID to personalize with

mailboxIdstring
Required

Mailbox ID for sender variables and signature

variantstring

A/B variant label (e.g. "B") — uses main step if omitted

contentOverrideobject

Override step content for unsaved drafts

Responses

successboolean
dataobject