---
title: "Preview extraction template data"
method: POST
path: "/api/v3/extract-template/{template_id}/preview/"
tags: ["Extraction templates"]
---

# Preview extraction template data

`POST /api/v3/extract-template/{template_id}/preview/`

## Request

- Base URL: `https://embedded.improvado.io`
- URL: `https://embedded.improvado.io/api/v3/extract-template/{template_id}/preview/`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `dts_session_id`
- TypeScript: <https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/docs/api/v3/extract-template/:template_id/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns a preview of data that would be extracted using the given template configuration. The response includes both the data rows and column metadata.

## Path parameters

- `template_id` integer, required

## Request body

- ExtractTemplatePreviewRequest: Request payload for extraction template data preview.
  - `connection_id` integer: Connection ID to use for the preview.
  - `custom_settings` object: Custom settings for the extraction.
  - `fields` string[]: List of fields to include in the preview.
  - `dynamic_fields` string[]: List of dynamic fields to include.
  - `accounts` string[]: List of account IDs.
  - `custom_filters` unknown

## Response `200`

Preview data with rows and column metadata

- ExtractTemplatePreviewResponse: Response containing preview data for an extraction template.
  - `data` object
    - `dataSource` object[]: Array of data rows returned by the preview.
      - `key` string
    - `columns` object[]: Column metadata describing the data fields.
      - `title` string: Human-readable column title.
      - `dataIndex` string: Key used to look up the value in each dataSource row.
      - `key` string: Unique column identifier.

## Other responses

- `400`: Bad request
- `403`: Forbidden
- `404`: Not found

---

[API](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3.md) - [All operations](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/improvado/apis/improvado-embedded-api-v3/revisions/a881099bd6c4?raw)
