> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Weekly event exports

If you have a high volume of marketing events each week, this service generates raw data exports of all webhook calls over a 7-day period. Pipe the exported raw data into your preferred analytics tools.

To use this service, open a webhook on your infrastructure to receive a link to a CSV file containing the unaggregated raw data once the export is computed. If the raw data volume is too high, you receive a compressed file with multiple CSVs.

Currently the data exports include the following events:

| Event name            | API response field | Documentation                                                           |
| --------------------- | ------------------ | ----------------------------------------------------------------------- |
| Marked as Spam        | `spam`             | [Marked as Spam](/docs/marketing-webhooks#marked-as-spam)               |
| Opened                | `opened`           | [Opened](/docs/marketing-webhooks#opened)                               |
| Clicked               | `click`            | [Clicked](/docs/marketing-webhooks#clicked)                             |
| Hard Bounced          | `hard_bounce`      | [Hard Bounced](/docs/marketing-webhooks#hard-bounced)                   |
| Soft Bounced          | `soft_bounce`      | [Soft Bounced](/docs/marketing-webhooks#soft-bounced)                   |
| Delivered             | `delivered`        | [Delivered](/docs/marketing-webhooks#delivered)                         |
| Unsubscribe           | `unsubscribe`      | [Unsubscribe](/docs/marketing-webhooks#unsubscribe)                     |
| Contact Deleted       | `contact_deleted`  | [Contact Deleted](/docs/marketing-webhooks#contact-deleted)             |
| Contact Updated       | `contact_updated`  | [Contact Updated](/docs/marketing-webhooks#contact-updated)             |
| Contact added to list | `list_addition`    | [Contact added to list](/docs/marketing-webhooks#contact-added-to-list) |
| All events            | `allEvents`        | Fetches all events for the specified time period                        |

## Define an export notify url

Create a notify URL on your side to receive the webhook call containing the information and path of the generated CSV file with your transactional raw data. The data persists for 7 days.

**Example**

```curl
curl --request POST \
     --url https://mydomain.com/importData \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
     
     ------
     ==> Returns 'success' to our servers
```

## Post a new job export

To execute the export job, call the following endpoint:

* [Export all webhook events](/reference/export-webhooks-history)

This example creates a job request for `allEvents` registered in the past `7` days. You can also define more specific queries with additional filters.

```json
curl --request POST \
     --url https://api.brevo.com/v3/webhooks/export \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "event": "allEvents",
  "type": "marketing",
  "days": 7,
  "notifyURL": "https://mydomain.com/importData"
}
'
```

## Response

If your request is accepted, you receive a `processId`. Use it to track the status of the asynchronous export operation via the following endpoint:

* [Return the informations for a process](/reference/get-process)

```json
{
  "processId": 1843555083931176858
}
```

## Receiving the raw data on your application

Once the asynchronous job completes, your notifyURL receives the following payload, indicating the data is ready and uploaded to the `url` path below. Each data export URL has an expiry, so download the file before it is removed from our servers.

**`JSON`**

```json JSON
{
  "url": "https://webhooks-export.brevo.com/webhook-export-2036548-1680071958.zip?Expires=1680075559&KeyName=webhooks-export-cdn&Signature=sop8E-xYkUd8keGKb60CcIaPp0c=",
  "process_id": 1843555083931176858
}
```

### CSV contents

**`csv`**

```Text csv
date,email,event,id,message-id,reason,sending_ip,subject,tag,tags,template_id,ts,ts_epoch,ts_event,X-Mailin-custom,link,s_returnpath
2023-03-15 11:09:22 +0000 UTC,ankit.Balodhi@brevo.com,spam,13997,<202302241202.77117841982@smtp-relay.mailin.fr>,sent,127.0.0.1,Test Subject,,"[""testTag1"",""testTag2"",""testTag3"",""testTag4""]",45678,1676545042,1676534500,1676545042,TEST-X-Mailin-custom,https://brevo.com,false
2023-03-15 11:09:22 +0000 UTC,ankit.Balodhi@brevo.com,spam,13997,<202302241202.77117841982@smtp-relay.mailin.fr>,sent,127.0.0.1,Test Subject,,"[""testTag1"",""testTag2"",""testTag3"",""testTag4""]",45678,1676545042,1676534500,1676545042,TEST-X-Mailin-custom,https://brevo.com,false
2023-03-15 11:09:22 +0000 UTC,ankit.Balodhi@brevo.com,spam,13997,<202302241202.77117841982@smtp-relay.mailin.fr>,sent,127.0.0.1,Test Subject,,"[""testTag1"",""testTag2"",""testTag3"",""testTag4""]",45678,1676545042,1676534500,1676545042,TEST-X-Mailin-custom,https://brevo.com,false
2023-03-15 11:09:22 +0000 UTC,ankit.Balodhi@brevo.com,spam,13997,<202302241202.77117841982@smtp-relay.mailin.fr>,sent,127.0.0.1,Test Subject,,"[""testTag1"",""testTag2"",""testTag3"",""testTag4""]",45678,1676545042,1676534500,1676545042,TEST-X-Mailin-custom,https://brevo.com,false
2023-03-15 11:09:22 +0000 UTC,ankit.Balodhi@brevo.com,spam,13997,<202302241202.77117841982@smtp-relay.mailin.fr>,sent,127.0.0.1,Test Subject,,"[""testTag1"",""testTag2"",""testTag3"",""testTag4""]",45678,1676545042,1676534500,1676545042,TEST-X-Mailin-custom,https://brevo.com,false

```

## Checking the status of an ongoing export job

Query the `process_id` you received in the response on the [Return the informations for a process](/reference/get-process) endpoint.

```
{
  "id": 1843555083931176858,
  "status": "completed",
  "name": "EXPORT_MARKETING",
  "export_url": "https://webhooks-export.brevo.com/webhook-export-2036548-1680071958.zip?Expires=1680075559&KeyName=webhooks-export-cdn&Signature=sop8E-xYkUd8keGKb60CcIaPp0c="
}
```

#### Limitations and quotas

* The maximum number of exports per 7-day period is 20.
* If the data volume is too high, you receive a compressed file with multiple CSV files. Iterate over them and upload them to your system.