> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vern.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the preview

> Read the latest generated preview — the proposed output, sheet-per-template — so your customer can review it before you execute.

```http theme={null}
GET https://app.vern.so/api/v1/migrations/{migration_id}/preview
```

Returns the **current preview** — the output of the latest
[`generate` or `update` run](https://docs.vern.so/migration-api/start-a-run), mapped to your templates
sheet-by-sheet. This is exactly what the agent proposes to import; show it to your
customer, then refine or [execute](https://docs.vern.so/migration-api/start-a-run.md).

A migration has a preview once a `generate`/`update` run reaches
`awaiting_approval`. Before that, this returns `404`.

## Authentication

Requires an `x-api-key` header. See [Authentication](https://docs.vern.so/migration-api/authentication.md).

## Response

`200 OK`

```json theme={null}
{
  "status": "awaiting_approval",
  "templates": [
    { "slug": "contacts", "name": "Contacts" }
  ],
  "sheets": [
    {
      "template": { "slug": "contacts", "name": "Contacts" },
      "rows": [
        ["Email", "First Name", "Last Name", "Account"],
        ["jane@acme.com", "Jane", "Doe", "Acme Corp"],
        ["john@acme.com", "John", "Smith", "Acme Corp"]
      ],
      "invalid_cells": []
    }
  ]
}
```

**status** `string`

Always `awaiting_approval` when a preview exists.

**templates** `object[]`

The templates this migration targets, each `{ slug, name }`.

**sheets** `object[]`

One entry per output sheet:

**sheet**

**template** `object`

`{ slug, name }` — the template this sheet maps to.

**rows** `string[][]`

The proposed rows as a grid, header row first.

**invalid\_cells** `object[]`

Cells flagged invalid in the preview. Empty in the common case.

## Choosing columns

Two optional parameters shape which columns come back. Both default off, so
leaving them out returns exactly what it always has.

**fields** `string`

Comma-separated column names to return, in the order you give them. Matched
exactly and case-sensitive. An unrecognised name returns `400`
(`unknown_field`) listing the valid ones rather than being ignored — a typo
should not quietly leave data out.

**omit\_empty** `boolean` (default: false)

Drop columns that hold no data. A column is dropped only when it's empty in
**every** row, so the rows you get back all keep the same shape. Empty means
an empty string, `null`, or an absent value; whitespace counts as data.
Combine with `fields` and the pruning applies within your selection.

> [!NOTE]
>
> Here "empty" is judged from the rows in this response, which are the whole
> payload — a preview is a sample of what the plan would produce, so a column
> that's empty in the sample may still be filled by the real import.

## Errors

| Status | Meaning |
| - | - |
| `400` | `fields` was given but empty (`empty_field_selection`), or names a column that appears in no sheet of the preview (`unknown_field`, listing the valid names). |
| `401` | API key missing or invalid. |
| `404` | No preview generated yet, or the migration isn't in your account. |
| `429` | **30 requests per minute** per account (the Reads class). Check `Retry-After`. See [Rate limits](https://docs.vern.so/migration-api/errors.md#rate-limits). |
| `500` | Server error. |

## Example

```bash theme={null}
curl https://app.vern.so/api/v1/migrations/c0a8012e-.../preview \
  -H "x-api-key: $VERN_API_KEY"
```

## Next

* [Start a run](https://docs.vern.so/migration-api/start-a-run.md) — `update` to refine, or `execute` to import.
* [Export CSV](https://docs.vern.so/migration-api/export-csv.md) — get the validated rows after execute.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.