Brevo Functions
A Brevo Function is a serverless function, running on Brevo’s infrastructure, that calculates a contact attribute — write the formula yourself, generate it with AI, or start from a predefined template.
Create a Brevo Function app
Brevo Functions live inside a Brevo Function app — one of the app types offered by brevo app create:
The prompts walk you through:
- Distribution type: Brevo Function apps must be private.
- App type: choose Brevo Function.
This writes a project directory with an app-config.json. For a Function app it looks like this:
brevo_function: {} is a static marker that identifies the app type — there’s nothing to edit inside it. A Function app has no auth block and no ui_app block. Functions themselves are created and deployed with brevo fn, not by editing this file.
Create your first function
brevo fn is the short alias for brevo function — every command in this guide works either way, for example brevo fn init or brevo function init.
The command is interactive only (it needs a terminal to prompt in) and walks you through:
- Pick the app — if you have more than one Brevo Function app, choose which one this function belongs to.
- Choose how to create it:
- Generate using AI — describe what the function should do in a sentence, and the CLI generates it for you, working through a few stages (analyzing the request, contacting databases, creating the function, testing the function).
- Use a predefined template — pick from the templates available in your account.
- Preview — before anything is named or activated, the CLI fetches sample contacts from your account and shows a preview table of what the function would return for them.
- Iterate (AI path only) — from the preview, choose Update / iterate on the prompt to describe changes and preview again, or Deploy once you’re happy with the result.
- Name it — names must be unique across your Brevo Functions.
- Confirm deploy — the CLI warns “This will activate the function and run it with real-time data” before the final confirmation. Confirming activates the function immediately and prints its ID.
If you stop before deploying, nothing is lost — see Working with drafts below.
Working with drafts
A function you’re generating or previewing, but haven’t deployed yet, is a draft. Drafts expire, so don’t leave one unfinished for too long.
To pick a draft back up and deploy it — including linking it to a Brevo Function app — use:
This runs the same sample-contact preview, naming, and deploy confirmation as brevo fn init.
Manage your functions
Every brevo fn command supports --json for machine-readable output.
See the CLI reference for the full flag list on every command above.
Join the waitlist
Want to be notified when Brevo Functions ships to your account? Leave your details below.