---
title: "Preview in-app template with custom data"
method: POST
path: "/api/templates/inapp/preview"
tags: ["templates"]
---

# Preview in-app template with custom data

`POST /api/templates/inapp/preview`

Generate a fully rendered HTML preview of an in-app template using custom data. This endpoint simulates how a template would appear when sent to a user, allowing you to test template rendering with specific data fields and/or data feed data. Use this to preview templates before sending campaigns or to test template logic with different data scenarios. <br/><br/>Note: If a template references a field that is not provided in the request data, that field will be rendered as an empty string, matching the behavior of actual email sends.<br/><br/><b>Rate limit</b>: 10 requests/second, per project.

## Query parameters

- `templateId` integer, required
- `locale` string

## Request body

- TemplatePreviewRequest
  - `dataFeed` object — Data feed content for template rendering. Provide key-value pairs for any data feed fields that your template references. Note: Data feed fields are accessible as <code>[[fieldName]]</code> when template's <code>mergeDataFeedContext=false</code>, or as <code>{{fieldName}}</code> when <code>mergeDataFeedContext=true</code>. The <code>mergeDataFeedContext</code> setting is configured when creating/updating templates. If <code>fetchDataFeeds</code> is true, this will be merged with (or overridden by) the fetched data feed data.
  - `dataFields` object — Data fields for template rendering. Provide key-value pairs for any user profile, event, or custom fields that your template references. Note: Fields are accessible as <code>{{fieldName}}</code> in templates.
  - `fetchDataFeeds` boolean — Whether to fetch and use actual data feeds configured in the template. If true, the data feeds associated with the template will be fetched and used for rendering. Data from <code>dataFields</code> will be used to render dynamic URLs in the data feed configuration. If <code>dataFeed</code> is also provided, it will be merged with (or override) the fetched data feed data. Defaults to false.

## Response `200`

successful operation

## Other responses

- `400` — Invalid parameters. This may occur if the <code>templateId</code> is invalid, if required template data is missing, or if the request body contains malformed JSON.
- `401` — Invalid API key
- `404` — Template not found

---

[API](https://skmtc.net/iterable/apis/iterable-api.md) · [All operations](https://skmtc.net/iterable/apis/iterable-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/iterable/iterable-api/revisions/afaab604b58c/schema)
