WhatsApp messages

Send transactional WhatsApp messages using the Brevo API

Send transactional WhatsApp messages such as order confirmations, status updates, and password reset links.

Activate WhatsApp

Before using WhatsApp APIs, activate the feature in your Brevo account:

1

Enable WhatsApp

Log in to your Brevo account and navigate to the top navigation bar. Click “Add more apps” to open Apps and Integration.

2

Activate feature

Under Apps, scroll down and enable the WhatsApp feature. WhatsApp appears in your Brevo dashboard after activation.

3

Set up business account

After activating WhatsApp, sign up for Facebook and WhatsApp Business accounts. See Getting started with WhatsApp campaigns in Brevo for setup instructions.

Send a WhatsApp message

Send a transactional WhatsApp message using a template or plain text.

Endpoint: POST /v3/whatsapp/sendMessage

Using a template

For the first message, use a templateId. Create templates in your Brevo account:

  1. Go to the WhatsApp campaigns dashboard
  2. Click “Create a campaign” in the top right
  3. After creating the campaign, use the template list endpoint to fetch the templateId
$curl --request POST \
> --url https://api.brevo.com/v3/whatsapp/sendMessage \
> --header 'accept: application/json' \
> --header 'api-key: YOUR_API_KEY' \
> --header 'content-type: application/json' \
> --data '{
> "contactNumbers": [
> "4915778559164"
> ],
> "templateId": 465118589032810,
> "senderNumber": "917878172050"
>}'

Request parameters

Template based message

ParameterTypeDescriptionRequired
templateIdIntegerTemplate ID to useYes
senderNumberStringWhatsApp number with country codeYes
contactNumbersArray of stringsList of recipient phone numbersYes

Text based message

ParameterTypeDescriptionRequired
senderNumberStringWhatsApp number with country codeYes
textStringMessage body (used if templateId is not provided)No
contactNumbersArray of stringsList of recipient phone numbersYes

Enter phone numbers without characters or spaces. Include country codes (e.g., 4915778559164). Find your templateId in Campaigns > WhatsApp in your Brevo account.

Response

Status codeDescription
201Message sent successfully
400Invalid parameters

Get WhatsApp activity

Retrieve unaggregated WhatsApp event data for the past 30 days (default) or a custom date range.

Endpoint: GET /v3/whatsapp/statistics/events

$curl --request GET \
> --url 'https://api.brevo.com/v3/whatsapp/statistics/events?limit=50&offset=0&startDate=2024-01-01&endDate=2024-01-31' \
> --header 'accept: application/json' \
> --header 'api-key: YOUR_API_KEY'

Query parameters

ParameterTypeDescriptionRequired
limitInt64Maximum number of results to returnNo
offsetInt64Starting point in the results listNo
startDateStringStart date (YYYY-MM-DD). Required if endDate is provided. Must be less than or equal to endDate.No
endDateStringEnd date (YYYY-MM-DD). Required if startDate is provided. Must be greater than or equal to startDate.No
daysInt64Number of days in the past including today. Not compatible with startDate and endDateNo
contactNumberStringFilter results for a specific contact (WhatsApp number with country code)No
eventStringFilter by event typeNo
sortStringSort order: asc or desc. Default is descNo

Response

Status codeDescription
200Returns WhatsApp event report data
400Invalid parameters or routing error