Geofencing and tracking
These APIs need a secret key allowed tracking. A public key lives inside your app, and whoever extracts it could move your devices and set off your events.


Geofences
Section titled “Geofences”POST /v1/geofences{ "externalId": "zone-karrada", "name": "Karrada", "circle": { "center": [44.4183, 33.3049], "radiusM": 500 } }Send either circle or geometry (a GeoJSON Polygon or MultiPolygon). POST /v1/geofences/import imports a set at once.
Device positions
Section titled “Device positions”POST /v1/tracking/devices/{externalId}/positions{ "positions": [{ "lng": 44.41, "lat": 33.30, "t": 1791100000000, "accuracyM": 12 }] }- Up to 100 positions a request;
tin epoch milliseconds or an ISO date. - Entering takes a fix inside the geofence that is accurate to 50 m or better.
- Leaving takes a fix more than 20 m or the fix’s own error, whichever is larger, outside the edge, so a device standing on the line doesn’t flap.
- A fix older than the device’s last is ignored.
geofence.enteredandgeofence.exitedarrive through webhooks.
Tracking links
Section titled “Tracking links”POST /v1/tracking/devices/{externalId}/shares creates a temporary public link where your customer watches their order arrive. The link shows the destination and never reveals the position near where the trip started.
The link lasts until the device arrives or 6 hours have passed, whichever comes first.
Your customer’s page carries a “via {your name}” line under the order’s title. By default that is your app’s name in the console, which is often technical (“Hooks”, “Trial Run”), so send partnerName to show your brand:
{ "name": "Your order from Al Saa Restaurant", "destination": { "lng": 44.41, "lat": 33.30, "name": "Home" }, "locale": "en", "partnerName": { "ar": "مطعم الساعة", "en": "Al Saa Restaurant" }}nameis the order’s title. It is the page’s heading, the title of the preview card when the link is shared, and the heading of the arrival notification.locale(aroren, defaultar) sets the language of the page and of the preview card.partnerNameis optional, at most 40 characters a language. Text-direction control characters and line breaks are removed, and if nothing is left the app’s name is used. One language alone replaces the app’s name as a whole; it is not completed with the technical name of the other.- Whoever opens the link and turns on alerts gets two notifications, “The driver is about 5 minutes away” and “The driver has arrived”. Neither carries coordinates.