Troubleshooting
If requests fail, run zero doctor check-connector --env-name BREVO_TOKEN or zero doctor check-connector --url https://api.brevo.com/v3/account --method GET
Core APIs
Get Account Info
Verify your API key and view account details:
curl -s "https://api.brevo.com/v3/account" --header "api-key: $BREVO_TOKEN" --header "accept: application/json" | jq '{companyName, email, plan: .plan[0].type}'
Create Contact
Write to /tmp/brevo_request.json:
{
"email": "user@example.com",
"attributes": {
"FIRSTNAME": "Jane",
"LASTNAME": "Doe"
},
"listIds": [1],
"updateEnabled": true
}
curl -s -X POST "https://api.brevo.com/v3/contacts" --header "api-key: $BREVO_TOKEN" --header "Content-Type: application/json" --header "accept: application/json" -d @/tmp/brevo_request.json | jq '{id}'
Docs: https://developers.brevo.com/reference/create-contact
Get Contact
Replace <email-or-id> with the contact's email address or numeric ID:
curl -s "https://api.brevo.com/v3/contacts/<email-or-id>" --header "api-key: $BREVO_TOKEN" --header "accept: application/json" | jq '{id, email, attributes}'
Update Contact
Replace <email-or-id> with the contact's email or ID.
Write to /tmp/brevo_request.json:
{
"attributes": {
"PLAN": "pro",
"SMS": "+13125551234"
},
"listIds": [2]
}
curl -s -X PUT "https://api.brevo.com/v3/contacts/<email-or-id>" --header "api-key: $BREVO_TOKEN" --header "Content-Type: application/json" -d @/tmp/brevo_request.json -w "\nHTTP Status: %{http_code}\n"
Delete Contact
Replace <email-or-id> with the contact's email or ID:
curl -s -X DELETE "https://api.brevo.com/v3/contacts/<email-or-id>" --header "api-key: $BREVO_TOKEN" -w "\nHTTP Status: %{http_code}\n"
List Contacts
curl -s "https://api.brevo.com/v3/contacts?limit=20&offset=0" --header "api-key: $BREVO_TOKEN" --header "accept: application/json" | jq '{count, contacts: [.contacts[] | {id, email}]}'
Send Transactional Email
Write to /tmp/brevo_request.json:
{
"sender": { "name": "Acme App", "email": "noreply@acme.com" },
"to": [{ "email": "user@example.com", "name": "Jane Doe" }],
"subject": "Your password reset link",
"htmlContent": "<html><body><p>Click <a href='{{params.resetLink}}'>here</a> to reset your password.</p></body></html>",
"params": {
"resetLink": "https://app.acme.com/reset?token=abc123"
}
}
curl -s -X POST "https://api.brevo.com/v3/smtp/email" --header "api-key: $BREVO_TOKEN" --header "Content-Type: application/json" --header "accept: application/json" -d @/tmp/brevo_request.json | jq '{messageId}'
Docs: https://developers.brevo.com/reference/send-transac-email
Send Transactional Email via Template
Replace <template-id> with the ID from your Brevo dashboard.
Write to /tmp/brevo_request.json:
{
"sender": { "name": "Acme App", "email": "noreply@acme.com" },
"to": [{ "email": "user@example.com", "name": "Jane Doe" }],
"templateId": "<template-id>",
"params": {
"firstName": "Jane",
"planName": "Pro"
}
}
curl -s -X POST "https://api.brevo.com/v3/smtp/email" --header "api-key: $BREVO_TOKEN" --header "Content-Type: application/json" --header "accept: application/json" -d @/tmp/brevo_request.json | jq '{messageId}'
List Contact Lists
curl -s "https://api.brevo.com/v3/contacts/lists?limit=20" --header "api-key: $BREVO_TOKEN" --header "accept: application/json" | jq '[.lists[] | {id, name, totalBlacklisted, totalSubscribers}]'
Import Contacts (Bulk)
Import multiple contacts at once. Write to /tmp/brevo_request.json:
{
"updateEnabled": true,
"jsonBody": [
{
"email": "alice@example.com",
"attributes": { "FIRSTNAME": "Alice", "PLAN": "free" }
},
{
"email": "bob@example.com",
"attributes": { "FIRSTNAME": "Bob", "PLAN": "pro" }
}
],
"listIds": [1]
}
curl -s -X POST "https://api.brevo.com/v3/contacts/import" --header "api-key: $BREVO_TOKEN" --header "Content-Type: application/json" --header "accept: application/json" -d @/tmp/brevo_request.json | jq '{createdLists, processId}'
Guidelines
- Auth header: Use
api-key: YOUR_KEY— notAuthorization: Bearer. This is different from most other APIs. - Attribute names: Contact attributes must be in UPPERCASE (e.g.,
FIRSTNAME,LASTNAME,PLAN). Create custom attributes in Brevo dashboard under Contacts > Settings > Contact attributes first. - List IDs: Get list IDs from the List Contacts endpoint or from the Brevo dashboard URL.
- updateEnabled: Set to
truewhen creating contacts to upsert (update if exists, create if not). - Template IDs: Find template IDs in Brevo under Templates in the URL path.
- Pricing model: Brevo charges per email sent (not per contact), making it cost-effective for large contact lists with moderate send frequency.