Skip to main content

Webhooks

Extension webhooks are sent as POST requests to your configured webhook URL.

Headers:

  • Content-Type: application/json
  • x-webhook-event: <event-name>
  • x-webhook-token-hash: <sha256-hash>

Top-level payload shape:

{
"id": "uuid",
"event": "lock.time_changed",
"eventData": {},
"timestamp": "2026-02-16T01:23:45.678Z",
"app": {
"id": "app_id",
"slug": "my-app",
"displayName": "My App"
},
"sessionId": "extension_session_id",
"extension": {
"sessionId": "extension_session_id",
"enabled": true,
"config": {}
},
"wearer": {
"id": "wearer_user_id",
"username": "wearer_name"
},
"keyholder": {
"id": "keyholder_user_id",
"username": "keyholder_name"
},
"lock": {
"id": "lock_id",
"title": "Lock title",
"releaseAt": "2026-02-20T00:00:00.000Z",
"remainingSeconds": 12345,
"isLocked": true,
"isFrozen": false
}
}

Delivery, Retries, and Ordering

  • Webhooks are queued and delivered asynchronously in the background.
  • Delivery uses a Redis-backed queue with an in-flight processing list for crash recovery.
  • Processing runs continuously (about once per second on the primary worker).
  • HTTP timeout per attempt is ~3 seconds.

Retry policy:

  • A delivery is retried when:
  • the request times out or has a network error
  • the endpoint returns 429
  • the endpoint returns any 5xx status
  • A delivery is not retried for other 4xx statuses.
  • Backoff delays are: 15s, 60s, 150s, 600s.

Implications for integrators:

  • Delivery is at least once, not exactly once. Your endpoint should be idempotent.
  • Ordering is best-effort. Do not assume strict global ordering across all events.
  • Return a fast 2xx response and process your own heavy work asynchronously.
  • You can use payload id as a deduplication key.

Event Data

lock.time_changed

{
"event": "lock.time_changed",
"eventData": {
"source": "keyholder",
"beforeReleaseAt": "2026-02-20T00:00:00.000Z",
"afterReleaseAt": "2026-02-20T01:00:00.000Z",
"requestedDeltaSeconds": 3600,
"appliedDeltaSeconds": 3600
}
}

Notes:

  • requestedDeltaSeconds is what the action requested.
  • appliedDeltaSeconds is what was effectively persisted.
  • appliedDeltaSeconds can be null if it cannot be derived from release timestamps.

lock.frozen / lock.unfrozen

{
"event": "lock.frozen",
"eventData": {
"source": "keyholder",
"durationSeconds": 3600,
"beforeFrozen": false,
"afterFrozen": true
}
}
{
"event": "lock.unfrozen",
"eventData": {
"source": "dice",
"durationSeconds": 900,
"beforeFrozen": true,
"afterFrozen": false
}
}

task.* events

task.assigned

{
"event": "task.assigned",
"eventData": {
"runId": "tr_1739665200000",
"taskId": "task_123",
"status": "active",
"source": "keyholder",
"overriddenRunId": null
}
}

task.completed

{
"event": "task.completed",
"eventData": {
"runId": "tr_1739665200000",
"taskId": "task_123",
"status": "completed",
"pointsAwarded": 10
}
}

task.failed

{
"event": "task.failed",
"eventData": {
"runId": "tr_1739665200000",
"taskId": "task_123",
"status": "failed",
"penaltyApplied": true,
"outcomeDescription": "1 hour added"
}
}

hygiene.* events

hygiene.started

{
"event": "hygiene.started",
"eventData": {
"startedAt": "2026-02-16T02:00:00.000Z",
"expiresAt": "2026-02-16T02:30:00.000Z",
"windowSeconds": 1800,
"penaltySeconds": 3600
}
}

hygiene.resumed

{
"event": "hygiene.resumed",
"eventData": {
"completedAt": "2026-02-16T02:20:00.000Z",
"lateMinutes": 0,
"penaltyApplied": false,
"punishmentSeconds": 0,
"penaltyMode": null,
"cardsAdjusted": 0,
"actualDeltaSeconds": null
}
}

hygiene.resumed_late

{
"event": "hygiene.resumed_late",
"eventData": {
"completedAt": "2026-02-16T02:45:00.000Z",
"lateMinutes": 15,
"penaltyApplied": true,
"punishmentSeconds": 3600,
"penaltyMode": "time",
"cardsAdjusted": 0,
"actualDeltaSeconds": 3600
}
}

verification.picture_submitted

{
"event": "verification.picture_submitted",
"eventData": {
"verificationId": "verification_id",
"date": "2026-02-16",
"submittedAt": "2026-02-16T03:10:00.000Z",
"photoUrl": "https://cdn.example.com/locks/..."
}
}

dice.rolled

{
"event": "dice.rolled",
"eventData": {
"userTotalScore": 14,
"botTotalScore": 8,
"difference": 6,
"requestedAdjustmentSeconds": -3600,
"appliedAdjustmentSeconds": -3600,
"cardGameEnabled": false
}
}

lock.archive_removal

{
"event": "lock.archive_removal",
"eventData": {
"source": "archive",
"actorRole": "wearer",
"lockId": "lock_id"
}
}

Notes:

  • source is delete or archive.
  • actorRole is wearer or keyholder.