Skip to content

Add webhook and v2 device API methods#15

Open
jcoetsie wants to merge 1 commit into
lwestenberg:masterfrom
jcoetsie:feature/webhook-events
Open

Add webhook and v2 device API methods#15
jcoetsie wants to merge 1 commit into
lwestenberg:masterfrom
jcoetsie:feature/webhook-events

Conversation

@jcoetsie

@jcoetsie jcoetsie commented Apr 8, 2026

Copy link
Copy Markdown

Summary

  • Add create_webhook(), get_webhooks(), and delete_webhook() methods to BoldSmartLock class for managing Bold API webhooks (v2 endpoints)
  • Add get_devices_v2() method to retrieve device data from the v2 API, which includes owner.organizationId needed for webhook creation
  • Add WEBHOOK_SERVICE and DEVICE_SERVICE_V2 constants

Context

This is the library-side change needed to support webhook-based event notifications (lock/unlock events with user info) in the Home Assistant integration. The companion PR for the HA integration is in lwestenberg/homeassistant_bold.

Relates to lwestenberg/homeassistant_bold#9

API endpoints used

  • POST /v2/webhooks - create webhook (organizationId, deviceIds, topics, webhookUrl, secretHttp)
  • GET /v2/webhooks?organizationId={id} - list webhooks
  • DELETE /v2/webhooks/{webhook-id} - delete webhook
  • GET /v2/devices - list devices (v2, includes organizationId)

Test plan

  • Verify get_devices_v2() returns device data with owner.organizationId
  • Verify create_webhook() successfully creates a webhook via the Bold API
  • Verify get_webhooks() lists existing webhooks for an organization
  • Verify delete_webhook() removes a webhook by ID
  • Verify existing methods are unaffected

🤖 Generated with Claude Code

Add create_webhook, get_webhooks, delete_webhook, and get_devices_v2
methods to BoldSmartLock class to support webhook-based event
notifications for lock/unlock events. Adds WEBHOOK_SERVICE and
DEVICE_SERVICE_V2 constants for the v2 API endpoints.

Relates to lwestenberg/homeassistant_bold#9

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant