Brevo
Send transactional and marketing email/SMS and manage contacts via the Brevo (formerly Sendinblue) v3 API.
- Base URL:
https://api.brevo.com/v3 - Auth:
api-key: <YOUR_API_KEY>HTTP header (a custom header — notBearer) - Credential model: none — the API key is passed in as a tool input
- Runtime: Python standard library only (
urllib,json)
Operations
operation |
Method & path | What it does |
|---|---|---|
send-email |
POST /v3/smtp/email |
Send a transactional email |
send-sms |
POST /v3/transactionalSMS/sms |
Send a transactional SMS |
create-contact |
POST /v3/contacts |
Create (or update) a contact |
get-account |
GET /v3/account |
Read account info (plan, credits, company) |
All operations return a result (the response body as a JSON string) and a
status (the HTTP status code as a string). Non-2xx responses are returned with
their status and Brevo error body rather than raising, so the caller can inspect
the failure. Transport-level failures fail the step.
API key setup
- Sign in at app.brevo.com.
- Open SMTP & API → API Keys.
- Click Generate a new API key, name it, and copy the value.
- Pass it as the
apiKeyinput. Forsend-email/send-sms, the sender must be a verified sender/domain in your Brevo account.
Inputs
| Input | Used by | Notes |
|---|---|---|
apiKey |
all | Required. Brevo API key. |
operation |
all | Required. One of the operations above. |
to |
send-email | Comma-separated recipient email addresses. |
fromEmail |
send-email | Verified sender email address. |
fromName |
send-email | Optional sender display name. |
subject |
send-email | Email subject line. |
htmlContent |
send-email | HTML body. Provide htmlContent and/or textContent. |
textContent |
send-email | Plain-text body. |
smsSender |
send-sms | Sender name/ID (≤11 alphanumeric chars) or a phone number. |
smsRecipient |
send-sms | Recipient mobile number in international format (+15551234567). |
smsContent |
send-sms | SMS message text. |
email |
create-contact | Email address of the contact. |
attributes |
create-contact | Optional JSON object, e.g. {"FIRSTNAME":"John"}. |
listIds |
create-contact | Optional comma-separated Brevo list IDs (integers). |
updateEnabled |
create-contact | true to update the contact if it already exists. |
Examples
Send a transactional email
operation: send-email
apiKey: xkeysib-...
to: [email protected]
fromEmail: [email protected]
fromName: My App
subject: Your order is confirmed
htmlContent: <p>Thanks for your order!</p>
→ POST /v3/smtp/email with
{"sender":{"email":"[email protected]","name":"My App"},"to":[{"email":"[email protected]"}],"subject":"Your order is confirmed","htmlContent":"<p>Thanks for your order!</p>"}
returns 201 {"messageId":"<[email protected]>"}.
Send a transactional SMS
operation: send-sms
apiKey: xkeysib-...
smsSender: MyApp
smsRecipient: +15551234567
smsContent: Your verification code is 123456
→ POST /v3/transactionalSMS/sms with
{"type":"transactional","sender":"MyApp","recipient":"+15551234567","content":"Your verification code is 123456"}.
Create a contact
operation: create-contact
apiKey: xkeysib-...
email: [email protected]
attributes: {"FIRSTNAME":"Jane","LASTNAME":"Doe"}
listIds: 2,5
updateEnabled: true
→ POST /v3/contacts with
{"email":"[email protected]","attributes":{"FIRSTNAME":"Jane","LASTNAME":"Doe"},"listIds":[2,5],"updateEnabled":true}
returns 201 {"id":42}.
Read account info
operation: get-account
apiKey: xkeysib-...
→ GET /v3/account returns 200 with plan, credit, and company details.
Source
Grounded in the official Brevo API reference: https://developers.brevo.com/reference/getting-started-1