Skip to content
tsubotitsch edited this page Jun 25, 2025 · 3 revisions

Brevo - A PowerShell module to automate your Brevo environment

PowerShell Gallery Version PowerShell Gallery Downloads Platform GitHub Issues

Brevo is a versatile digital marketing platform that enables businesses to streamline customer communication through multiple channels, including email, SMS, and more.

This PowerShell module contains functions to automate Brevo via the Brevo API

See Brevo API documentation

Functions

General Contact Management Marketing Account and Settings
Connect-Brevo Add-BrevoContactListMember Get-BrevoEmailCampaign Get-BrevoUser
Disconnect-Brevo Get-BrevoContact Remove-BrevoEmailCampaign Get-BrevoUserActivitylog
Invoke-BrevoCall Get-BrevoContactAttribute Send-BrevoEmailCampaign Get-BrevoUserPermission
Get-BrevoContactFolder Send-BrevoUserInvitation
Get-BrevoContactList
Get-BrevoContactListMember Confirm-BrevoDomain
Get-BrevoContactSegment Get-BrevoDomain
Import-BrevoContact New-BrevoDomain
New-BrevoContact Remove-BrevoDomain
New-BrevoContactAttribute Test-BrevoDomain
New-BrevoContactFolder
Remove-BrevoContact Get-BrevoSender
Remove-BrevoContactAttribute New-BrevoSender
Remove-BrevoContactFolder Remove-BrevoSender
Remove-BrevoContactList
Update-BrevoContact Get-BrevoAccount
Update-BrevoContactList
New-BrevoDomain
Remove-BrevoDomain
Test-BrevoDomain

How to start?

# PowerShellGet 2.x
Install-Module -Name Brevo -Repository PSGallery

# PowerShellGet 3.x
Install-PSResource -Name Brevo

Import-Module Brevo

# List all available cmdlets provided by the module
Get-Command -Module Brevo

1st steps

You have to have an API key first. Using your API key to authenticate

  • Login to Brevo.com or register for free
  • Navigate to My Profile > SMTP & API > API-Key > Generate ne API Key
  • Copy the generated key for later use
  • Note: IPs have to be explicitly whitelisted in Brevo to allow API access. See IP Whitelisting, navigate to Menu > SMTP & API > Authorized IPs or click here to manage your IPs in Brevo: Manage IPs
    • Alternatively, you can turn off the IP restriction (if it regularly changes) and use the API key without IP restrictions - see the screenshot below
      Deactivate Blocking of unknown IPs - before deactivation
      After deactivation, you can use the API key without IP restrictions - see the screenshot below
      Deactivate Blocking of unknown IPs - after deactivation
# Create Credentials
# $apikey = Get-credential -Message "Please enter your Brevo API key (username doesn't matter)"
# $apikey | Export-Clixml -Path ".\Brevo-APIkey.local.xml"

$apikey = Import-Clixml -Path ".\Brevo-APIkey.local.xml"

Connect-Brevo -APIkey $apikey

Retrieving data

List all attributes

Get-BrevoContactAttributes

List all contact folders

Get-BrevoContactFolder | Format-Table

List all contact lists

Get-BrevoContactList | Format-Table

Creating data

Create a contact folder

New-BrevoContactFolder -Name "MyFolder01"

Create a contact list

$ContactFolder = Get-BrevoContactFolder | Where-Object { $_.name -eq "MyFolder01" }
New-BrevoContactList -Name "MyList" -FolderId $ContactFolder.id

Create a contact attribute

New-BrevoContactAttribute -attributeCategory normal -type text -attributeName USERTYPE

Create a new contact

New-BrevoContact -Email "test01@example.org" -attributes @{FNAME="Elly"; LNAME="Roger";COUNTRIES=@("India","China")} -listIds 22,355

Clone this wiki locally