sondahub / Fleet API / Commands
Fake commands API
300 commands from the Fleet API, a fake IoT API. A command sent to a device (reboot, set a config value, request a report). POST one and the answer carries the device’s acknowledgement.
Reads with filters, sorting, search and relations; writes that answer like a real server and stay in your session token. Same ids on every build. Free, no key, CORS open.
Connect
- List
- https://api.sondahub.com/v1/fleet/commands
- One record
- https://api.sondahub.com/v1/fleet/commands/{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/commands.json
- MCP
- https://api.sondahub.com/mcp · list_records
curl "https://api.sondahub.com/v1/fleet/commands?limit=3"
Sample records
Records 1 to 3 of 300, exactly as GET /v1/fleet/commands/{id} answers them. The data file holds all of them.
[
{
"id": 1,
"created_at": "2026-08-27T04:15:58Z",
"updated_at": "2026-08-27T04:17:58Z",
"device_id": 129,
"action": "set_config",
"params": {
"report_interval_s": 60
},
"status": "acked",
"issued_by": "api",
"sent_at": "2026-08-27T04:15:58Z",
"acked_at": "2026-08-27T04:17:58Z",
"result": {
"ok": true,
"took_ms": 83
}
},
{
"id": 2,
"created_at": "2026-08-31T15:13:05Z",
"updated_at": "2026-08-31T15:15:05Z",
"device_id": 97,
"action": "reboot",
"params": null,
"status": "acked",
"issued_by": "api",
"sent_at": "2026-08-31T15:14:05Z",
"acked_at": "2026-08-31T15:15:05Z",
"result": {
"ok": true,
"took_ms": 1266
}
},
{
"id": 3,
"created_at": "2026-08-10T16:15:28Z",
"updated_at": "2026-08-10T16:20:28Z",
"device_id": 486,
"action": "report_now",
"params": null,
"status": "acked",
"issued_by": "scheduler",
"sent_at": "2026-08-10T16:17:28Z",
"acked_at": "2026-08-10T16:20:28Z",
"result": {
"ok": true,
"took_ms": 1093
}
}
]
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. |
device_idrequired | int → devices | |
actionrequired | enum | reboot set_config report_now update_firmware identify |
params | json object | |
status | enum | queued sent acked failed expired |
issued_by | string | |
sent_at | datetime | |
acked_at | datetime | |
result | json object |
Relations: device → one device through device_id. Use ?expand=device to embed them, or the nested routes.
Endpoints
acked with a result when the device is online (a real device would take a second; with nothing stored there is no later, so the answer is the acknowledgement), queued otherwise.Try it
curl "https://api.sondahub.com/v1/fleet/commands?action=set_config&expand=device&limit=3"
curl https://api.sondahub.com/v1/fleet/commands/1?expand=device
curl -i -X POST https://api.sondahub.com/v1/fleet/commands \
-H "Content-Type: application/json" \
-d '{"device_id":1,"action":"reboot","status":"queued"}'
curl "https://api.sondahub.com/v1/fleet/commands?sort=-id&limit=3" \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
curl -X PATCH https://api.sondahub.com/v1/fleet/commands/1 \
-H "Content-Type: application/json" \
-d '{"action":"set_config"}'
curl -X DELETE https://api.sondahub.com/v1/fleet/commands/301 \ -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Query recipes
Every list option works on commands; these are ready to paste. All the options.
| What | Request |
|---|---|
| Page 2, 50 at a time (of 300) | /v1/fleet/commands?page=2&limit=50 |
| Only action = reboot | /v1/fleet/commands?action=reboot |
| Newest first by created at | /v1/fleet/commands?sort=-created_at&limit=5 |
| Issued by contains “api” | /v1/fleet/commands?issued_by_like=api |
| Full-text search | /v1/fleet/commands?q=api |
| Only some fields | /v1/fleet/commands?fields=id,issued_by&limit=5 |
| Embed the device | /v1/fleet/commands/1?expand=device |
| Just the count | /v1/fleet/commands?limit=1&fields=id |
GraphQL
The same commands as the commands query on https://api.sondahub.com/v1/fleet/graphql, and one command as command(id: 1). Introspection is on. More on the GraphQL API.
{
commands(limit: 3, sort: "-id", filter: { action: reboot }) {
total
data {
id device_id action status
device { serial }
}
}
}
curl https://api.sondahub.com/v1/fleet/graphql -H "Content-Type: application/json" -d '{"query": "{ commands(limit: 3, sort: \"-id\", filter: { action: reboot }) { total data { id device_id action status device { serial } } } }"}'
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/commands.
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":"commands","filters":{"action":"reboot"},"limit":3}}}'
More in the Fleet API
sites (40) · devices (500) · readings (4,908) · alerts (500)
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.