Brevo API compatible: change the URL and the key
SMTP Senpai accepts send requests in the same format as the Brevo transactional email API. Point your code to SMTP Senpai, use your msp_ key and keep your SDK, your fields and your error handling.
14 days free · up to 100 emails a day · card required · if you don’t cancel within 14 days, the plan you chose starts
- Same paths, fields and errors
- Sending servers and log in the EU
- 14-day free trial
import { BrevoClient } from '@getbrevo/brevo'; - const brevo = new BrevoClient({ apiKey: process.env.BREVO_API_KEY }); + const brevo = new BrevoClient({ + apiKey: process.env.SMTP_SENPAI_KEY, // msp_… + baseUrl: 'https://app.mailsenpai.com/relay/compat/brevo/v3', + });
Two things change, the rest stays
Same paths, same fields, same responses and error shapes as the Brevo transactional email API.
The sender must be on a domain verified in your SMTP Senpai area and signed with DKIM: otherwise the request is refused with an error in the Brevo format. To try without sending, use headers["X-Sib-Sandbox"] = "drop": the request is checked and nothing leaves.
Your code, pointed to SMTP Senpai
import { BrevoClient } from '@getbrevo/brevo';
const brevo = new BrevoClient({
apiKey: process.env.SMTP_SENPAI_KEY, // msp_…
baseUrl: 'https://app.mailsenpai.com/relay/compat/brevo/v3',
});Tested with @getbrevo/brevo 6.0.3: run with the official SDK against the SMTP Senpai endpoints.
Other languages and frameworks
Settings read in the source code of each SDK: they follow the same rule (base URL or host, plus your key). Try them with a test send before going live.
| SDK | Setting | Status |
|---|---|---|
| PHP getbrevo/brevo-php 5 | new Brevo($key, ['baseUrl' => 'https://app.mailsenpai.com/relay/compat/brevo/v3']) | Read in the SDK source code, not yet tested |
| Python brevo | Brevo(api_key=key, base_url='https://app.mailsenpai.com/relay/compat/brevo/v3') | Read in the SDK source code, not yet tested |
What works, what is ignored, what is refused
Works
sender, to, cc, bcc, replyTo, subject, htmlContent, textContent, headers, attachment (base64 content), params ({{params.NAME}}), messageVersions, headers.idempotencyKey, X-Sib-Sandbox: drop
Accepted without effect
tags, batchId
Named in the X-MailSenpai-Ignored response header.
Refused with the Brevo error
templateId, scheduledAt, attachments by url, sender.id (400 invalid_parameter)
Only the transactional send endpoint is covered: contacts, lists and campaigns are not part of SMTP Senpai. The Node SDK retries on 5xx and 429: set headers.idempotencyKey so a retry never sends twice.
Delivery results from the SMTP Senpai API
The Brevo endpoints for logs, events, statistics and webhooks are not reproduced. Results (sent, delivered, bounce, defer, complaint, dropped, open, click) come from the SMTP Senpai API with the same key: GET /relay/v1/eventi, or a signed webhook set in your SMTP Senpai area.
The id in the send response (messageId) is the message_id of those events. Each response also carries X-MailSenpai-Result (sent, queued, suppressed, failed).
Read the events and webhook reference
curl "https://app.mailsenpai.com/relay/v1/eventi?quanti=50" \
-H "Authorization: Bearer $SMTP_SENPAI_KEY"
# {"ok": true, "eventi": [{"type": "delivered",
# "email": "…", "message_id": "…", …}], "prossimo": …}Frequently asked questions
Do I have to rewrite my Brevo code?
No. You change the base URL (or the host) and the key. Paths, fields, responses and the error format stay those of the Brevo transactional email API, so your SDK and your error handling keep working.
What about templates and scheduled sending?
They are not supported: requests that use them are refused with the native error, so nothing leaves by mistake. Build the final content in your code and send it when you want it to leave.
How do I get bounces, opens and webhooks?
From the SMTP Senpai API, with the same key: GET /relay/v1/eventi or a signed webhook set in your SMTP Senpai area. The Brevo event and webhook endpoints are not reproduced.
Can I test without sending?
Yes, as with Brevo: set headers["X-Sib-Sandbox"] = "drop". The request is checked and nothing is sent.
Can I keep sending through SMTP?
Yes. The same account also works over SMTP (relay.mailsenpai.com, port 2525, STARTTLS) and with the SMTP Senpai REST API.
The other formats SMTP Senpai accepts
All 14 compatible APIs
The table with every base URL, dedicated host and key.
OpenSendGrid API compatible
SendGrid v3 Mail Send API
OpenMailgun API compatible
Mailgun Messages API
OpenAmazon SES API compatible
Amazon SES API (v2 SendEmail, v1 SendEmail and SendRawEmail)
OpenPostmark API compatible
Postmark Email API
OpenResend API compatible
Resend Emails API
OpenTry SMTP Senpai with your current code
14 days to change the base URL and the key, send your real emails and check every result in the log. Then decide.
Brevo is a trademark of Sendinblue SAS. It is named only to describe the request format SMTP Senpai accepts. MailSenpai is not affiliated with Brevo and this page is not approved by them. Information checked on 9 October 2026.