preview_template
Render a template with sample data to preview exact output and verify required data fields before sending a message.
Instructions
Render a template with sample data to see the exact text a person would get, without sending anything. Use it to check which data a template needs before send_message; list_templates gives the keys. Needs an admin key, so agent keys get 403.
Returns locale (the one used) and variants: the rendered title, body, url and other content under default and under each channel with its own override. Fails with 404 for an unknown template and 422 when it cannot be rendered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Sample template variables, read as `data`. Defaults to {}. | |
| locale | No | Locale to render, e.g. `uz`. Omitted, the server's default is tried; a locale the template lacks falls back to its default. | |
| template | Yes | Template key, e.g. `order-shipped`, from list_templates. |