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

Update an email template

PUT
https://api.brevo.com/v3/smtp/templates/:templateId
PUT
/v3/smtp/templates/:templateId
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.updateSmtpTemplate(1, {});
8}
9main();
Update an existing transactional email template by its numeric ID or custom template identifier string. All fields in the request body are optional; only the provided fields will be updated. You can update the template name, subject, sender, reply-to address, HTML content (via `htmlContent` or `htmlUrl`), active status, tag, attachment URL, and the personalized `toField`. Only one of sender email or sender ID should be provided per request.
Was this page helpful?
Previous

Returns the template information

Next
Built with

Update an existing transactional email template by its numeric ID or custom template identifier string. All fields in the request body are optional; only the provided fields will be updated. You can update the template name, subject, sender, reply-to address, HTML content (via htmlContent or htmlUrl), active status, tag, attachment URL, and the personalized toField. Only one of sender email or sender ID should be provided per request.

Authentication

api-keystring

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

Path parameters

templateIdlong or stringRequired
ID of the template. Can be a numeric template ID or a custom template identifier string.

Request

values to update in transactional email template
attachmentUrlstringOptionalformat: "url"

Absolute url of the attachment (no local file). Extensions allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps

htmlContentstringOptional

Required if htmlUrl is empty. If the template is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that template. Body of the message (HTML must have more than 10 characters)

htmlUrlstringOptionalformat: "url"

Required if htmlContent is empty. URL to the body of the email (HTML)

isActivebooleanOptional

Status of the template. isActive = false means template is inactive, isActive = true means template is active

replyTostringOptionalformat: "email"
Email on which campaign recipients will be able to reply to
senderobjectOptional
Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}**
subjectstringOptional
Subject of the email
tagstringOptional
Tag of the template
templateNamestringOptional
Name of the template
toFieldstringOptional
To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization

Response

transactional email template updated

Errors

400
Bad Request Error
404
Not Found Error

Sender details including id or email and name (optional). Only one of either Sender’s email or Sender’s ID shall be passed in one request at a time. For example: {“name”:“xyz”, “email”:“example@abc.com”} {“name”:“xyz”, “id”:123}

To personalize the To Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your Brevo account. If input parameter params used please use {{contact.FNAME}} {{contact.LNAME}} for personalization