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
| Event | Description |
|---|---|
status_change | Device state changed (locked/unlocked, online/offline) |
tamper | Physical tampering detected |
low_battery | Battery level below threshold |
access_granted | Access was granted (door opened) |
access_denied | Access attempt failed |
error | Device 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
- HMAC Signature Verification — Verify webhook authenticity
- Tutorial: Build Your First Adapter — Hands-on guide