---
title: "Preview Email Content"
method: POST
path: "/api/v1/email-contents/{content_id}/preview"
tags: ["Email Contents"]
---

# Preview Email Content

`POST /api/v1/email-contents/{content_id}/preview`

## Request

- Base URL: `https://api.sendseven.com`
- URL: `https://api.sendseven.com/api/v1/email-contents/{content_id}/preview`
- Auth: HTTP bearer

Preview email content with test variables.

**Required Scopes:** `email:read`

**Use Case:**
- Test how email will look with specific contact/company data
- Preview personalization before launching campaigns
- Debug variable replacement issues

**Example Request:**
```json
{
  "variables": {
    "contact.name": "Jane Smith",
    "contact.email": "jane@example.com",
    "company.name": "Tech Solutions Inc",
    "hero_title": "Exclusive Offer for You",
    "cta_url": "https://example.com/special-offer"
  }
}
```

**Features:**
- Compiles content with provided variable values
- Returns rendered HTML and subject line
- Returns list of variables used in content
- Useful for testing personalization before sending campaign

**Resolution rules:** `company.*` and `system.*` always come from your real
workspace data and `agent.*` from the requesting user (never example
values). `contact.*` / `contact.custom.*` come from `variables.contact`;
a contact field that is not supplied renders as an empty string. To
personalise for a real contact, use `POST /email-contents/{id}/render`.

## Path parameters

- `content_id` string, required

## Request body

- EmailContentPreviewRequest: Schema for previewing email content with test variables
  - `variables` object: Test variables to render (e.g., {'contact': {'name': 'John'}})

## Response `200`

Successful Response

- EmailContentPreviewResponse: Schema for email content preview response
  - `html_content` string, nullable: Compiled and rendered HTML (html type)
  - `text_content` string, nullable: Rendered plain text (plain_text type)
  - `subject_line` string, required: Rendered subject line
  - `variables_used` string[], required: Variables found in content
  - `content_type` string: Content type of the previewed content

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sendseven/apis/sendseven.md) · [All operations](https://skmtc.dev/sendseven/apis/sendseven/llms.txt) · [OpenAPI document](https://skmtc.dev/sendseven/apis/sendseven/revisions/ea628483e29a?raw)
