How to hit the Brevo API

Brevo (formerly Sendinblue) at https://api.brevo.com/v3 sends transactional email and SMS and manages marketing contacts.

Authentication

Create a key under SMTP & API → API Keys and send it as the api-key header. In the examples it's written {{BREVO_API_KEY}}.

Full reference: https://developers.brevo.com/reference

Get your account

curl https://api.brevo.com/v3/account \
  -H "api-key: {{BREVO_API_KEY}}"
Run in PostTaco

Send an email

The sender must be verified in Brevo.

curl -X POST https://api.brevo.com/v3/smtp/email \
  -H "api-key: {{BREVO_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"sender": {"email": "{{FROM_EMAIL}}"}, "to": [{"email": "{{TO_EMAIL}}"}], "subject": "Hello from PostTaco", "textContent": "It works."}'
Run in PostTaco

List contacts

curl "https://api.brevo.com/v3/contacts?limit=10" \
  -H "api-key: {{BREVO_API_KEY}}"
Run in PostTaco