Skip to main content

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"
}
FieldTypeRequiredNotes
typestringoptional≤ 64 chars. Defaults to "event". Free-form classifier.
payloadany JSONone ofServer runs sha256(JSON.stringify(payload)).
hashstringone of64 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

StatuserrorCause
400invalid_requestneither payload nor hash supplied
401unauthorizedbearer missing
403forbiddenrole < operator
404not_foundslug 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}}'