Brevo
Brevo (formerly Sendinblue) email marketing API for managing contacts, lists, sending transactional emails, and campaigns. Use when importing contacts, sending emails, managing subscriptions, or worki
Brevo (formerly Sendinblue) email marketing API for managing contacts, lists, sending transactional emails, and campaigns. Use when importing contacts, sending emails, managing subscriptions, or worki
Real data. Real impact.
Growing
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Manage contacts, send emails, and automate marketing via Brevo's REST API.
BREVO_KEY=$(cat ~/.config/brevo/api_key)
All requests require header:
api-key: $BREVO_KEY
https://api.brevo.com/v3
| Action | Method | Endpoint |
|---|---|---|
| Create contact | POST | |
| Get contact | GET | |
| Update contact | PUT | |
| Delete contact | DELETE | |
| List contacts | GET | |
| Get blacklisted | GET | |
| Action | Method | Endpoint |
|---|---|---|
| Get all lists | GET | |
| Create list | POST | |
| Get list contacts | GET | |
| Add to list | POST | |
| Remove from list | POST | |
| Action | Method | Endpoint |
|---|---|---|
| Send transactional | POST | |
| Send campaign | POST | |
| Get templates | GET | |
curl -X POST "https://api.brevo.com/v3/contacts" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "listIds": [10], "updateEnabled": true, "attributes": { "NOMBRE": "John", "APELLIDOS": "Doe" } }'
curl "https://api.brevo.com/v3/contacts/user@example.com" \ -H "api-key: $BREVO_KEY"
curl -X PUT "https://api.brevo.com/v3/contacts/user@example.com" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "listIds": [10, 15], "attributes": { "CUSTOM_FIELD": "value" } }'
curl -X POST "https://api.brevo.com/v3/smtp/email" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "sender": {"name": "My App", "email": "noreply@example.com"}, "to": [{"email": "user@example.com", "name": "John"}], "subject": "Welcome!", "htmlContent": "<p>Hello {{params.name}}</p>", "params": {"name": "John"} }'
curl -X POST "https://api.brevo.com/v3/smtp/email" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": [{"email": "user@example.com"}], "templateId": 34, "params": { "NOMBRE": "John", "FECHA": "2026-02-01" } }'
curl "https://api.brevo.com/v3/contacts/lists?limit=50" \ -H "api-key: $BREVO_KEY"
curl -X POST "https://api.brevo.com/v3/contacts/lists/10/contacts/add" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "emails": ["user1@example.com", "user2@example.com"] }'
When importing contacts, always respect unsubscribes:
import requestsBREVO_KEY = "your-api-key" HEADERS = {'api-key': BREVO_KEY, 'Content-Type': 'application/json'} BASE = 'https://api.brevo.com/v3'
def get_blacklisted(): """Get all unsubscribed/blacklisted emails""" blacklisted = set() offset = 0 while True: r = requests.get( f'{BASE}/contacts?limit=100&offset={offset}&emailBlacklisted=true', headers=HEADERS ) contacts = r.json().get('contacts', []) if not contacts: break for c in contacts: blacklisted.add(c['email'].lower()) offset += 100 return blacklisted
def safe_import(emails, list_id): """Import contacts respecting unsubscribes""" blacklisted = get_blacklisted()
for email in emails: if email.lower() in blacklisted: print(f"Skipped (unsubscribed): {email}") continue r = requests.post(f'{BASE}/contacts', headers=HEADERS, json={ 'email': email, 'listIds': [list_id], 'updateEnabled': True }) if r.status_code in [200, 201, 204]: print(f"Imported: {email}") else: print(f"Error: {email} - {r.text[:50]}")
Brevo uses custom attributes for contact data:
{ "attributes": { "NOMBRE": "John", "APELLIDOS": "Doe", "FECHA_ALTA": "2026-01-15", "PLAN": "premium", "CUSTOM_FIELD": "any value" } }
Create attributes in Brevo dashboard: Contacts → Settings → Contact attributes.
| Code | Meaning |
|---|---|
| 200 | Success (GET) |
| 201 | Created (POST) |
| 204 | Success, no content (PUT/DELETE) |
| 400 | Bad request (check payload) |
| 401 | Invalid API key |
| 404 | Contact/resource not found |
updateEnabled: true to update existing contacts instead of failingBrevo automations trigger on:
Trigger automation manually:
curl -X POST "https://api.brevo.com/v3/contacts/import" \ -H "api-key: $BREVO_KEY" \ -H "Content-Type: application/json" \ -d '{ "listIds": [10], "emailBlacklist": false, "updateExistingContacts": true, "emptyContactsAttributes": false, "jsonBody": [ {"email": "user@example.com", "attributes": {"NOMBRE": "John"}} ] }'
# Count contacts in list curl "https://api.brevo.com/v3/contacts/lists/10" -H "api-key: $BREVO_KEY" | jq '.totalSubscribers'Get recent contacts
curl "https://api.brevo.com/v3/contacts?limit=10&sort=desc" -H "api-key: $BREVO_KEY"
Check if email exists
curl "https://api.brevo.com/v3/contacts/user@example.com" -H "api-key: $BREVO_KEY"
Get account info
curl "https://api.brevo.com/v3/account" -H "api-key: $BREVO_KEY"
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.