Register webhook
register_webhookUse when the user wants their own system told when someone opens a site in this workspace. Registers an https endpoint SnapHost posts to on each subscribed event (today: site.viewed). The result carries the signing secret ONCE: show it to the user and tell them to store it, it is not shown again. Workspace owners and admins only. Each delivery is a JSON POST with a SnapHost-Signature header of the form t=<unix seconds>,v1=<hex>, where v1 is HMAC-SHA256 over <t>.<raw body> with the webhook's secret; SnapHost-Event names the event and SnapHost-Delivery the delivery id (the same id is retried, so receivers can deduplicate). A site.viewed body carries data.site_id, data.site_title, data.share_id, data.viewer_email (empty for an anonymous open of a public site) and data.opened_at. An answer outside 2xx is retried five times over about fifteen hours; a webhook whose deliveries keep failing is disabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The https address to post deliveries to | |
| events | No | The events to subscribe to; omitted, all of them (site.viewed) | |
| workspace_id | No | Optional: the workspace to act in, from list_workspaces (the connection reaches the person's personal space and every workspace they are a member of). Required on a write when the connection reaches more than one workspace. Omit to act in the personal space (for an older single-workspace connection, the one workspace it was authorized for). |