How to Create Visual Templates in Brevo and Trigger Them via API Calls
Learn the step-by-step process to design email layouts in Brevo's visual builder and automate transactional or bulk sending using API calls with JSON payloads.
Summary
- The layout stays in Brevo's builder. The API only sends the template number and the data.
- Send-time variables use params in the body and in the template.
- The template must be active. A draft will not send.
- The call is POST /v3/smtp/email with the api-key header.
- 401 is the key. 400 is usually templateId or a parameter the layout expected and did not get.
What stays in the dashboard and what stays in code
Brevo separates the email design from the send. Marketing builds the HTML in the visual builder, with columns, a button and a logo. The backend does not resend that HTML. It sends the numeric template id and an object with the texts that change for each recipient.
That number, templateId, is on the transactional template details. While the template is a draft, the API rejects the send. Activate it in the dashboard before you test the call.
Step by step
Create the template, mark the dynamic slots and only then call the API. The key stays on the server, never in the browser.
- In the Brevo dashboard, create a transactional template and finish the layout in the builder.
- Where the text changes, insert a params variable, for example the recipient name. Save and activate the template.
- Copy the numeric id. Create an API key that can send mail and store it only in the server environment.
- POST to https://api.brevo.com/v3/smtp/email with the api-key header and a JSON body.
- In the body, send sender, to with the recipient email, templateId and params using the same keys drawn in the layout.
- Read the response. 201 means Brevo accepted the send. Open the email and check that the name replaced the template slot.
curl -X POST https://api.brevo.com/v3/smtp/email \
-H 'api-key: YOUR_KEY' \
-H 'content-type: application/json' \
-d '{"sender":{"email":"[email protected]"},"to":[{"email":"[email protected]"}],"templateId":12,"params":{"name":"Ana"}}'In the layout, the matching slot uses the name key inside params. If the builder shows another prefix, use the one Brevo's own preview replaces, and send that same key in params.
Common mistakes
Most failures are setup, not HTTP. The JSON can be right and the template can still be inactive.
- 401: the key is missing, revoked or not allowed to send SMTP.
- 400 on templateId: the number does not exist on this account or the template is still a draft.
- The email arrives with a blank slot: the params key is not the one drawn in the layout.
- The sender must be a domain authenticated in Brevo. A random from-address is usually rejected.
Conclusion
The builder stores the visual. The call sends templateId, the recipient and params. With the template active, that is the whole bridge.
Changing layout copy does not need a deploy. Changing a params key means fixing both sides: the block in the builder and the object in the JSON.