Skip to main content

Webhook Registration

Adapters that support push events (webhook_capable: true) can register callback URLs with ZenEdge.

Registration

POST /webhook/register?device_id=ada-xxx
x-api-key: adapter-key
Content-Type: application/json

{
"callback_url": "https://api-zenedge.zenspace.io/api/v1/webhooks/adapter/ada-xxx",
"events": ["status_change", "tamper", "low_battery"],
"secret": "shared-hmac-secret"
}

Supported Events

EventDescription
status_changeDevice state changed (locked/unlocked, online/offline)
tamperPhysical tampering detected
low_batteryBattery level below threshold
access_grantedAccess was granted (door opened)
access_deniedAccess attempt failed
errorDevice encountered an error

Event Payload

When the adapter sends events to ZenEdge:

{
"event": "status_change",
"device_id": "ada-xxx",
"timestamp": "2025-01-15T10:05:00Z",
"data": {
"locked": false,
"changed_by": "manual"
},
"signature": "hmac-sha256-hex-digest"
}

Next Steps