sondahub

sondahub / Fleet API / Alerts

Fake alerts API

500 alerts from the Fleet API, a fake IoT API. Something a device or a site needs looked at. Acknowledge one with PATCH {"status":"acknowledged"}.

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/alerts
One record
https://api.sondahub.com/v1/fleet/alerts/{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/alerts.json
MCP
https://api.sondahub.com/mcp · list_records
The first three alerts
curl "https://api.sondahub.com/v1/fleet/alerts?limit=3"

Sample records

Records 1 to 3 of 500, exactly as GET /v1/fleet/alerts/{id} answers them. The data file holds all of them.

[
  {
    "id": 1,
    "created_at": "2026-08-22T23:54:11Z",
    "updated_at": "2026-08-23T09:38:11Z",
    "device_id": 255,
    "site_id": 28,
    "severity": "warning",
    "kind": "offline",
    "message": "VB2-6C9QCZ has not reported for 150 minutes",
    "status": "resolved",
    "opened_at": "2026-08-22T23:54:11Z",
    "acknowledged_at": "2026-08-23T00:26:11Z",
    "resolved_at": "2026-08-23T09:38:11Z",
    "acknowledged_by": "[email protected]"
  },
  {
    "id": 2,
    "created_at": "2026-08-17T00:16:38Z",
    "updated_at": "2026-08-17T16:04:38Z",
    "device_id": 387,
    "site_id": 24,
    "severity": "warning",
    "kind": "offline",
    "message": "GW10-UCRF9E has not reported for 96 minutes",
    "status": "resolved",
    "opened_at": "2026-08-17T00:16:38Z",
    "acknowledged_at": "2026-08-17T04:14:38Z",
    "resolved_at": "2026-08-17T16:04:38Z",
    "acknowledged_by": "[email protected]"
  },
  {
    "id": 3,
    "created_at": "2026-08-13T06:19:20Z",
    "updated_at": "2026-08-14T05:26:20Z",
    "device_id": 337,
    "site_id": 18,
    "severity": "critical",
    "kind": "tamper",
    "message": "TH200-JZHZAT enclosure opened",
    "status": "resolved",
    "opened_at": "2026-08-13T06:19:20Z",
    "acknowledged_at": "2026-08-13T06:38:20Z",
    "resolved_at": "2026-08-14T05:26:20Z",
    "acknowledged_by": "[email protected]"
  }
]

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
site_idint → sites
severityrequiredenuminfo warning critical
kindrequiredenumoffline low_battery threshold tamper firmware weak_signal
messagestring
statusenumopen acknowledged resolved muted
opened_atdatetime
acknowledged_atdatetime
resolved_atdatetime
acknowledged_bystring

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

Endpoints

PATCH to acknowledged or resolved stamps the matching timestamp.
GET/v1/fleet/alertsA page, with every filter, sort, search, field and expand option.
POST/v1/fleet/alertsCreate 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/alerts/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/fleet/alerts/{id}Change the fields you send.
PUT/v1/fleet/alerts/{id}Replace the record; required fields must all be there.
DELETE/v1/fleet/alerts/{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/alerts/{id}/deviceThe device this record points at.
GET/v1/fleet/alerts/{id}/siteThe site this record points at.

Try it

List with a filter
curl "https://api.sondahub.com/v1/fleet/alerts?severity=warning&expand=device&limit=3"
One record
curl https://api.sondahub.com/v1/fleet/alerts/1?expand=device
Create
curl -i -X POST https://api.sondahub.com/v1/fleet/alerts \
  -H "Content-Type: application/json" \
  -d '{"device_id":1,"severity":"info","kind":"offline","status":"open"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/fleet/alerts?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/alerts/1 \
  -H "Content-Type: application/json" \
  -d '{"severity":"warning"}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/fleet/alerts/501 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

Query recipes

Every list option works on alerts; these are ready to paste. All the options.

WhatRequest
Page 2, 50 at a time (of 500)/v1/fleet/alerts?page=2&limit=50
Only severity = info/v1/fleet/alerts?severity=info
Newest first by created at/v1/fleet/alerts?sort=-created_at&limit=5
Message contains “vb2”/v1/fleet/alerts?message_like=vb2
Full-text search/v1/fleet/alerts?q=vb2
Only some fields/v1/fleet/alerts?fields=id,message&limit=5
Embed the device/v1/fleet/alerts/1?expand=device
Just the count/v1/fleet/alerts?limit=1&fields=id

GraphQL

The same alerts as the alerts query on https://api.sondahub.com/v1/fleet/graphql, and one alert as alert(id: 1). Introspection is on. More on the GraphQL API.

{
  alerts(limit: 3, sort: "-id", filter: { severity: info }) {
    total
    data {
      id device_id site_id severity
      device { serial }
    }
  }
}
Run it
curl https://api.sondahub.com/v1/fleet/graphql -H "Content-Type: application/json" -d '{"query": "{ alerts(limit: 3, sort: \"-id\", filter: { severity: info }) { total data { id device_id site_id severity 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/alerts.

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":"alerts","filters":{"severity":"info"},"limit":3}}}'

More in the Fleet API

sites (40) · devices (500) · readings (4,908) · 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.