Connect
- List
- https://api.sondahub.com/v1/fleet/sites
- One record
- https://api.sondahub.com/v1/fleet/sites/{id}
- OpenAPI 3
- https://api.sondahub.com/v1/fleet/openapi.json
- GraphQL
- https://api.sondahub.com/v1/fleet/graphql
- JSON file
- https://api.sondahub.com/data/fleet/sites.json
- MCP
- https://api.sondahub.com/mcp · list_records
curl "https://api.sondahub.com/v1/fleet/sites?limit=3"
Sample records
Records 1 to 3 of 40, exactly as GET /v1/fleet/sites/{id} answers them. The data file holds all of them.
[
{
"id": 1,
"created_at": "2024-04-05T10:29:32Z",
"updated_at": "2024-04-05T10:29:32Z",
"code": "BOM-01",
"name": "Mumbai Warehouse",
"kind": "warehouse",
"address": {
"line1": "2962 Lincoln Ter",
"city": "Mumbai",
"region": "Maharashtra",
"postal_code": "VSK6Y8",
"country": "IN"
},
"timezone": "Asia/Kolkata",
"lat": 18.941,
"lon": 72.9,
"device_count": 8,
"status": "active"
},
{
"id": 2,
"created_at": "2025-04-24T21:44:41Z",
"updated_at": "2025-04-24T21:44:41Z",
"code": "MAD-01",
"name": "Madrid Depot",
"kind": "depot",
"address": {
"line1": "8841 River Ct",
"city": "Madrid",
"region": "Madrid",
"postal_code": "KBZGD0",
"country": "ES"
},
"timezone": "Europe/Madrid",
"lat": 40.3872,
"lon": -3.5779,
"device_count": 14,
"status": "active"
},
{
"id": 3,
"created_at": "2024-06-13T13:35:30Z",
"updated_at": "2024-06-13T13:35:30Z",
"code": "MXP-01",
"name": "Milan Clinic",
"kind": "clinic",
"address": {
"line1": "9415 Elm Dr",
"city": "Milan",
"region": "Lombardy",
"postal_code": "EHVT1B",
"country": "IT",
"line2": "Suite 245"
},
"timezone": "Europe/Rome",
"lat": 45.3632,
"lon": 9.2642,
"device_count": 16,
"status": "active"
}
]
Fields
| Field | Type | Notes |
|---|---|---|
idread-only | int | Assigned by the server. Seed records keep their ids across restarts; records you create continue after the seed. |
created_atread-only | datetime | When the record was created (ISO 8601, UTC). |
updated_atread-only | datetime | When the record last changed. |
coderequired | string | |
namerequired | string | |
kind | enum | warehouse office plant store datacenter farm clinic depot |
address | json { line1, city, region, postal_code, country } | |
timezone | string | |
lat | float | |
lon | float | |
device_countread-only | int | |
status | enum | active maintenance decommissioned |
Relations: devices → the devices whose site_id is this site. Use ?expand=devices to embed them, or the nested routes.
Endpoints
Try it
curl "https://api.sondahub.com/v1/fleet/sites?kind=office&lat_gte=10&limit=3"
curl https://api.sondahub.com/v1/fleet/sites/1
curl "https://api.sondahub.com/v1/fleet/sites/1/devices?limit=5"
curl -i -X POST https://api.sondahub.com/v1/fleet/sites \
-H "Content-Type: application/json" \
-d '{"code":"MIA-01","name":"Miami Warehouse","kind":"warehouse","timezone":"America/New_York","status":"active"}'
curl "https://api.sondahub.com/v1/fleet/sites?sort=-id&limit=3" \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
curl -X PATCH https://api.sondahub.com/v1/fleet/sites/1 \
-H "Content-Type: application/json" \
-d '{"kind":"office"}'
curl -X DELETE https://api.sondahub.com/v1/fleet/sites/41 \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Query recipes
Every list option works on sites; these are ready to paste. All the options.
| What | Request |
|---|---|
| Page 2, 50 at a time (of 40) | /v1/fleet/sites?page=2&limit=50 |
| Only kind = warehouse | /v1/fleet/sites?kind=warehouse |
| Lat between two values, largest first | /v1/fleet/sites?lat_gte=1&lat_lte=500&sort=-lat |
| Newest first by created at | /v1/fleet/sites?sort=-created_at&limit=5 |
| Code contains “bom” | /v1/fleet/sites?code_like=bom |
| Full-text search | /v1/fleet/sites?q=bom |
| Only some fields | /v1/fleet/sites?fields=id,code&limit=5 |
| Its devices (nested route) | /v1/fleet/sites/1/devices?limit=5 |
| Just the count | /v1/fleet/sites?limit=1&fields=id |
GraphQL
The same sites as the sites query on https://api.sondahub.com/v1/fleet/graphql, and one site as site(id: 1). Introspection is on. More on the GraphQL API.
{
sites(limit: 3, sort: "-id", filter: { kind: warehouse }) {
total
data {
id code name kind
devices(limit: 2) { id }
}
}
}
curl https://api.sondahub.com/v1/fleet/graphql -H "Content-Type: application/json" -d '{"query": "{ sites(limit: 3, sort: \"-id\", filter: { kind: warehouse }) { total data { id code name kind devices(limit: 2) { id } } } }"}'
From an AI agent (MCP)
The MCP server reaches the same rows with list_records, get_record, create_record, update_record and delete_record, and as the resource sondahub://fleet/sites.
curl https://api.sondahub.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_records","arguments":{"api":"fleet","collection":"sites","filters":{"kind":"warehouse"},"limit":3}}}'
More in the Fleet API
devices (500) · readings (4,908) · alerts (500) · commands (300)
The live streams, the MQTT broker, and the whole API on one page: Fleet API. Other worlds: fake e-commerce API, fake banking API, fake social media API, fake helpdesk API, fake flight booking API, fake user directory API.