# Preview campaign content

`POST /v1/campaigns/{id}/preview`

Requires an API key with the `campaigns:read` scope. [About keys and scopes](/docs/api/authentication)

Renders the campaign content to HTML and plain text without sending anything, optionally against a specific contact so personalization tokens resolve. Use this to check a campaign before sending it.

## Path parameters

- `id` (string, required, uuid)

## Request body

- `contactId` (string, required, uuid) — The contact whose values fill the merge tags.

## Returns

Returns `200 OK` with a `CampaignEmailPreview` in `data`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

- `subject` (string, required) — The subject with merge tags filled in.
- `html` (string, required) — The rendered HTML body.
- `text` (string, optional) — The rendered plain-text body.

## Example

```bash
curl -X POST https://api.kirora.io/v1/campaigns/018f2a4e-6b1c-7d3e-9f40-37386ae05a6b/preview \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contactId": "018f2a4e-6b1c-7d3e-9f40-4db757ce5a6b"
  }'
```

Response `200`:

```json
{
  "data": {
    "subject": "Your order is on its way",
    "html": "html_example",
    "text": "text_example"
  }
}
```
