Add webhook trigger on document draft save

Feature Idea:

Currently there is no option to trigger a webhook when a draft/modified document is saved (but not published, or scheduled for future release). Saving the document generates a unique ref, so it would make sense to make that available in a webhook.

I would put the webhook under Documents and maybe call it "A document draft is saved". It should only run when a new draft is saved (or re-saved), or a published document is modified and (re-)saved, but not when it is published or scheduled for release (as there are separate hooks for these).

Issue that it solves:

Statically generated sites currently can't generate static preview pages for documents that have been saved, but not published, because there is no webhook trigger that would make the SSG generate a page for the particular draft ref at the point of saving the document.

Meanwhile within the preview webhook you can't distinguish what is being previewed (e.g. is it a live page that does not need to be generated?), and in any case generating the page at the point of viewing it isn't ideal, or might not even be possible, depending on the set up.

This applies to new pages still in Draft stage, but also Published pages that have been modified and need to be previewed before publishing.

1 Like