Read hubs
curl --request GET \
--url https://apiweb.mile.app/api/v4/hubs \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/hubs"
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/hubs', 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/hubs",
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/hubs"
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/hubs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/hubs")
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,
"data": [
{
"_id": "65c1f68ea735b522d370ea25",
"name": "Bandung",
"address": "Jalan Kebon Kawung 215, Sumur Bandung, Bandung 40113, Indonesia",
"lat": -6.91252,
"lng": 107.60759,
"countryCode": "IDN",
"organizationId": "65c1f4eeca7c4816d94587b2",
"updatedTime": "2026-01-29T04:49:14.127000Z",
"createdTime": "2026-01-29T04:49:14.127000Z",
"extendedData": {
"_id": "6abcadd9143a6b09ec0bf632",
"dataTypeId": "6abcadb6a138a6318d023ec5",
"entityId": "65c1f68ea735b522d370ea25",
"dataId": "hub:65c1f68ea735b522d370ea25",
"region": "West Java",
"regionCode": "BDG",
"organizationId": "65c1f4eeca7c4816d94587b2",
"limitUser": [
"all"
],
"createdBy": "admin@example.com",
"updatedTime": "2026-09-30 06:36:09",
"createdTime": "2026-09-30 06:36:09"
},
"country": {
"_id": "624fb53c88d36ab78ccdfe0e",
"code": "IDN",
"alpha2Code": "ID",
"name": "Indonesia",
"phoneCode": "+62",
"isActive": true
}
}
],
"dataVersion": "1795063011"
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Hub
Read hubs
Returns every hub of your organization in one response, sorted by name. There is no paging: page and limit are ignored.
When no hub matches the filters the response is 404 with failedCode hub-033.
Same as GET /api/v3/hubs, plus the include parameter: v3 never returns extendedData.
No permission is required beyond a valid token.
GET
/
hubs
Read hubs
curl --request GET \
--url https://apiweb.mile.app/api/v4/hubs \
--header 'Authorization: Bearer <token>'import requests
url = "https://apiweb.mile.app/api/v4/hubs"
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/hubs', 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/hubs",
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/hubs"
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/hubs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v4/hubs")
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,
"data": [
{
"_id": "65c1f68ea735b522d370ea25",
"name": "Bandung",
"address": "Jalan Kebon Kawung 215, Sumur Bandung, Bandung 40113, Indonesia",
"lat": -6.91252,
"lng": 107.60759,
"countryCode": "IDN",
"organizationId": "65c1f4eeca7c4816d94587b2",
"updatedTime": "2026-01-29T04:49:14.127000Z",
"createdTime": "2026-01-29T04:49:14.127000Z",
"extendedData": {
"_id": "6abcadd9143a6b09ec0bf632",
"dataTypeId": "6abcadb6a138a6318d023ec5",
"entityId": "65c1f68ea735b522d370ea25",
"dataId": "hub:65c1f68ea735b522d370ea25",
"region": "West Java",
"regionCode": "BDG",
"organizationId": "65c1f4eeca7c4816d94587b2",
"limitUser": [
"all"
],
"createdBy": "admin@example.com",
"updatedTime": "2026-09-30 06:36:09",
"createdTime": "2026-09-30 06:36:09"
},
"country": {
"_id": "624fb53c88d36ab78ccdfe0e",
"code": "IDN",
"alpha2Code": "ID",
"name": "Indonesia",
"phoneCode": "+62",
"isActive": true
}
}
],
"dataVersion": "1795063011"
}{
"status": false,
"message": "Bad request - invalid parameters provided."
}{
"status": false,
"message": "Data not found"
}{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}Query Parameters
Pass extendedData to add each hub's extendedData: the record of your organization's hub extension data type (the custom fields added under Extended data). Off by default, and only the exact value extendedData turns it on.
When your organization has no hub extension, the field is left out. When it has one but this hub has no record yet, the field is null.
Example: extendedData
Available options:
extendedData Response
Success
The response is of type object.