latestSwagger 2.02026-08-10148196271.0 KB

afaab604b58c

templates

Preview in-app template with custom data

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.

post/api/templates/inapp/preview

Query parameters

templateIdinteger required

Template ID

localestring

Locale of content to get

Request body

dataFeedobject

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.

dataFieldsobject

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.

fetchDataFeedsboolean

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

successful operation