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
}
'import requests
url = "https://apiweb.mile.app/api/v4/alert-setting"
payload = {
"geofence": True,
"idle": True,
"idleNotification": False
}
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})
};
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
]),
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}")
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}")
.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}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"geofence": true,
"idle": true,
"lateness": false,
"routeDeviation": false,
"geofenceNotification": true,
"idleNotification": false,
"latenessNotification": true,
"routeDeviationNotification": true,
"updatedBy": "[email protected]",
"updatedTime": "2026-10-10T04:00:00.000Z"
}
}{
"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. 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
}
'import requests
url = "https://apiweb.mile.app/api/v4/alert-setting"
payload = {
"geofence": True,
"idle": True,
"idleNotification": False
}
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})
};
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
]),
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}")
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}")
.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}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Success",
"data": {
"geofence": true,
"idle": true,
"lateness": false,
"routeDeviation": false,
"geofenceNotification": true,
"idleNotification": false,
"latenessNotification": true,
"routeDeviationNotification": true,
"updatedBy": "[email protected]",
"updatedTime": "2026-10-10T04:00:00.000Z"
}
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}Authorizations
Use a valid Bearer token to authenticate.
Body
At least one of the flags is required.
Record geofence enter and leave alerts. Default false.
Example: true
Record idle alerts (driver stopped moving). Default false.
Example: true
Record predicted task lateness alerts. Default false.
Example: false
Record route deviation alerts. Default false.
Example: false
Also send recorded geofence alerts to the notification bell. Default true.
Example: true
Also send recorded idle alerts to the notification bell. Default true.
Example: false
Also send recorded lateness alerts to the notification bell. Default true.
Example: true
Also send recorded route deviation alerts to the notification bell. Default true.
Example: true