Event endpoints

Event endpoints track a users or a contacts interactions with Brevo platforms. You can find the Events endpoints in the Events API reference.

Create an event

This API endpoint will create an event to monitor a contacts interaction. You can refer and use the cURL request below for creating an event.

1curl --request POST \
2 --url https://api.brevo.com/v3/events \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '
6{
7 "event_name": "video_played",
8 "event_date": "2024-02-06T20:59:23.383Z",
9 "identifiers": {
10 "email_id": "jane.doe@example.com"
11 },
12 "contact_properties": {
13 "AGE": 32,
14 "GENDER": "FEMALE"
15 },
16 "event_properties": {
17 "video_title": "Brevo — The most approachable CRM suite",
18 "vide_description": "Create your free account today!",
19 "duration": 142,
20 "autoplayed": false,
21 "upload_date": "2023-11-24T12:09:10+01:00"
22 }
23}

There are a few body params for this endpoints which we will mention in a table below individually.

AttributeDatatypeDescriptionExample
event_nameStringThe name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - , _ only.video_played
event_dateStringTimestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used.2024-02-06T20:59:23.383Z
identifiersObjectIdentifies the contact associated with the event.jane.doe@example.com
contact_propertiesObjectProperties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: "FIRSTNAME": "Jane" , "AGE": 37Add properties like Ageand Gender
event_propertiesObjectProperties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - , _ only. Size is limited to 50Kb.Properties for the event video_played like video_title, video_description and duration

Response

The request returns a 204 success response with no content. On the other hand, an error response could look something like below.

1{
2 "code": "method_not_allowed",
3 "message": "POST Method is not allowed on this path"
4}
Response codeMessageDescription
204Event createdShows 204 response code when request is successful and event is created
400Bad requestRequest does not go through due to bad request because of invalid_parameters
401Unauthorized