Reference
Webhook events
A site lists its webhooks in its events. Each change sends an event to each of them, as JSON in a POST, signed with the secret of the webhook. parseHollwareEvent of @hollware/core reads one, and verifyWebhook checks its signature.
Delivery
An event is written in the same batch as the change it tells of, then sent through the Queue: a webhook that answers an error gets it again, up to five times. The events of a review reach the webhooks at the next sweep of the cron, within a minute. A receiver uses the id of an event to ignore one it already has.
hollware-event-id: the id of the event, the same on every retryhollware-timestamp: when it was signed, in seconds; verifyWebhook refuses one more than five minutes awayhollware-signature: v1= and the HMAC-SHA256 of the timestamp, a dot and the body, under the secret of the webhook
entry.published · entry.unpublished
| Field | Type | What it is |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
| entry | object | The entry: its id, collection, locale, slug and translation group. |
| path | unknown | The path of the entry on the site, from the route of its collection and locale. |
| url | unknown | The URL of the entry, when the site has a url. |
site.changed
| Field | Type | What it is |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
review.requested · review.decided
| Field | Type | What it is |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
| review | object | The review: its id, its status (pending when asked, what became of it when decided), the name of who asked, and the note of a reviewer who asked for changes or rejected it. |
| entry | object | The entry the review asks to publish. |
| items | object[] | Every entry the review changes, the entry above first, and what it does to each. |
| adminPath | string | Where a person reads the review in the admin, under the URL of this Hollware. |