curl --request PUT \
--url https://apiweb.mile.app/api/v4/alert-setting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"geofence": true,
"idle": true,
"idleNotification": false,
"overspeedSpeedKmh": 60
}
'import requests
url = "https://apiweb.mile.app/api/v4/alert-setting"
payload = {
"geofence": True,
"idle": True,
"idleNotification": False,
"overspeedSpeedKmh": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({geofence: true, idle: true, idleNotification: false, overspeedSpeedKmh: 60})
};
fetch('https://apiweb.mile.app/api/v4/alert-setting', 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/alert-setting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'geofence' => true,
'idle' => true,
'idleNotification' => false,
'overspeedSpeedKmh' => 60
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/alert-setting"
payload := strings.NewReader("{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v4/alert-setting")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/alert-setting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"geofence": true,
"idle": true,
"lateness": false,
"routeDeviation": false,
"overspeed": false,
"lowBattery": false,
"driverOffline": false,
"geofenceNotification": true,
"idleNotification": false,
"latenessNotification": true,
"routeDeviationNotification": true,
"overspeedNotification": true,
"lowBatteryNotification": true,
"driverOfflineNotification": true,
"updatedBy": "[email protected]",
"updatedTime": "2026-10-10T04:00:00.000Z",
"thresholds": {
"overspeed": {
"speedKmh": 60,
"consecutivePings": 3,
"repeatMinutes": 10
},
"idle": {
"distanceMeters": 50,
"windowMinutes": 30,
"repeatMinutes": 10
},
"lateness": {
"graceMinutes": 2
},
"routeDeviation": {
"distanceMeters": 150,
"consecutivePings": 3
},
"lowBattery": {
"percent": 15,
"resetPercent": 25,
"repeatMinutes": 30
},
"driverOffline": {
"minutes": 30
}
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Update alert setting
Updates the alert setting of your organization. Send at least one flag; flags you leave out keep their current value. Every flag is a boolean. You can also send the editable limits (overspeedSpeedKmh, idleDistanceMeters, idleWindowMinutes, latenessGraceMinutes, routeDeviationDistanceMeters, lowBatteryPercent, driverOfflineMinutes) as whole numbers within their ranges; a body with only limits is valid and leaves the switches unchanged. A limit that is not a whole number or is out of range returns 400 with failedCode alert-009 and nothing is saved. A change applies to detections after it is saved; alerts already recorded do not change. thresholds itself is ignored when sent. Returns the full setting after the update.
Requires permission edit/alertSetting.
curl --request PUT \
--url https://apiweb.mile.app/api/v4/alert-setting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"geofence": true,
"idle": true,
"idleNotification": false,
"overspeedSpeedKmh": 60
}
'import requests
url = "https://apiweb.mile.app/api/v4/alert-setting"
payload = {
"geofence": True,
"idle": True,
"idleNotification": False,
"overspeedSpeedKmh": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({geofence: true, idle: true, idleNotification: false, overspeedSpeedKmh: 60})
};
fetch('https://apiweb.mile.app/api/v4/alert-setting', 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/alert-setting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'geofence' => true,
'idle' => true,
'idleNotification' => false,
'overspeedSpeedKmh' => 60
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v4/alert-setting"
payload := strings.NewReader("{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://apiweb.mile.app/api/v4/alert-setting")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/alert-setting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"geofence\": true,\n \"idle\": true,\n \"idleNotification\": false,\n \"overspeedSpeedKmh\": 60\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"geofence": true,
"idle": true,
"lateness": false,
"routeDeviation": false,
"overspeed": false,
"lowBattery": false,
"driverOffline": false,
"geofenceNotification": true,
"idleNotification": false,
"latenessNotification": true,
"routeDeviationNotification": true,
"overspeedNotification": true,
"lowBatteryNotification": true,
"driverOfflineNotification": true,
"updatedBy": "[email protected]",
"updatedTime": "2026-10-10T04:00:00.000Z",
"thresholds": {
"overspeed": {
"speedKmh": 60,
"consecutivePings": 3,
"repeatMinutes": 10
},
"idle": {
"distanceMeters": 50,
"windowMinutes": 30,
"repeatMinutes": 10
},
"lateness": {
"graceMinutes": 2
},
"routeDeviation": {
"distanceMeters": 150,
"consecutivePings": 3
},
"lowBattery": {
"percent": 15,
"resetPercent": 25,
"repeatMinutes": 30
},
"driverOffline": {
"minutes": 30
}
}
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Body
At least one of the flags or limits is required.