curl --request GET \
--url https://apiweb.mile.app/api/v4/alerts \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v4/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v4/alerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/alerts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v4/alerts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"current_page": 1,
"data": [
{
"_id": "66fb0c1d2e3f4a5b6c7d8e9f",
"alertCode": "geofence.enter",
"alertName": "Geofence enter",
"title": "Entered Geofence: Warehouse A",
"message": "User One entered Warehouse A.",
"assignee": "[email protected]",
"eventTime": "2026-10-15T02:10:00+00:00",
"hubId": null,
"data": {
"lat": -6.2001,
"lon": 106.8166,
"geofenceId": "66e0a1b2c3d4e5f6a7b8c9d0",
"geofenceName": "Warehouse A",
"geofenceGroup": "66e0a0b1c2d3e4f5a6b7c8d9",
"trackingDate": "2026-10-15",
"driverName": "User One"
},
"isResolved": false,
"resolvedTime": null,
"resolvedBy": null,
"resolvedByName": null,
"resolvedNotes": null
},
{
"_id": "66fb0c1d2e3f4a5b6c7d8ea0",
"alertCode": "idle.detected",
"alertName": "Idle detected",
"title": "Idle",
"message": "User Two has been idle since around 45 minutes ago.",
"assignee": "[email protected]",
"eventTime": "2026-10-15T01:45:00+00:00",
"hubId": null,
"data": {
"lat": -6.1754,
"lon": 106.8272,
"driverName": "User Two",
"isRepeat": false,
"idleSince": "2026-10-15T01:30:00+00:00",
"idled": 15
},
"isResolved": true,
"resolvedTime": "2026-10-15T02:00:00+00:00",
"resolvedBy": "[email protected]",
"resolvedByName": "Dispatcher One",
"resolvedNotes": "User was unloading."
}
],
"first_page_url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "https://apiweb.mile.app/api/v4/alerts",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Read alerts
Returns alerts of your organization, newest event first, paginated. An alert is a record of a monitored event about a user, such as entering or leaving a geofence, stopping for too long, a task predicted to be late, leaving the planned route, driving above the speed limit, a phone battery at or below its limit, a driver on a trip who stops sending their location, or pressing the panic button. Known codes: geofence.enter, geofence.leave (user entered or left a geofence), idle.detected, idle.repeated (user stopped moving), task.lateness.predicted (a task is predicted to be late), route.deviation.detected (user left the planned route), overspeed.detected (user drove above the speed limit), device.battery.low (the phone battery of a user is at or below the limit), driver.offline (a user on a trip sent no location for the limit; updated when the user is back online), user.panic (panic button).
Without status, only unresolved alerts are returned. Days in date, from and to are local days in Asia/Jakarta time.
Pass hubId to get only one hub’s alerts plus the alerts with no hub.
Requires permission view/alert.
curl --request GET \
--url https://apiweb.mile.app/api/v4/alerts \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/alerts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiweb.mile.app/api/v4/alerts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v4/alerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/alerts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apiweb.mile.app/api/v4/alerts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"current_page": 1,
"data": [
{
"_id": "66fb0c1d2e3f4a5b6c7d8e9f",
"alertCode": "geofence.enter",
"alertName": "Geofence enter",
"title": "Entered Geofence: Warehouse A",
"message": "User One entered Warehouse A.",
"assignee": "[email protected]",
"eventTime": "2026-10-15T02:10:00+00:00",
"hubId": null,
"data": {
"lat": -6.2001,
"lon": 106.8166,
"geofenceId": "66e0a1b2c3d4e5f6a7b8c9d0",
"geofenceName": "Warehouse A",
"geofenceGroup": "66e0a0b1c2d3e4f5a6b7c8d9",
"trackingDate": "2026-10-15",
"driverName": "User One"
},
"isResolved": false,
"resolvedTime": null,
"resolvedBy": null,
"resolvedByName": null,
"resolvedNotes": null
},
{
"_id": "66fb0c1d2e3f4a5b6c7d8ea0",
"alertCode": "idle.detected",
"alertName": "Idle detected",
"title": "Idle",
"message": "User Two has been idle since around 45 minutes ago.",
"assignee": "[email protected]",
"eventTime": "2026-10-15T01:45:00+00:00",
"hubId": null,
"data": {
"lat": -6.1754,
"lon": 106.8272,
"driverName": "User Two",
"isRepeat": false,
"idleSince": "2026-10-15T01:30:00+00:00",
"idled": 15
},
"isResolved": true,
"resolvedTime": "2026-10-15T02:00:00+00:00",
"resolvedBy": "[email protected]",
"resolvedByName": "Dispatcher One",
"resolvedNotes": "User was unloading."
}
],
"first_page_url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://apiweb.mile.app/api/v4/alerts?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "https://apiweb.mile.app/api/v4/alerts",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Query Parameters
Only alerts about this user (exact email, case-insensitive).
Example: [email protected]
Response
Success
Paginated list of alerts. Each item in data.data is an Alert object: fields shared by every alert are at the top level, and fields for one kind of alert are inside the item's data, whose keys depend on alertCode. data is always an object, {} when the alert stores nothing.