Skip to content

Connect Brevo to a tool built with Claude or ChatGPT (2026)

Your tool built with Claude needs to add contacts to Brevo, or send an email when a quote goes out. The Brevo credential opens your whole email marketing account, and it must end up neither in the code nor in the conversation. On while, it stays in while, and your AI never sees it. Here is how.

By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 18, 2026.

View as Markdown

Connect the Brevo API to a tool built with Claude or ChatGPT: the Brevo API key kept in while, out of the code and out of the AI’s reach, and the tool adding contacts and sending emails

Brevo holds your contacts, lists, campaigns and transactional emails. A tool built with Claude or ChatGPT becomes valuable when it talks to Brevo: adding a form’s contact to the right list, sending an email when a quote goes out, finding who opened the last campaign. To do that, it needs a Brevo API credential, and an API key opens the whole account.

That is where things often go wrong: the key ends up pasted into the code, or into the conversation with the AI, where it can leak. On while, the Brevo credential stays in while. The tool calls Brevo without ever holding it, and your AI never sees it.

The short version. Generate an API key in Brevo’s SMTP & API settings. Ask your AI to connect Brevo, then paste the key into while through the link it gives you. The tool adds your contacts and sends your emails, every call is logged, and a campaign send waits for your approval if you ask.

API key or machine to machine

Brevo offers two ways to connect a tool, and the first is enough in most cases1,3.

API keyMachine to machine
What it opensThe whole accountOnly the chosen scopes
How long it lastsUntil you delete itTokens of about an hour, renewed
Where to create itIn the SMTP & API settingsIn a terminal, with Brevo’s command tool
Who it is forEveryoneA team comfortable with a terminal

On while, both work: the API key is pasted as is, and for machine to machine, while exchanges the client credentials for a token and renews it on its own.

Connect Brevo to your tool, in three steps

The whole thing takes a few minutes, and you have no code to write.

  1. Generate a key in Brevo. Open the SMTP & API settings, then the API keys tab, and generate a new key. Give it a name that says what it is for, like “Quotes tool”. Copy it right away: Brevo shows it only once1.
  2. Ask your AI to connect Brevo. It declares the connection in while and gives you a link.
  3. Paste the key into while. You open the link, paste the key and confirm. Neither your AI nor the tool’s code sees it.

If IP security is on for your account, Brevo blocks calls from an unknown address, even with a valid key. It then sends you an email to authorize the address, or you add it in the authorized IPs of the Security menu2.

You, to your AI: Connect Brevo to this tool: each new contact from the form goes into the "Prospects" list, and a welcome email goes out right away.

The tool built with AI calls the Brevo API through while: the Brevo credential is added to each call inside while, out of the code, contacts added and emails sent are logged, and a campaign send waits for a person's approval
The tool calls Brevo through while, which adds the credential to each call.

What while does on each call

The tool calls Brevo through while, without a credential. while adds the key to each call, and logs it in the history. For the first seven days, reads go through and teach while what the tool calls. A write, like adding a contact or sending an email, goes through once you approve its rule. After that, an unexpected call is refused, and your AI is told.

An email that has gone out cannot be taken back. You can ask for your approval before a sensitive call.

You, to your AI: Ask me before every campaign the tool sends in Brevo.

The credentials of your software are detailed on our security page, and the same mechanism works for any API in connect an API with no credentials in the code.

Changing the key

If the key leaks or you lose it, generate a new one in Brevo and delete the old one1. Paste the new one into while: the tool uses it from the next call, without being put back in place, and your AI has nothing to redo.

What while adds around it

  • Your colleagues use the tool with a while account for up to 3 people, or, on the Pro plan, with their email account, Google or Microsoft. See keep a tool for your colleagues.
  • Connected software: one on the Libre plan, and 25 on the Pro plan, Brevo included.
  • The tool’s data is backed up every day, and your tools are hosted in France by Nextmap.

For contacts followed end to end, see build a simple CRM, and for related connections, HubSpot and Slack.

Try it with your tool

Give this message to your AI, then ask it to connect Brevo. The trial is free, with no sign-up, and your tool has its address in 3 minutes.

The message to give your AI
Read while.sh/agents and help me get started with while.

Sources

  1. Brevo, Generate an API key, accessed November 18, 2026
  2. Brevo, IP security & authorization, accessed November 18, 2026
  3. Brevo, Machine-to-machine authentication, accessed November 18, 2026

Questions

How do you get a Brevo API key?

In Brevo, open the SMTP & API settings, then the API keys tab, and generate a new one. Give it a name, then copy it: Brevo shows it only once1.

Does my AI see the Brevo credential?

No. Your AI declares the connection to Brevo and gives you a link. You paste the credential into while there, and neither your AI nor the tool’s code sees it.

Why does Brevo block my tool’s calls?

If IP security is on, Brevo blocks calls from an unknown address, even with a valid credential. It sends you an email to authorize the address2.

Is there narrower access than an API key?

Yes. Brevo offers machine-to-machine access, with chosen scopes and tokens valid for about an hour. It is created in a terminal with Brevo’s command tool, and while renews the token on its own3.

Can you block a campaign send by the tool?

Yes. On while, ask for your approval before each campaign send: it waits for your approval before reaching Brevo.

Give your AI the message, and it takes care of the rest

Give this to your AI

Read while.sh/agents and help me get started with while.

Copy the message

In 3 minutes, with no sign-up, the tool has its own address. To keep it, create your account.

For a company project, write to the while team: hello@while.sh