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 retry
  • hollware-timestamp: when it was signed, in seconds; verifyWebhook refuses one more than five minutes away
  • hollware-signature: v1= and the HMAC-SHA256 of the timestamp, a dot and the body, under the secret of the webhook

entry.published · entry.unpublished

FieldTypeWhat it is
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.
entryobjectThe entry: its id, collection, locale, slug and translation group.
pathunknownThe path of the entry on the site, from the route of its collection and locale.
urlunknownThe URL of the entry, when the site has a url.

site.changed

FieldTypeWhat it is
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.

review.requested · review.decided

FieldTypeWhat it is
idstringThe id of the event, the same on every retry: ignore one you already have.
sitestringThe key of the site it happened in.
atstringWhen it happened, as an ISO 8601 timestamp.
cacheTagsstring[]The cache tags of the pages it changed, to purge; none when no page changed.
reviewobjectThe 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.
entryobjectThe entry the review asks to publish.
itemsobject[]Every entry the review changes, the entry above first, and what it does to each.
adminPathstringWhere a person reads the review in the admin, under the URL of this Hollware.