For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
      • GETGet the list of email templates
      • DELDelete an inactive email template
      • POSTSend a template to your test list
      • POSTGenerate the rendered preview of transactional template
      • PUTUpdate an email template
      • GETReturns the template information
      • POSTCreate an email template
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
Email APIEmail templates

Generate the rendered preview of transactional template

POST
https://api.brevo.com/v3/smtp/template/preview
POST
/v3/smtp/template/preview
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.transactionalEmails.postPreviewSmtpEmailTemplates();
8}
9main();
1{
2 "fromEmail": "nikon.doe@example.com",
3 "fromName": "Nikon Doe",
4 "html": "<!DOCTYPE html><html><head><title>Preview html content</title></head><body><p>html content</p></body></html>",
5 "previewText": "Preview text",
6 "subject": "Template preview subject",
7 "usedFeedNames": [
8 "[\"feed_1\",\"feed_2\"]"
9 ]
10}
Generate a fully rendered preview of a transactional email template by resolving dynamic variables. Provide either an `email` address (to populate variables from the contact''s attributes) or a `params` object with key-value pairs for manual substitution; at least one of these is required alongside the mandatory `templateId`. The response includes the rendered HTML, subject, sender details, preview text, and any feed names used in the template.
Was this page helpful?
Previous

Update an email template

Next
Built with

Generate a fully rendered preview of a transactional email template by resolving dynamic variables. Provide either an email address (to populate variables from the contact”s attributes) or a params object with key-value pairs for manual substitution; at least one of these is required alongside the mandatory templateId. The response includes the rendered HTML, subject, sender details, preview text, and any feed names used in the template.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

Values to fetch Template preview
anyRequired
OR
anyRequired

Response

successfully fetched template's preview fields
fromEmailstring
Sender email address
fromNamestring
Sender Name
htmlstring
Html content of the template
previewTextstring
Preview text of the template
subjectstring
subject of the template
usedFeedNameslist of strings

Errors

400
Bad Request Error