Send a transactional email
Transactional emails are automated, non-promotional messages triggered by user actions such as account creation, order confirmations, and password resets.
If you’re new to the API, see the Quickstart guide before sending your first email.
Send a basic message with a static body or predefined template.
Send a message enriched with contact attributes or custom variables.
Before you start
Retrieve your credentials
Get your API key or configure OAuth 2.0. See the Authentication guide for details.
Register an email sender
Configure your sending domain and sender before sending emails. See how to set up your senders for instructions.
Send a message with static content
Send a simple email with static HTML or text content. Use this for straightforward transactional messages without dynamic variables or advanced template logic.
Example attributes:
Subject line
Hello from Brevo!
Sender details
{ "name" : "Alex from Brevo", "email" : "hello@brevo.com"}
Recipient details
[{ "name" : "John Doe", "email" : "johndoe@example.com"}]
Message body
“<html><head></head><body><p>Hello,</p>this is my first transactional email sent from Brevo.</p></body></html>”
Hello, this is my first transactional email sent from Brevo.
345
Use one of the following message body types:
htmlContent: HTML content that defines the message structure and stylingtextContent: Plain text content for simple messages like password resets or order confirmationstemplateId: Reference a template created in the Brevo Drag & Drop editor by passing its template IDYou can only pick one of the three different body types on each request.
Request
HTML Body
Text Body
Template
Response
The response includes a messageId that you can use to track deliverability events for this message.
Send a message with dynamic content
Dynamic content lets you personalize message bodies with attributes that vary per request. You can embed variables in HTML content, plain text, or as templates.
This guide demonstrates dynamic content using an order confirmation email that includes:
- Dynamic variables (tracking number, delivery date)
- Contact attributes (name, address)
Dynamic variables embedded in the request
Pass dynamic variables directly in your API request using the object params to personalize the message body. Variables are included in the request payload alongside the email content.
Example attributes:
Subject line
Hello from Brevo!
Sender details
{ "name" : "Alex from Brevo", "email" : "hello@brevo.com"}
Recipient details
[{ "name" : "John Doe", "email" : "johndoe@example.com"}]
Dynamic variables
{ "trackingCode": "JD01460000300002350000", "estimatedArrival" : "Tomorrow" }
Message body
<html><head></head><body>Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}</p></body></html>
Your delivery is expected {{params.estimatedArrival}}.Your tracking code: {{params.trackingCode}}
Use one of the following message body types:
htmlContent: HTML content that defines the message structure and stylingtextContent: Plain text content for simple messages like password resets or order confirmations
Request
HTML Body
Text Body
Response
The response includes a messageId that you can use to track deliverability events for this message.
Create a template with dynamic content
Create the email template in the Brevo dashboard.
Configure settings
Set up your template:
- Template Name: “Order confirmation”
- Subject Line: “Your new order has been received”
- From Email: Select an existing sender
- From Name: Enter your company name

Click “Next Step”.
You can also create templates via the API using the Create an SMTP template endpoint. You can pass HTML content as a string (htmlContent) or via a URL (htmlUrl).
Add a delivery address attribute
Contacts include EMAIL, FIRSTNAME, LASTNAME, and SMS by default. Add a DELIVERYADDRESS attribute for use in the template.
Create attribute
Go to Contact > Settings > Contact Attributes & CRM and add a field named DELIVERYADDRESS.

Add test contact
Go to your contacts page and create a contact with:
- FIRSTNAME:
John - LASTNAME:
Doe - EMAIL: Your email address
- DELIVERYADDRESS:
75014 Paris, France - Contact list: Select any list

Click “Save and Close”.
Manage contacts via the API using Create contact attribute and Create a contact. For importing contacts, see synchronize contact lists.
Send the transactional email
Use the Send a transactional email endpoint.
Required parameters
sender: Sender email and name (must be registered and verified)nameoverrides your default sender name
to: Recipient email and name- Email must be a Brevo contact assigned to a contact list
- Contact must have
FIRSTNAME,LASTNAME,EMAIL, andDELIVERYADDRESSattributes nameappears in email headers only
templateId: Template ID from the templates page or the list templates endpointparams: Transactional parameters, e.g.,{"ORDER": 12345, "DATE": "12/06/2019"}
Test in API reference
Test the endpoint in the API Reference. Click “Try it” and enter your API key.
The API reference interface doesn’t support rich JSON body parameters like params. Use the code examples below for full functionality.
The API reference makes real API calls. Check your rate limits and credits before testing.
Code examples
Include these headers in each request:
api-key: xkeysib-xxxxxxxxxxxxxxxxxcontent-type: application/jsonaccept: application/json
Check your inbox for the email.
Track email events with webhooks
Set up webhooks to track email status. Available events:
Sent, Delivered, Opened, Clicked, Soft Bounce, Hard Bounce, Invalid Email, Deferred, Complaint, Unsubscribed, Blocked, Error
Create webhook
Go to the transactional webhooks page and:
- Enter your server URL to receive webhook events
- Select events to track

Manage webhooks via the API using Create a webhook and Update a webhook.
See all event payload structures in the webhook responses documentation.


