Aller au contenu principal

POST /api/chain/:slug/connection

Record an open/close connection event. The hash is computed server-side over the metadata.

Auth

Bearer with operator role or higher.

Request

{
"direction": "inbound",
"peer_hash": "sha256-of-peer-id",
"protocol": "wss",
"state": "open"
}
FieldTypeRequiredNotes
directionstringoptional"inbound" or "outbound". Default "inbound".
peer_hashstringoptional≤ 128 chars
protocolstringoptional≤ 32 chars
statestringoptional"open" or "close"

Response — 201

{ "ok": true, "zeqondNumber": 2287439213, "transitionId": "9b1c-…uuid" }

Curl

curl -sS https://zeqapi.com/api/chain/my-iot-fleet/connection \
-H "Authorization: Bearer ${ZSM_KEY}" \
-H "Content-Type: application/json" \
-d '{"direction":"inbound","protocol":"wss","state":"open"}'