Brevo: send a transactional email (`brevo` connection)
const url = 'http://localhost:3000/v3/smtp/email';const options = { method: 'POST', headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'}, body: '{"sender":{"email":"hello@example.com","name":"example"},"to":[{"email":"hello@example.com","name":"example"}],"cc":[{"email":"hello@example.com","name":"example"}],"bcc":[{"email":"hello@example.com","name":"example"}],"replyTo":{"email":"hello@example.com","name":"example"},"subject":"example","htmlContent":"example","textContent":"example","templateId":1,"params":{"additionalProperty":"example"},"headers":{"additionalProperty":"example"},"attachment":[{"content":"example","url":"https://example.com","name":"example"}],"tags":["example"],"scheduledAt":"2026-04-15T12:00:00Z","batchId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","messageVersions":[{"to":[{"email":"hello@example.com","name":"example"}],"cc":[{"email":"hello@example.com","name":"example"}],"bcc":[{"email":"hello@example.com","name":"example"}],"replyTo":{"email":"hello@example.com","name":"example"},"subject":"example","htmlContent":"example","textContent":"example","params":{"additionalProperty":"example"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/v3/smtp/email \ --header 'Content-Type: application/json' \ --header 'api-key: <api-key>' \ --data '{ "sender": { "email": "hello@example.com", "name": "example" }, "to": [ { "email": "hello@example.com", "name": "example" } ], "cc": [ { "email": "hello@example.com", "name": "example" } ], "bcc": [ { "email": "hello@example.com", "name": "example" } ], "replyTo": { "email": "hello@example.com", "name": "example" }, "subject": "example", "htmlContent": "example", "textContent": "example", "templateId": 1, "params": { "additionalProperty": "example" }, "headers": { "additionalProperty": "example" }, "attachment": [ { "content": "example", "url": "https://example.com", "name": "example" } ], "tags": [ "example" ], "scheduledAt": "2026-04-15T12:00:00Z", "batchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "messageVersions": [ { "to": [ { "email": "hello@example.com", "name": "example" } ], "cc": [ { "email": "hello@example.com", "name": "example" } ], "bcc": [ { "email": "hello@example.com", "name": "example" } ], "replyTo": { "email": "hello@example.com", "name": "example" }, "subject": "example", "htmlContent": "example", "textContent": "example", "params": { "additionalProperty": "example" } } ] }'Idempotency as Brevo documents it: the idempotencyKey entry (any case) of the headers body field, a UUID (else 400 invalid_parameter), kept 30 minutes; any reuse within that window, same body or not, answers 400 duplicate_parameter and is not processed. The Idempotency-Key HTTP header is ignored.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example generated
{ "sender": { "email": "hello@example.com", "name": "example" }, "to": [ { "email": "hello@example.com", "name": "example" } ], "cc": [ { "email": "hello@example.com", "name": "example" } ], "bcc": [ { "email": "hello@example.com", "name": "example" } ], "replyTo": { "email": "hello@example.com", "name": "example" }, "subject": "example", "htmlContent": "example", "textContent": "example", "templateId": 1, "params": { "additionalProperty": "example" }, "headers": { "additionalProperty": "example" }, "attachment": [ { "content": "example", "url": "https://example.com", "name": "example" } ], "tags": [ "example" ], "scheduledAt": "2026-04-15T12:00:00Z", "batchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "messageVersions": [ { "to": [ { "email": "hello@example.com", "name": "example" } ], "cc": [ { "email": "hello@example.com", "name": "example" } ], "bcc": [ { "email": "hello@example.com", "name": "example" } ], "replyTo": { "email": "hello@example.com", "name": "example" }, "subject": "example", "htmlContent": "example", "textContent": "example", "params": { "additionalProperty": "example" } } ]}Responses
Section titled “Responses”Accepted.
Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Set when the response is replayed for the same Idempotency-Key.
Set when the response is replayed for the same Idempotency-Key.
Error: validation_error, idempotency_mismatch
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: unauthorized
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Sent with every 401.
Sent with every 401.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: forbidden
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: payload_too_large
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: rate_limited, chaos_injected
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Seconds until one token is back (at least 1).
Seconds until one token is back (at least 1).
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: chaos_injected, internal_error
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: chaos_injected
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Error: chaos_injected
object
Example
{ "code": "invalid_parameter"}Headers
Section titled “Headers”Id of the request (req_…), also the id of its request log row.
Id of the request (req_…), also the id of its request log row.
Requests per window.
Requests per window.
Whole tokens left in the bucket.
Whole tokens left in the bucket.
Seconds until the bucket is full again.
Seconds until the bucket is full again.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.
Brevo copy of the matching X-RateLimit header.