Skip to content
>GLB_
Go back

Pulling Brevo email logs into your backoffice without sharing credentials

// tech · api integration

TL;DR

You don’t need an extra Brevo user or the account password to show transactional email logs in your own backoffice. One API key, one endpoint (GET /v3/smtp/statistics/events), called from your backend, never from the browser.

The problem

I needed the transactional email logs from Brevo inside my own backoffice: delivered, opened, clicked, bounced. The catch: I didn’t want to invite another user to the account, and I didn’t want to share the account password.

You don’t need either. Brevo’s API authenticates with an API key, and the key is the only thing the integration needs.

What I tried

The endpoint returns unaggregated transactional email activity:

GET https://api.brevo.com/v3/smtp/statistics/events

My first request was wrong in three ways:

What actually worked

Authentication

Generate the key in your Brevo account settings (SMTP & API) and send it in the api-key header:

$ curl --location 'https://api.brevo.com/v3/smtp/statistics/events' \
  --header 'accept: application/json' \
  --header 'api-key: <YOUR_API_KEY>'

Filtering by date

Two options, never both:

# Option 1: explicit range (startDate and endDate go together)
$ curl --location 'https://api.brevo.com/v3/smtp/statistics/events?startDate=2026-05-01&endDate=2026-06-18' \
  --header 'accept: application/json' \
  --header 'api-key: <YOUR_API_KEY>'

# Option 2: last N days, including today
$ curl --location 'https://api.brevo.com/v3/smtp/statistics/events?days=7' \
  --header 'accept: application/json' \
  --header 'api-key: <YOUR_API_KEY>'

Rules from the docs:

Keep the key out of the browser

Never call Brevo from the frontend. The key would be exposed to anyone who opens DevTools.

backoffice frontend --> your backend API --> Brevo API
                        (api-key in env var)

Need real time? Use webhooks

If you need logs in near real time, polling is the wrong tool. Brevo can POST events to a URL you define when they happen: sent, delivered, opened, clicked, soft/hard bounce, invalid email, deferred, complaint, unsubscribed, blocked, error.

Store them in your own database and query that from the backoffice.

If the key leaks, rotate it

If a key ever lands in a chat, a screenshot or a commit, regenerate it. Revoking and creating a new one takes a minute.

Key takeaways

References


12 Nov 2026 · #brevo #apis #webhooks #security

GLB_


Share this post:

Related Posts


Previous Post
Why my average position improved while my traffic collapsed
Next Post
Building a member-month churn panel in dbt without leaking the future