Problem Integrating Brevo Email API with My Website for Transactional Emails

Hi everyone,

I’m using Brevo’s Email API to send transactional emails (like order confirmations and password resets) from my website. While the API integration is mostly working, I’ve encountered a few technical issues that I’m struggling to resolve:

  1. Email Delivery Delays: Some transactional emails are delayed by up to 5–10 minutes, even though they should be sent immediately. I’m using the /smtp/email endpoint and specifying transactional as the email type. Is there any configuration I need to adjust to ensure faster delivery?
  2. Error 401 Unauthorized: Occasionally, I receive a 401 Unauthorized error for API calls, even though the API key hasn’t been changed. Regenerating the API key resolves the issue temporarily, but it recurs after a few days.
  3. Tracking Clicks and Opens: I’ve enabled email tracking in the Brevo dashboard, but the statistics aren’t showing for the emails sent via the API. Do I need to include any additional headers or parameters in the API request to enable tracking?

Here’s a sample of my API request:

POST https://api.brevo.com/v3/smtp/email
Headers: {
    "api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
Body: {
    "sender": {"email": "noreply@mywebsite.com", "name": "My Website"},
    "to": [{"email": "user@example.com"}],
    "subject": "Your Order Confirmation",
    "htmlContent": "<p>Thank you for your order!</p>",
    "tags": ["order-confirmation"]
}

Has anyone experienced similar issues? Any advice on how to improve email delivery speed, resolve authentication errors, or ensure tracking works correctly?

Thank you!

Is there anyone who can help me with this? I would love your guidance. :slightly_smiling_face: :grinning: Thanks!