Webhooks

Send alerts to your own system.

Add the webhook channel to an alert rule and each matching event is posted to the webhook address as JSON, with the event, the device, the user and the message.

Choose a package in the portal; you see the first invoice before you confirm.

Alongpinalert rule · webhook channelGeofence exitVan 12 · Depot NorthOverspeedTruck 3Low batteryWatch · Asha"notificators": "web,webhook"POST200Your systemhttps endpointPOSTapplication/jsoneventgeofenceExitdeviceVan 12positionleft out200 OKwithin 10 sdelivery log: sent

How it works

From an alert rule to your endpoint

  1. The address is set once

    The webhook address belongs to the installation and is set by its administrator. Use an https address: full payloads go only there.

  2. Add the channel to a rule

    Through the API, name webhook in the rule’s notificators, next to the channels it already has.

  3. Each matching event is posted

    One POST with a JSON body per event and recipient. Answer with a 2xx status within the timeout.

A rule that also posts to the webhook
curl -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"type": "geofenceExit", "notificators": "web,webhook", "always": true}' \
  https://YOUR_HOST/api/notifications

One address

The webhook address is set by the administrator of your installation, so you cannot enter your own endpoint in the app. Add the channel to a rule through the API.

The event payload

Short by default, without a position

By default the payload is minimal: the event as id, type, time and device id, and the device, without a position.

Minimal payload, shape
{
  "event":   { "id": …, "type": "geofenceExit", "eventTime": "…", "deviceId": … },
  "device":  { "id": …, "name": "…", "uniqueId": "…" },
  "userId":  …,
  "message": "…: geofence exit. Open the app for details."
}

The fields of the minimal payload. A full payload adds the position.

event
What happened and when: id, type, eventTime and deviceId. The minimal payload leaves out the event’s attributes.
device
Which device: id, name and uniqueId.
userId
The user the alert is for.
message
The short text the other channels send, without a place.
position
Only in a full payload: where the device was. Sent only to an https address, and only when an administrator sets the webhook detail to full.
test
true on a delivery made by testing a rule; absent otherwise.

Delivery

One attempt, and a log of what happened

  • 1attempt

    An event is posted once. A failed delivery is not sent again, so read the delivery log if your endpoint was down.

  • 10 stimeout

    The default time the platform waits for your answer; your administrator can change it.

  • 2xxanswer

    An error status is recorded as rejected, with the status your endpoint returned.

  • Same event types as the other channels (geofence, overspeed, SOS, low battery, offline, maintenance)
  • Delivery results are listed in the notification delivery log: sent, or failed with the reason (rejected, unreachable, timeout)
  • Quiet hours hold back email, SMS, Telegram and push, never the webhook
  • Testing a rule posts to the webhook too, marked with "test": true

Which events exist, who else is told and on which schedule is decided in the alert rule, not in the webhook.

How alert rules work

FAQ

Questions about webhooks

Can I forward alerts to my own system?

Yes. Add the webhook channel to an alert rule through the API. The payload is short by default, and the address is set by your administrator.

Can I enter my own endpoint in the app?

No. There is one webhook address per installation and its administrator sets it, so you cannot enter your own endpoint in the app.

Does the payload carry the position?

Not by default: email, SMS and webhooks do not carry locations unless an administrator changes the message detail. With the event id you can read the event and its position through the API, with the rights of your token.

Do routes and runs use this webhook?

No. The Routes add-on has a webhook of its own: one https address per account, set in the portal under Routes, with each request signed and a failed delivery tried again. It carries the events of a run, such as approaching a stop, arrived, missed and late. See routes and stops.

Which events can a webhook carry?

The same as every other channel: an alert rule names the event type, and the webhook is one of the channels the rule sends it through.

Post your first event to your own system

Create an account, or talk to us about your integration. Choose a package in the portal; you see the first invoice before you confirm.

Chat with us