---
title: "Brevo transactional API renders inline images when cid: matches the attachment filename"
url: "https://www.dariuszparys.com/notes/brevo-inline-images-when-cid-matches-attachment-name"
author: "Dariusz Parys"
published: 2026-11-18T00:00:00.000Z
description: "Brevo's transactional API has no Content-ID field, but an inline image renders when the cid: value is exactly the attachment's name."
---

# Brevo transactional API renders inline images when cid: matches the attachment filename

## Context

Brevo's send-transactional-email endpoint (`POST /v3/smtp/email`) takes attachments with only three fields: `url`, `content` (base64) and `name`. There is no Content-ID field. Brevo staff and third-party library docs (for example Anymail) state that inline CID images are not supported, and Brevo's FAQ recommends hosted image URLs instead.

## Insight

It works anyway, as long as the `cid:` value is **exactly the attachment's `name`**:

```json
{
  "attachment": [{ "name": "acme-mail-logo.png", "content": "<base64>" }],
  "htmlContent": "<img src=\"cid:acme-mail-logo.png\" alt=\"Acme\">"
}
```

- Brevo rewrites the reference to its own generated ID (`cid:<date>.<n>@mail.0`), and the image renders inline.
- A `cid:` that doesn't match an attachment name (for example `cid:logo` with an attachment named `logo.png`) renders **blank**.
- Brevo does a plain text replacement of the file name across the **whole HTML**, including `alt` text and visible text. Use file names that can't appear anywhere else in the email (prefix them).

## Caveats

- **Undocumented**, so it may change without notice. Keep a hosted-URL fallback in your code.
- Brevo re-hosts external `<img>` URLs on its own CDN anyway, so for the fallback any public URL is enough.
- Verified in one email client (HEY). Check Gmail and Outlook before relying on it.
- To check what was actually sent, read the stored body back with `GET /v3/smtp/emails/{uuid}`. It shows the rewritten `cid:` references.
