POST /api/chain/:slug/event
Append a generic event to the state machine's audit entangled state. Either pre-hash and send hash, or send payload and let the server hash it. The entangled state row stores the hash, never the bytes (free tier).
Auth
Bearer with operator role or higher.
Rate limit
600 writes / min / state machine (10/sec — bursty audit events from a busy frontend are normal).
Request
{
"type": "heartbeat",
"payload": { "temp_c": 21.4, "uptime_ms": 12345 }
}
OR (caller pre-hashed):
{
"type": "heartbeat",
"hash": "0123abc…64hex"
}
| Field | Type | Required | Notes |
|---|---|---|---|
type | string | optional | ≤ 64 chars. Defaults to "event". Free-form classifier. |
payload | any JSON | one of | Server runs sha256(JSON.stringify(payload)). |
hash | string | one of | 64 hex chars. Used verbatim. |
payload and hash are mutually optional but at least one must be present.
Response — 201
{
"ok": true,
"zeqondNumber": 2287439213,
"transitionId": "9b1c-…uuid"
}
Errors
| Status | error | Cause |
|---|---|---|
400 | invalid_request | neither payload nor hash supplied |
401 | unauthorized | bearer missing |
403 | forbidden | role < operator |
404 | not_found | slug doesn't resolve |
Curl
curl -sS https://zeqapi.com/api/chain/my-iot-fleet/event \
-H "Authorization: Bearer ${ZSM_KEY}" \
-H "Content-Type: application/json" \
-d '{"type":"heartbeat","payload":{"temp_c":21.4}}'