> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/getting-started/accessing-insights/firehose-webhooks.md).

# Firehose Webhooks

## Overview

A common need among Sentiance customers is to react to user activity in real time whether that's enhancing a travel app based on mode of transport, or surfacing relevant offers when a user plans to visit a store.

Enter the **Firehose**: Firehose delivers a continuous stream of user activity events to your backend as they are processed on the users device. Delivery is handled through standard Webhooks.

## Webhooks

Firehose uses Webhooks to push event data in to your backend. When the Sentiance SDK detects a Transport, Driving Insights, or Crash Insights. it sends an HTTP POST request to your configured endpoint that has the relevant insights for you to immediatly interract with.

Webhook creation and management is done in the [**Insights Control Tower (ICT)**](/getting-started/insights-control-tower.md) under \
\&#xNAN;***Developer** → **Webhooks***, and requires the **Developer** role.

## Setup

Follow the steps below to configure and activate your Firehose Webhook.

1. Create a **POST endpoint** on your backend secured with Basic Auth or OAuth2. \
   It must return `200 OK` on success.
2. Create a **GET endpoint** on the same path with the same auth credentials. \
   It must return `200 OK` with the JSON body: `{"app_id": "<your Sentiance appID>"}`
3. Ensure both endpoints are reachable over **HTTPS** with an SSL certificate rated **grade B or higher**. Use [ssllabs.com](https://www.ssllabs.com/) to verify.
4. In ICT, navigate to Developer → Webhooks and click Create Webhook.
   1. Enter your endpoint URL, select your authorization method, and provide your credentials.
   2. Configure your max payload size, max wait time, and TTL
   3. Click Submit Request. This will start the verification process.

{% hint style="warning" %}
Firehose Webhook requests and changes must be confirmed and approved by Sentiance. \
Always consult with the Sentiance team when creating or updating.
{% endhint %}

Once all verifications pass and Sentiance approves the webhook, its status in ICT will update to **Verification successful** and delivery will begin.

You will be notified of any errors during the verification. Any other status code outside of `200 OK` by the **POST** and **GET** endpoints will result in an error during the verification process.

## Message Delivery

Once active, Sentiance delivers events to your endpoint in a consistent JSON(Envelope) format.\
The delivery system handles batching, error handling, retention, and security automatically.

Please see below for more details regarding these topics

### Batching

To reduce network overhead, messages are batched before delivery both by size and by time. \
A batch is sent when either threshold is reached first.

| Parameter        | Default   | Configurable Range |
| ---------------- | --------- | ------------------ |
| Max wait time    | 5 seconds | 1 – 300 seconds    |
| Max payload size | 1 MB      | 23 KB – 4 MB       |

That is to say that once *we have 1 MB worth of data* or *5 seconds have passed*, we will create a batch of data and send a request. These values can be configured during the Webhook setup

**Note:** Batching by size is done before gzip compression.

### Error handling and Retention

**Error Handling**

Firehose expects a `200 OK` response for every delivered message. Any other response or no response at all is treated as a failure and triggers automatic retries with exponential backoff starting from 100 ms up to 5 minutes.

{% hint style="info" %}
Sentiance guarantees at-least-once delivery. In rare cases where our server fails to register a successful response, the same message may be delivered more than once. Design your endpoint to handle duplicate events gracefully.
{% endhint %}

**Retention**&#x20;

Each webhook has a configurable **Message TTL** the maximum time Sentiance will retain and retry undelivered messages. Once a message exceeds its TTL, it is discarded. This ensures that we avoid sending stale information.

For example, if your **Message TTL** has been set to 30 minutes and your endpoint has been down for 40 minutes, on resuming you will only receive messages that are up to 30 minutes old. Messages from the first 10 minutes of downtime will have been dropped.

Set the TTL when creating your Webhook in ICT based on how much data staleness is acceptable for your use case.

### Security

**Authentication & Authorization**

Sentiance applies multiple layers of security to ensure message integrity and endpoint authenticity. To ensure that your messages originate from Sentiance and not from a malicious third party, we will set a **Basic Auth HTTP Authorization header** on every request as configured in the **Webhook Request**&#x20;

**TLS & SSL**

All connections must use HTTPS. Sentiance requires a **grade B or above** SSL certificate. Verify your endpoint at [ssllabs.com](https://www.ssllabs.com/).

All Firehose requests originate from the following dedicated IPs, Add these to your allowlist if your endpoint enforces IP filtering:

* 52.213.134.71
* 34.252.131.81

We perform a list of automated verifications before activating Firehose Webhooks.

<table><thead><tr><th width="216.3515625">Check</th><th>Description</th></tr></thead><tbody><tr><td>SSL Certificate</td><td>Valid certificate present on the endpoint</td></tr><tr><td>Auth Credentials</td><td>Correct Basic Auth credentials accepted</td></tr><tr><td>Auth Rejection</td><td>Incorrect credentials are rejected (tested explicitly)</td></tr><tr><td>App ID</td><td>GET endpoint returns the correct Sentiance Application ID<br>To ensure the data gets sent to the correct Application ID</td></tr><tr><td>Payload Handling</td><td>POST endpoint correctly processes test payloads.<br>These test payloads can be identified by looking for the HTTP header <code>sentiance-payload-type: test</code></td></tr></tbody></table>

Once automated checks pass, a member of the **Sentiance Client team** performs a final manual review. You will be notified by email when your Webhook is activated or contacted directly if any issues are found.

## Message Reference

All Webhook payloads are delivered in a standardised Envelope format, structured as follows:

* **Envelope** A parent object containing a single `data` child.
* **Data Array** An array of messages  either a single message or multiple if batched.
* **Each message contains:**
  * **`data`**  the detected insights details
    * varies depending on the `message_type` of the sibling `meta` object.
  * **`meta`**  message details, including timestamp, message type and app ID\
    which contains a `message_type` field indicating the kind of message being sent. Possible values for message\_type:
    * **on\_device\_transport\_processed**\
      Indicates a completed and processed transport.
    * **on\_device\_crash\_processed**\
      Indicates a detected and processed crash.
    * **on\_device\_geofence\_processed**\
      Indicates a geofence entry or exit.
    * **engagement**\
      Indicates an event from the Engagement platform. This message can have a sub-type.

<details>

<summary>Example Payload in Envelope Format</summary>

```json
{
  "data": [
    { // Individual messages, this can be one or multiple when batched
      "meta": {
        "message_type": <typeOfEvent>,
        "message_timestamp": <timestampOfEvent>,
        "app_id": <appID>
      },
      "data": { }
    }
  ]
}
```

</details>

#### Transports <a href="#transport-complete" id="transport-complete"></a>

Sent when a transport has been completed and processed by the SDK. This message includes the transport ID, transport mode, user ID, start and end times, app ID, detected waypoints, and more.

If you need Driving Insights for motorcycle and car transports, Transports messages can be enriched with Driving Events and Driving Scores.

<details>

<summary>Transport</summary>

```json
{
    "data": {
        "details": {
            "Waypoints": [
                {
                    "AccuracyInMeters": 3,
                    "SpeedLimitInMps": 13.88,
                    "Latitude": 51.21959,
                    "SpeedInMps": 1.53,
                    "Longitude": 4.45458,
                    "Timestamp": 1781534375002
                },
                {
                    "AccuracyInMeters": 6,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22034,
                    "SpeedInMps": 1.45,
                    "Longitude": 4.45601,
                    "Timestamp": 1781534543000
                },
                {
                    "AccuracyInMeters": 5,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22036,
                    "SpeedInMps": 1.33,
                    "Longitude": 4.45614,
                    "Timestamp": 1781534550000
                },
                {
                    "AccuracyInMeters": 6,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22029,
                    "SpeedInMps": 1.78,
                    "Longitude": 4.45628,
                    "Timestamp": 1781534554000
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22037,
                    "SpeedInMps": 1.4,
                    "Longitude": 4.45658,
                    "Timestamp": 1781534573000
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22043,
                    "SpeedInMps": 1.36,
                    "Longitude": 4.45664,
                    "Timestamp": 1781534577000
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22039,
                    "SpeedInMps": 1.07,
                    "Longitude": 4.45677,
                    "Timestamp": 1781534584000
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22039,
                    "SpeedInMps": 1.55,
                    "Longitude": 4.45705,
                    "Timestamp": 1781534597001
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22036,
                    "SpeedInMps": 1.46,
                    "Longitude": 4.45721,
                    "Timestamp": 1781534604001
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22034,
                    "SpeedInMps": 1.58,
                    "Longitude": 4.45758,
                    "Timestamp": 1781534621001
                },
                {
                    "AccuracyInMeters": 7,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22035,
                    "SpeedInMps": 1.4,
                    "Longitude": 4.45775,
                    "Timestamp": 1781534631001
                },
                {
                    "AccuracyInMeters": 9,
                    "SpeedLimitInMps": 25,
                    "Latitude": 51.22042,
                    "Longitude": 4.45862,
                    "Timestamp": 1781534641001
                }
            ],
            "DistanceInMeters": 404,
            "EndTime": "2026-06-15T16:44:01.001+02:00",
            "Version": "0.0.1",
            "UserId": "69a6fef0dfb3970800000433",
            "StartTime": "2026-06-15T16:39:27.234+02:00",
            "TransportMode": "WALKING",
            "Id": "D6A6BAA2-EF30-4B0F-8646-9166B9F449AD",
            "OccupantRole": "UNAVAILABLE",
            "Tags": []
        }
    },
    "meta": {
        "updated_attributes": [],
        "message_timestamp": "2026-06-15T14:47:20.715+00:00",
        "message_type": "on_device_transport_processed",
        "app_id": "68efa11490ae52080000bbbc"
    }
}
```

</details>

<details>

<summary>Transport with Driving Insights</summary>

```json
{
    "data": {
        "details": {
          "Waypoints": [
            {
              "AccuracyInMeters": 10,
              "SpeedLimitInMps": 25,
              "Latitude": 51.220903,
              "SpeedInMps": 6.79,
              "Longitude": 4.45717,
              "Timestamp": 1783319986463
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 19.44,
              "Latitude": 51.217074,
              "SpeedInMps": 12.08,
              "Longitude": 4.446429,
              "Timestamp": 1783320078467
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 19.44,
              "Latitude": 51.214839,
              "SpeedInMps": 0,
              "Longitude": 4.446745,
              "Timestamp": 1783320167460
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 19.44,
              "Latitude": 51.208944,
              "SpeedInMps": 0,
              "Longitude": 4.441044,
              "Timestamp": 1783320267464
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 27.77,
              "Latitude": 51.198577,
              "SpeedInMps": 21.09,
              "Longitude": 4.436211,
              "Timestamp": 1783320359509
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 27.77,
              "Latitude": 51.19215,
              "SpeedInMps": 28.75,
              "Longitude": 4.401856,
              "Timestamp": 1783320457470
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 13.88,
              "Latitude": 51.202311,
              "SpeedInMps": 4.06,
              "Longitude": 4.3891,
              "Timestamp": 1783320547464
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 13.88,
              "Latitude": 51.203092,
              "SpeedInMps": 0,
              "Longitude": 4.388736,
              "Timestamp": 1783320647470
            },
            {
              "AccuracyInMeters": 5,
              "SpeedLimitInMps": 25,
              "Latitude": 51.205674,
              "SpeedInMps": 7.15,
              "Longitude": 4.387438,
              "Timestamp": 1783320740564
            },
            {
              "AccuracyInMeters": 49,
              "Latitude": 51.204822,
              "Longitude": 4.381782,
              "Timestamp": 1783320844568
            }
          ],
          "DistanceInMeters": 9091,
          "EndTime": "2026-07-06T08:54:04.568+02:00",
          "Version": "0.0.1",
          "UserId": "69a6fef0dfb3970800000433",
          "StartTime": "2026-07-06T08:39:45.760+02:00",
          "TransportMode": "CAR",
          "Id": "6EF6F639-05B2-4AEA-9361-D97BD6139E1F",
          "DrivingInsights": {
            "SafetyScores": {
              "SmoothScore": 0.66,
              "CallWhileMovingScore": 1,
              "FocusScore": 0.76,
              "LegalScore": 0.62,
              "WrongWayDrivingScore": 1,
              "AttentionScore": 0.91,
              "OverallScore": 0.68
            },
            "Events": {
              "PhoneUsageEvents": [
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.207649,
                      "Longitude": 4.38441,
                      "Timestamp": 1783320773760
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 25,
                      "Latitude": 51.207629,
                      "SpeedInMps": 0.87,
                      "Longitude": 4.384785,
                      "Timestamp": 1783320777572
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 25,
                      "Latitude": 51.207954,
                      "SpeedInMps": 5.4,
                      "Longitude": 4.384657,
                      "Timestamp": 1783320787568
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 13.88,
                      "Latitude": 51.208034,
                      "SpeedInMps": 11.67,
                      "Longitude": 4.384155,
                      "Timestamp": 1783320797573
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.207368,
                      "Longitude": 4.383764,
                      "Timestamp": 1783320797760
                    }
                  ],
                  "EndTime": "2026-07-06T08:52:53.760+02:00",
                  "StartTime": "2026-07-06T08:52:53.760+02:00",
                  "CallState": "NO_CALL"
                }
              ],
              "CallWhileMovingEvents": [],
              "CallEvents": [],
              "HarshDrivingEvents": [
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 13.88,
                      "Latitude": 51.21763,
                      "SpeedInMps": 14.35,
                      "Longitude": 4.447286,
                      "Timestamp": 1783320067494
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.218018,
                      "Longitude": 4.446916,
                      "Timestamp": 1783320071212
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 19.44,
                      "Latitude": 51.216356,
                      "SpeedInMps": 12.07,
                      "Longitude": 4.447238,
                      "Timestamp": 1783320078467
                    }
                  ],
                  "Type": "TURN",
                  "EndTime": "2026-07-06T08:41:11.212+02:00",
                  "Confidence": 55,
                  "StartTime": "2026-07-06T08:41:11.212+02:00",
                  "Magnitude": 5.05
                },
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 33.33,
                      "Latitude": 51.204497,
                      "SpeedInMps": 18.4,
                      "Longitude": 4.439049,
                      "Timestamp": 1783320317466
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.204059,
                      "Longitude": 4.439386,
                      "Timestamp": 1783320322248
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.202926,
                      "SpeedInMps": 14.81,
                      "Longitude": 4.439016,
                      "Timestamp": 1783320327465
                    }
                  ],
                  "Type": "ACCELERATING",
                  "EndTime": "2026-07-06T08:45:22.248+02:00",
                  "Confidence": 64,
                  "StartTime": "2026-07-06T08:45:22.248+02:00",
                  "Magnitude": 2.48
                },
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.19672,
                      "SpeedInMps": 26.07,
                      "Longitude": 4.390682,
                      "Timestamp": 1783320487472
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.196757,
                      "Longitude": 4.389907,
                      "Timestamp": 1783320493402
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 25,
                      "Latitude": 51.197982,
                      "SpeedInMps": 23.8,
                      "Longitude": 4.38802,
                      "Timestamp": 1783320497469
                    }
                  ],
                  "Type": "ACCELERATING",
                  "EndTime": "2026-07-06T08:48:13.402+02:00",
                  "Confidence": 51,
                  "StartTime": "2026-07-06T08:48:13.402+02:00",
                  "Magnitude": 3.03
                },
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 13.88,
                      "Latitude": 51.203538,
                      "SpeedInMps": 3.13,
                      "Longitude": 4.389058,
                      "Timestamp": 1783320597466
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.20271,
                      "Longitude": 4.388958,
                      "Timestamp": 1783320604235
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 13.88,
                      "Latitude": 51.203947,
                      "SpeedInMps": 0,
                      "Longitude": 4.388861,
                      "Timestamp": 1783320607463
                    }
                  ],
                  "Type": "ACCELERATING",
                  "EndTime": "2026-07-06T08:50:04.235+02:00",
                  "Confidence": 55,
                  "StartTime": "2026-07-06T08:50:04.235+02:00",
                  "Magnitude": 2.77
                }
              ],
              "SpeedingEvents": [
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.192618,
                      "Longitude": 4.427015,
                      "Timestamp": 1783320395541
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.192039,
                      "SpeedInMps": 29.21,
                      "Longitude": 4.4268,
                      "Timestamp": 1783320397541
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.190685,
                      "SpeedInMps": 32.34,
                      "Longitude": 4.422175,
                      "Timestamp": 1783320410466
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.190148,
                      "SpeedInMps": 31.47,
                      "Longitude": 4.417648,
                      "Timestamp": 1783320417471
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.190253,
                      "SpeedInMps": 31.88,
                      "Longitude": 4.414549,
                      "Timestamp": 1783320427465
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.190594,
                      "SpeedInMps": 30.54,
                      "Longitude": 4.408926,
                      "Timestamp": 1783320437474
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 27.77,
                      "Latitude": 51.19112,
                      "SpeedInMps": 31.02,
                      "Longitude": 4.404751,
                      "Timestamp": 1783320448468
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.192273,
                      "Longitude": 4.40342,
                      "Timestamp": 1783320450468
                    }
                  ],
                  "EndTime": "2026-07-06T08:46:37.541+02:00",
                  "StartTime": "2026-07-06T08:46:37.541+02:00"
                },
                {
                  "Waypoints": [
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.203333,
                      "Longitude": 4.387833,
                      "Timestamp": 1783320665470
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 5.55,
                      "Latitude": 51.204262,
                      "SpeedInMps": 7.61,
                      "Longitude": 4.387792,
                      "Timestamp": 1783320667470
                    },
                    {
                      "AccuracyInMeters": 5,
                      "SpeedLimitInMps": 5.55,
                      "Latitude": 51.204441,
                      "SpeedInMps": 7.19,
                      "Longitude": 4.387872,
                      "Timestamp": 1783320678468
                    },
                    {
                      "AccuracyInMeters": 0,
                      "Latitude": 51.204076,
                      "Longitude": 4.388288,
                      "Timestamp": 1783320680468
                    }
                  ],
                  "EndTime": "2026-07-06T08:51:07.470+02:00",
                  "StartTime": "2026-07-06T08:51:07.470+02:00"
                }
              ],
              "WrongWayDrivingEvents": []
            }
          },
          "OccupantRole": "DRIVER",
          "Tags": []
        }
      },
      "meta": {
        "updated_attributes": [],
        "message_timestamp": "2026-07-06T06:57:41.529+00:00",
        "message_type": "on_device_transport_processed",
        "app_id": "68efa11490ae52080000bbbc"
      }
    }
```

</details>

#### Crash Insights

Sent when a crash has been detected and processed by the SDK.

<details>

<summary>Crash Insights</summary>

{% code expandable="true" %}

```json
{
    "data": {
        "details": {
            "SpeedAtImpact": 6.68,
            "TimestampUtcMillisSeconds": 1783622510008,
            "WaypointLatitude": 51.21881,
            "TimestampOffsetMinutes": 120,
            "MaxMagnitude": 136.49,
            "AppId": "68efa11490ae52080000bbbc",
            "CrashSeverity": "MEDIUM",
            "Version": "0.0.1",
            "DeltaV": 6.14,
            "UserId": "69a6fef0dfb3970800000433",
            "WaypointSpeed": 6.68,
            "WaypointLongitude": 4.46039,
            "ConfidencePercentage": 99
        }
    },
    "meta": {
        "updated_attributes": [],
        "message_timestamp": "2026-07-09T18:43:48.686+00:00",
        "message_type": "on_device_crash_processed",
        "app_id": "68efa11490ae52080000bbbc"
    }
}
```

{% endcode %}

</details>

#### Smart Geofences

The Smart Geofence message is sent whenever a user enters or exits a preconfigured geofence. One message can contain multiple geofences, if the triggering location touches multiple overlapping geofences.

<details>

<summary>Smart Geofences Entry</summary>

{% code expandable="true" %}

```json
{
    "data": {
        "details": {
            "Version": "0.0.1",
            "Geofences": [
                {
                    "GeofenceGroupId": "4b167019-1f0a-458c-b663-53f757bfe442",
                    "GeofenceId": "9f90a779-8d5e-4fda-875d-429b4a989313"
                }
            ],
            "UserId": "69a6fef0dfb3970800000433",
            "EventTime": "2026-07-08T16:32:40.602+02:00",
            "GeofenceEventType": "ENTRY"
        }
    },
    "meta": {
        "updated_attributes": [],
        "message_timestamp": "2026-07-08T14:32:40.889+00:00",
        "message_type": "on_device_geofence_processed",
        "app_id": "68efa11490ae52080000bbbc"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Smart Geofences Exit</summary>

{% code expandable="true" %}

```json
{
    "data": {
        "details": {
            "Version": "0.0.1",
            "Geofences": [
                {
                    "GeofenceGroupId": "4b167019-1f0a-458c-b663-53f757bfe442",
                    "GeofenceId": "9f90a779-8d5e-4fda-875d-429b4a989313"
                }
            ],
            "UserId": "69a6fef0dfb3970800000433",
            "EventTime": "2026-07-08T16:32:40.602+02:00",
            "GeofenceEventType": "EXIT"
        }
    },
    "meta": {
        "updated_attributes": [],
        "message_timestamp": "2026-07-08T14:32:40.889+00:00",
        "message_type": "on_device_geofence_processed",
        "app_id": "68efa11490ae52080000bbbc"
    }
}
```

{% endcode %}

</details>

#### Engagement

These messages are triggered by engagement actions, such as challenges, badges, and similar features. They can be used to deliver real-time push notifications to users, or as general updates about user activity.

Although all Firehose messages have a specific message type, all Engagement messages share the same value `"engagement"`  in the `message_type` field within the message's `meta` object. Each Engagement message also has a specific **sub-type**, found in the `event_type` field within the message's `data` object.

These messages can only be sent if your application is enabled on the [Engagement Platform](/getting-started/features-catalog/engagement.md)

<details>

<summary>Challenge</summary>

Trigges when a user completes or fails a challenge.

Possible values for challenge state: **COMPLETED** and **FAILED.**

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "challenge_id":"challenge.driving.focused.easy-001",
            "challenge_state":"COMPLETED",
            "progress":"100.0",
            "evaluation_id":"695bb322-c95a-4a9b-963e-bb28c58a58f2",
            "notification_id":"notification-challenge-complete-00",
            "title":"Challenge completed",
            "message":"Challenge completed! Congrats.",
            "url":"",
            "challenge_description":"The next trip with your car will be without using your phone. Deal?",
            "challenge_category":"driving",
            "challenge_subcategory":"focused",
            "challenge_difficulty":"easy",
            "challenge_image_url":""
        },
        "event_type":"CHALLENGE"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Badge</summary>

Triggered when a user achieves a badge.

Possible values for badge state: **COMPLETED.**

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "badge_id":"badge.no-speeding.level-1",
            "badge_state":"COMPLETED",
            "progress":"100.0",
            "evaluation_id":"70cd50c6-5eb2-494a-a0f6-463c1aba45f2",
            "notification_id":"notification-badge-complete-00",
            "title":"Badge earned!",
            "message":"Awesome! You earned a badge: check it out in the app.",
            "url":"",
            "badge_name":"Not making tracks",
            "badge_description":"Comply with the speed limit for 4.45 km",
            "badge_category":"No Speeding",
            "badge_reward_text":"4.45 km is exactly the length of the Phillip Island Formula 1 circuit.",
            "badge_image_url":""
        },
        "event_type":"BADGE"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Trip</summary>

Triggered when a new trip is recorded for a user.

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "evaluation_id":"70cd50c6-5eb2-494a-a0f6-463c1aba45f2",
            "notification_id":"notification-trip-complete-00",
            "title":"Trip completed!",
            "message":"We recorded a new trip for you, CHeck it out in the app!",
            "url":"",
            "event_id": "",
            "total_distance_m": "10000",
            "duration_minutes": "60"
        },
        "event_type":"TRIP"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Streak</summary>

Triggered when a user breaks a streak.

Possible values for streaks state: **BREAK.**

Possible values for streak type: STRICT and SELF\_COMPETING

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "evaluation_id":"70cd50c6-5eb2-494a-a0f6-463c1aba45f2",
            "notification_id":"notification-streak-broken-00",
            "title":"Sreak broken!",
            "message":"Oh no! Your last trip broke your streak of perfect driving!",
            "url":"",
            "streak_type": "STRICT",
            "score_type": "bae-mffs-score",
            "streak_state": "BREAK",
            "streak_count": "21"
        },
        "event_type":"STREAK"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Report</summary>

Used as trigger for delivering reports to users via email or other channels.

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "language":"en",
            "evaluation_id":"13674fa0-73d8-4513-877f-bc08810d9e9a",
            "notification_id":"notification-email-sign-up-00",
            "title":"",
            "message":"",
            "url":"",
        },
        "event_type":"REPORT"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Message</summary>

This is a generic category for events that do not fit any of the categories above. For example, an event with type MESSAGE can be triggered for reminders.

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "language":"en",
            "evaluation_id":"13674fa0-73d8-4513-877f-bc08810d9e9a",
            "notification_id":"notification-email-sign-up-00",
            "title":"",
            "message":"",
            "url":"",
        },
        "event_type":"REPORT"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Scheduled</summary>

Triggered for messages that are scheduled to be delivered at a specific time and date.

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "evaluation_id":"4bf4fefa-90dc-4aa5-ad98-1372e9b0306a",
            "notification_id":"2c260af0-22d4-4731-a9cc-4f3d02f23861",
            "title":"You are the best driver!",
            "message":"Keep it going!",
            "url":""
        },
        "event_type":"SCHEDULED"
    }
}
```

{% endcode %}

</details>

<details>

<summary>Crash Event</summary>

Triggered whenever a crash event is detected by our sdk.

{% code expandable="true" %}

```json
{
    "meta":{
        "app_id":"00000000000000000000000a",
        "message_timestamp":"2025-11-19T11:10:08.382+00:00",
        "message_type":"engagement",
        "updated_attributes":[]
    },
    "data":{
        "user_id":"5984483fa3b15f0700000288",
        "context":{
            "severity":"UNAVAILABLE",
            "time_iso":"2021-09-13T21:17:52.000Z",
            "detector_mode":"UNKNOWN",
            "speed_at_impact":"50",
            "confidence":"0.95",
            "location":"[37.7749,-122.4194]",
            "magnitude":"4.5",
            "time":"1763557910000",
            "preceding_locations":"[[37.775,-122.4195],[37.7752,-122.4196]]",
            "delta_v":"15"
        },
        "event_type":"CRASH_EVENT"
    }
}
```

{% endcode %}

</details>
