sondahub

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
The first three commands
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

FieldTypeNotes
idread-onlyintAssigned by the server. Seed records keep their ids across restarts; records you create continue after the seed.
created_atread-onlydatetimeWhen the record was created (ISO 8601, UTC).
updated_atread-onlydatetimeWhen the record last changed.
device_idrequiredint → devices
actionrequiredenumreboot set_config report_now update_firmware identify
paramsjson object
statusenumqueued sent acked failed expired
issued_bystring
sent_atdatetime
acked_atdatetime
resultjson object

Relations: device → one device through device_id. Use ?expand=device to embed them, or the nested routes.

Endpoints

POST answers 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.
GET/v1/fleet/commandsA page, with every filter, sort, search, field and expand option.
POST/v1/fleet/commandsCreate one: 201 with the record, its id, a Location header and the session token that keeps it; 422 names each field that is wrong.
GET/v1/fleet/commands/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/fleet/commands/{id}Change the fields you send.
PUT/v1/fleet/commands/{id}Replace the record; required fields must all be there.
DELETE/v1/fleet/commands/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/fleet/commands/{id}/deviceThe device this record points at.

Try it

List with a filter
curl "https://api.sondahub.com/v1/fleet/commands?action=set_config&expand=device&limit=3"
One record
curl https://api.sondahub.com/v1/fleet/commands/1?expand=device
Create
curl -i -X POST https://api.sondahub.com/v1/fleet/commands \
  -H "Content-Type: application/json" \
  -d '{"device_id":1,"action":"reboot","status":"queued"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/fleet/commands?sort=-id&limit=3" \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Change one field
curl -X PATCH https://api.sondahub.com/v1/fleet/commands/1 \
  -H "Content-Type: application/json" \
  -d '{"action":"set_config"}'
Delete the one you created
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.

WhatRequest
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 }
    }
  }
}
Run it
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.

tools/call
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.