---
title: "Preview one row"
method: POST
path: "/mailmerge/campaigns/{campaign_id}/preview"
tags: ["Mail merge"]
---

# Preview one row

`POST /mailmerge/campaigns/{campaign_id}/preview`

## Request

- Base URL: `https://api.podpdf.com`
- URL: `https://api.podpdf.com/mailmerge/campaigns/{campaign_id}/preview`
- Auth: API key in header `X-API-Key`

The email and the template HTML for one row, exactly as they will be sent. Free; nothing is sent.

## Request body

- object
  - `row_index` integer: 0 is the first data row. Defaults to the first valid row.

## Response `200`

The preview

- MailMergePreview
  - `row_index` integer
  - `row` integer
  - `to` string
  - `valid` boolean
  - `row_count` integer
  - `subject` string
  - `text` string
  - `html` string
  - `attachment_filename` string
  - `headers` object
  - `template_html` string
  - `page` object
  - `errors` object[]

## Other responses

- `400`: The request was invalid
- `401`: Missing or invalid API key
- `403`: `INSUFFICIENT_CREDITS`, `CONVERSION_TYPE_NOT_ENABLED`, `PDF_TOOLS_NOT_ENABLED`, `RATE_LIMIT_EXCEEDED` or `ACCOUNT_NOT_FOUND`. Note that a plan's rate limit is a 403, not a 429.
- `404`: No such resource for this account
- `409`: `MAILMERGE_NOT_DRAFT`
- `410`: `OUTPUT_EXPIRED` — the file has been deleted

---

[API](https://skmtc.dev/podpdf/apis/podpdf-api.md) · [All operations](https://skmtc.dev/podpdf/apis/podpdf-api/llms.txt) · [OpenAPI document](https://skmtc.dev/podpdf/apis/podpdf-api/revisions/84eb21f3ee27?raw)
