# Migrate from Brevo

> Move from Brevo (formerly Sendinblue) to Emailit. Convert smtp/email API calls and template language, swap SMTP keys, and move webhooks, blocklists, contacts, campaigns and automations.

This guide maps Brevo concepts, API calls, webhooks, blocklists, templates, contacts and automations to their Emailit equivalents. Brevo was called Sendinblue until 2023, and some of its hosts and headers still use that name. Read [Migrate to Emailit](/docs/migrate/) first for the overall order and how to run both providers in parallel.

## Concepts

| Brevo | Emailit |
| --- | --- |
| Account and sub-accounts | Account and [workspaces](/docs/workspaces/). Each workspace has its own domains, keys, members and credits. |
| API keys | [API keys](/docs/developers/api-keys/): **Full Access**, or **Sending Only** optionally restricted to one domain |
| SMTP login and SMTP keys | Your API key, used as the SMTP password |
| Senders, verified one by one or through an authenticated domain | [Sending domains](/docs/domains/). Single sender addresses aren't available. |
| `X-Sib-Sandbox` header | No test mode. New workspaces are in [sandbox mode](/docs/workspaces/production-access/) and deliver only to workspace members. |
| Templates and the Brevo template language | [Templates](/docs/templates/) with an alias and versions, rendered with [Temple](/docs/templates/temple/) |
| Transactional, marketing and inbound webhooks | [Webhooks](/docs/webhooks/) |
| Inbound parsing | [Inbound email](/docs/inbound/) |
| Blocked contacts (transactional) and blocklisted contacts (campaigns) | [Suppressions](/docs/suppressions/) |
| Contacts, attributes and lists | [Contacts](/docs/contacts/), [custom fields](/docs/contacts/custom-fields/) and [audiences](/docs/audiences/) |
| Segments | Pick and exclude audiences in each campaign. [Segments](/docs/segments/) are in alpha and open to the Emailit team only. |
| Email campaigns | [Campaigns](/docs/campaigns/) |
| Automations | [Automations](/docs/automations/) (beta) |
| Forms | [Forms](/docs/forms/) (early access), or an audience's [subscribe URL](/docs/audiences/subscribe-url/) |
| `tags` and the `X-Mailin-custom` header | `meta` |
| Dedicated IPs | [Dedicated IPs](/docs/deliverability/dedicated-ips/) on request |

## Update your API calls

Brevo's `POST /v3/smtp/email` becomes `POST /v2/emails`. The key moves from the `api-key` header to `Authorization`, and the field names get shorter:

```bash title="Before: Brevo"
curl https://api.brevo.com/v3/smtp/email \
  -H "api-key: $BREVO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sender": { "email": "hello@acme.com", "name": "Acme" },
    "to": [{ "email": "ada@example.com" }],
    "subject": "Your receipt",
    "textContent": "Thanks for your order.",
    "htmlContent": "<p>Thanks for your order.</p>"
  }'
```

```bash title="After: Emailit"
curl https://api.emailit.com/v2/emails \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme <hello@acme.com>",
    "to": "ada@example.com",
    "subject": "Your receipt",
    "text": "Thanks for your order.",
    "html": "<p>Thanks for your order.</p>"
  }'
```

| Brevo | Emailit |
| --- | --- |
| `api-key: xkeysib-…` header | `Authorization: Bearer secret_…` |
| `sender: { email, name }` or `sender: { id }` | `from: "Name "` |
| `to`, `cc`, `bcc` with `email` and `name` | `to`, `cc`, `bcc` as a string or an array of up to 50 each |
| `replyTo: { email, name }` | `reply_to` |
| `subject`, `htmlContent`, `textContent` | `subject`, `html`, `text` |
| `headers` | `headers` |
| `attachment[]` with `content` and `name`, or `url` | `attachments[]` with `content`, `filename` and `content_type`, or `url` |
| `templateId` and `params` | `template` (an alias or ID) and `variables` |
| `tags`, `headers["X-Mailin-custom"]` | `meta`, returned in webhook events |
| `scheduledAt` (up to 72 hours ahead) | `scheduled_at` (ISO 8601 or plain English) |
| `headers.idempotencyKey` (kept for 30 minutes) | An `Idempotency-Key` HTTP header, kept for 24 hours |
| `messageVersions[]` | Not available. Send one request per recipient, each with its own `variables`. |
| `headers["X-Sib-Sandbox"]` | Not available |
| `201` with `messageId` | `200` with `id` (`em_…`), `status: "accepted"` and, for several recipients, `ids` with one ID each |

Brevo has no tracking setting per email. In Emailit, `tracking: { "loads": true, "clicks": true }` overrides the domain's tracking for one email. See [Send an email](/docs/email-api/send-email/).

## Switch SMTP settings

| Setting | Brevo | Emailit |
| --- | --- | --- |
| Host | `smtp-relay.brevo.com` | `smtp.emailit.com` |
| Port | `587` or `2525` (STARTTLS), `465` (TLS) | `587`, `2587`, `2525` or `25` (STARTTLS), `465` (TLS) |
| Username | Your SMTP login, such as `…@smtp-brevo.com` or your account email | `emailit` |
| Password | An SMTP key | Your Emailit API key |

Emailit doesn't read Brevo's headers, such as `X-Mailin-custom` or `X-Mailin-Tag`. Remove them, and use the API when you need metadata. See [SMTP settings](/docs/smtp/settings/).

## Map webhook events

| Brevo event | Emailit event |
| --- | --- |
| `request` (sent) | `email.accepted` (API only) |
| `delivered` | `email.delivered` |
| `deferred` | `email.attempted` |
| `soft_bounce` | `email.attempted` while Emailit retries, then `email.bounced` if every retry fails |
| `hard_bounce` | `email.bounced` |
| `invalid_email` | An error in the API response for a malformed address, or `email.bounced` if the address doesn't exist |
| `blocked` | `email.suppressed` |
| `error` | `email.failed` |
| `spam` | `email.complained` |
| `opened`, `unique_opened`, `proxy_open` | `email.loaded`, sent for every load |
| `click` | `email.clicked` |
| `unsubscribed`, `unsubscribe` | `email.unsubscribed`, for campaign email only |
| `list_addition` | `subscriber.created` |
| `contact_updated`, `contact_deleted` | `contact.updated`, `contact.deleted` |
| `inboundEmailProcessed` | `email.received`, then fetch the content with [`GET /emails/{id}`](/docs/api-reference/emails/get/) |

The request format changes:

- Brevo posts one event per request, or batches of up to 500 when batching is on. Emailit posts a JSON array of up to 100 events, so loop over the body.
- The event name moves from `event` to `type`, and the email is in `data.object`. Use `data.object.id`, the `em_` ID from the send response, instead of `message-id`, and `data.object.to` instead of `email`. Your `meta` values, which replace `tags` and `X-Mailin-custom`, are in `data.object.meta`.
- For `email.loaded` and `email.clicked`, `data.object` is the load or the click. Use `data.object.email_id` for the email's ID, and `data.object.email.rcpt_to` and `data.object.email.meta` for the recipient and your `meta` values.
- Brevo doesn't sign webhooks; you protect them with credentials or a token. Emailit signs every request: verify `X-Emailit-Signature` against `X-Emailit-Timestamp` and your `whsec_` secret. See [Request signature](/docs/webhooks/request-signature/).

```javascript
for (const event of req.body) {
  const email = event.data.object;
  if (event.type === 'email.bounced') markBounced(email.to, email.id);
  if (event.type === 'email.complained') unsubscribe(email.to);
}
```

## Move suppressions

Brevo keeps two blocklists. Bring both over:

1. **Transactional blocked contacts.** Export them from **Settings > Transactional emails > Blocked or Unsubscribed contacts**, or page through `GET /v3/smtp/blockedContacts`. Use the type `recipient` for all of them. Brevo blocks an address for one sender, and Emailit blocks it for the whole workspace.

2. **Blocklisted campaign contacts.** In **CRM > Contacts**, filter on email campaign subscriptions **Blocklisted** and export, or use `POST /v3/contacts/export`. Use the type `recipient` for hard bounces and spam complaints, and `unsubscribe` for unsubscribes. The type `unsubscribe` stops every campaign but still lets transactional email through, so don't add it for people who only left one list and are still subscribed to another.

3. **Build one CSV** with the columns `email,type,reason`:

```csv
email,type,reason
old-address@example.com,recipient,brevo hard bounce
left@example.com,unsubscribe,brevo unsubscribed
```

4. **Import it.** In **Email API → Suppressions**, select **Import** and upload the file. Each file can have up to 10,000 rows and can be at most 8 MB. Duplicates are skipped.

Blocked domains have no equivalent, because Emailit suppresses exact addresses. See [Manage suppressions](/docs/suppressions/manage/).

## Move contacts

1. **Create custom fields.** For each Brevo contact attribute you use, other than `EMAIL`, `FIRSTNAME` and `LASTNAME`, create a [custom field](/docs/contacts/custom-fields/) in Emailit. Keys are lowercase, so `COMPANY` becomes `company`.

2. **Create audiences**, one for each Brevo list you send campaigns to.

3. **Export each list** from **CRM > Contacts** with **More actions > Export**, including the attributes and the subscription status. Leave out blocklisted contacts and people who unsubscribed from the list.

4. **Import it.** In **Email Marketing → Contacts**, select **Import**, map `EMAIL`, `FIRSTNAME`, `LASTNAME` and your attributes, and choose the matching audience. Split files into parts of up to 2,500 rows. See [Import and export contacts](/docs/contacts/import-export/).

The import adds everyone in the file as subscribed, so check the file for opt-outs before you import it.

## Move templates

Get each template's HTML with `GET /v3/smtp/templates/{templateId}` for transactional templates, or `GET /v3/emailCampaigns/{campaignId}` for campaigns. Both return it in `htmlContent`. Import it in **Email Marketing → Templates** or create it with the [Templates API](/docs/api-reference/templates/create/), and give it an alias, such as `receipt`.

Convert the Brevo template language to Temple:

| Brevo | Emailit (Temple) |
| --- | --- |
| `{{ params.name }}`, `{{ params.order.total }}` | `{{name}}`, `{{order.total}}` |
| `{{ contact.FIRSTNAME }}`, `{{ contact.LASTNAME }}` | `{{first_name}}`, `{{last_name}}` in campaigns |
| `{{ contact.COMPANY }}` | `{{cf.company}}` in campaigns |
| `{{ params.name\|default:"there" }}` | `{{name\|"there"}}` |
| `{% if params.plan %}…{% else %}…{% endif %}` | `{{#if plan}}…{{else}}…{{/if}}` |
| `{% if params.plan == "pro" %}`, `{% elif %}` | Not supported. Pass a boolean such as `is_pro` and use `{{#if is_pro}}`. |
| `{% for item in params.items %}…{% endfor %}` | Not supported. Render the list in your code and pass it as one variable. |
| Filters such as `upper` or `date` | Not supported. Format the value in your code. |
| `{{ unsubscribe }}` | `{{unsubscribe_url}}` in campaigns |
| `{{ update_profile }}` | `{{manage_subscriptions_url}}` in campaigns |
| `{{ mirror }}` | `{{webview_url}}` in campaigns |

Brevo escapes HTML unless you add `safe`. Temple never escapes HTML, so escape user input before you pass it. See [Temple](/docs/templates/temple/) and [Merge tags](/docs/campaigns/merge-tags/).

## Rebuild campaigns and automations

Create your campaigns in **Email Marketing → Campaigns** from your imported templates. Rebuild each Brevo automation as an Emailit [automation](/docs/automations/) in the **Contact** context:

| Brevo trigger | Emailit trigger |
| --- | --- |
| Contact added to list, removed from list | **Added to audience**, **Removed from audience** |
| Anniversary, or a date attribute | **Date anniversary**, **Date in contact field** |
| Form submitted | **Form submitted**, for [Emailit forms](/docs/forms/) (early access) |
| Email opened, link clicked | **Email opened**, **Link clicked** |
| Unsubscribed from email list | **Unsubscribed** |
| Custom event | **Custom event**, on Business and Custom plans |

Start each automation before you move your sign-up forms, so new contacts get their emails from the first day.

## Change DNS

Add your domain in **Email API → Domains** and publish the Emailit records. They use their own names (`emailit._domainkey`, `emailit.<domain>`, and optionally `go` and `inbound`), so they don't conflict with Brevo's `brevo-code` TXT record or its DKIM records (`brevo1._domainkey` and `brevo2._domainkey`, or `mail._domainkey` on older setups). Keep your DMARC record. See [DNS records](/docs/domains/dns-records/).

After the cutover, remove the Brevo code, DKIM and branded subdomain records, and `include:spf.brevo.com` or `include:spf.sendinblue.com` if your SPF record has it. If you receive mail with Brevo inbound parsing, move it to an Emailit [inbound subdomain](/docs/inbound/set-up/) first.

## Next steps

- [Go-live checklist](/docs/get-started/go-live/)
- [Create a campaign](/docs/campaigns/create/)
- [Priority migration](/docs/programs/priority-migration/): let Emailit engineers do the move with you

---
Source: https://emailit.com/docs/migrate/brevo/
