Skip to content

Add Brevo handler - #15

Open
brejesh4318 wants to merge 1 commit into
mindsdb:mainfrom
brejesh4318:add-brevo-handler
Open

brejesh4318 wants to merge 1 commit into
mindsdb:mainfrom
brejesh4318:add-brevo-handler

Conversation

@brejesh4318

Copy link
Copy Markdown

Description

Adds a read-only handler for Brevo (formerly Sendinblue) using the v3 REST API. No new dependencies.

Tables: contacts, lists, campaigns (delivery stats summed across lists) and contact_events (opens, clicks, and so on).

  • Pages through all results using the API's total count.
  • Sends email, list_id, campaign_id and event_type equality filters to Brevo instead of filtering locally.
  • Retries on HTTP 429, honouring Retry-After.
  • check_connection passes Brevo's own error text through, because a 401 is often the IP allowlist rather than a bad key.
  • contact_events makes one API call per contact unless filtered by email, since Brevo has no bulk events endpoint. This is documented in the README.

Not included: write support (INSERT into contacts).

Type of change

  • ⚡ New feature (non-breaking change which adds functionality)

Verification Process

To ensure the changes are working as expected:

  • Test Location: mindsdb/integrations/handlers/brevo_handler/tests/test_brevo_handler.py
  • Verification Steps:
    1. Run python -m unittest mindsdb.integrations.handlers.brevo_handler.tests.test_brevo_handler -v (14 tests).
    2. With a Brevo API key, run:
      CREATE DATABASE brevo_src WITH ENGINE = 'brevo', PARAMETERS = {"api_key": "xkeysib-..."};
      SELECT * FROM brevo_src.contacts LIMIT 10;
      SELECT campaign_name, sent, delivered, open_rate FROM brevo_src.campaigns;
    I ran all four tables, with filters and LIMIT, directly against a real Brevo account. I have not yet run them through the MindsDB SQL layer.

Additional Media:

  • I have attached a screenshot showcasing the new functionality or change.
image

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

Read-only handler for Brevo (formerly Sendinblue) exposing contacts, lists,
campaigns (with delivery statistics) and contact_events tables via the
Brevo v3 REST API. Includes rate-limit backoff, filter pushdown and tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@brejesh4318

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant