Capture on Publish from a Headless CMS

A CMS webhook calls a URL when an editor publishes. Point it at your site's publish hook and WRL captures pages after each publish. Which pages depends on the body the CMS sends:

  • Contentful and Sanity let you write the body. Put the page's address in it and WRL captures that page about a minute later, when it is first published and after each published edit.
  • Ghost, Strapi and Webflow send a body you can't change. WRL finds no list of pages in it and runs a check of your sitemap.
CMS Event The page's address in the body What WRL does
Ghost Post published and Published post updated, and the same two for pages Under post.current.url, where WRL doesn't look A check
Contentful Publish, for entries Yes, once you write a custom payload Captures the page
Sanity Create and Update Yes, once you write a projection Captures the page
Strapi Publish, in the Entry row No A check
Webflow Site publish No. The body names domains, not pages A check, through an automation

Prerequisites


When the page changes after the publish

The webhook fires when the content is published in the CMS. The page on your site may change later than that:

  • The CMS serves the site itself, as Ghost and Webflow can, or your site reads from the CMS when a page is requested. The new text is online at once, or when a cache has expired. WRL waits hookDelaySeconds (60 by default) before it captures the pages a call names. If your cache takes longer, raise the delay (see Set up a site).
  • The site is built and deployed again after each publish. The page changes when the deploy is done, minutes after the webhook, so a capture one minute after the publish records the old page and a check reads the old sitemap. Let the deploy call the hook, not the CMS: see Netlify, Vercel and Cloudflare Pages or GitHub Actions.

hookDelaySeconds goes up to 600. If your build is always done within ten minutes, the CMS webhook with that delay works for calls that name pages. The delay doesn't apply to a check, which starts within about a minute of the call, or 5 minutes after the site's last check if that is later.


Ghost

In Ghost Admin, open Settings, then Advanced, then Integrations, and choose Add custom integration. In the integration, add a webhook: pick the event, enter the hook URL as the target URL and leave the secret empty. A webhook has one event, so add four:

Event in Ghost Admin Name in Ghost's docs
Post published post.published
Published post updated post.published.edited
Page published page.published
Published page updated page.published.edited

On Ghost(Pro), webhooks and custom integrations come with the Publisher plan and the plans above it, and not with Starter.

Ghost posts a JSON object that has the post under post.current, or the page under page.current. The address is in it, as url. WRL reads addresses only from a list under urls or urlList at the top level of the body, so it runs a check.

For Ghost a check finds edits too: Ghost's sitemap at /sitemap.xml gives each post and page a <lastmod> with the time it was last updated. A check after Published post updated finds the post through that date.

Ghost sends its sitemap with Cache-Control: public, max-age=3600 unless you configure another lifetime. If a CDN or a caching proxy in front of Ghost keeps the sitemap that long, a check right after a publish may read the copy from before it. The post is then captured by a later check: after the next publish, or by the daily check if it is on.

To have WRL capture the post itself, without the sitemap, pass its address on through Zapier, Make or n8n.

Ghost's docs don't show the webhook body. We read it, and how the sitemap is built, in Ghost's source code in November 2026.


Contentful

In the Contentful web app, open Settings, then Webhooks, and choose Add webhook. Enter the hook URL. In the list of triggering events at the bottom, select Publish for entries (the topic Entry.publish). Add a filter on the content type ID (sys.contentType.sys.id), so that only entries that have a page on your site call the hook.

Then replace the default body with a custom payload. Contentful calls this a webhook transformation:

{
  "urls": ["https://example.com/blog/{ /payload/fields/slug/en-US }"]
}

{ /payload/fields/slug/en-US } is a JSON pointer into the entry. Contentful puts the value in its place, here the field slug in the locale en-US. For an entry with the slug spring-prices, WRL receives {"urls": ["https://example.com/blog/spring-prices"]} and captures that page. Change the address, the field and the locale to the way your site builds its URLs.

If entries of another content type have pages under another path, add a second webhook with its own filter and payload. To capture a list page along with each entry, add it to the list: "urls": ["https://example.com/blog/{ /payload/fields/slug/en-US }", "/blog/"].

Contentful sends the body with the content type application/vnd.contentful.management.v1+json unless you choose another. WRL doesn't look at the content type. Without a custom payload the body is the entry's JSON, and WRL runs a check.

When a call fails with a 429 or a 5xx answer, Contentful tries twice more, about 30 seconds apart.


Sanity

Open your project on sanity.io/manage, go to API, then Webhooks, and create a webhook:

Field Value
URL The hook URL
Trigger on Create and Update
Filter _type == "post"
Projection {"urls": ["https://example.com/blog/" + slug.current]}
HTTP method POST
Drafts and versions Off, as they are by default
Secret Empty

The filter chooses the documents that have a page on your site. The projection is the body: Sanity evaluates it for the document and sends the result as JSON. For a post with the slug spring-prices, WRL receives {"urls": ["https://example.com/blog/spring-prices"]}. Change the filter, the address and the slug field to your schema.

With drafts off, the webhook doesn't fire while someone edits. It fires when a document is published, the first time and after each published change.

Sanity sends a call again twice, 30 seconds apart, when the answer was 429 or a 5xx status. It doesn't retry after other 4xx answers.


Strapi

In the Strapi admin panel, open Settings, then Webhooks, and create a webhook with the hook URL. In the events table, tick Publish in the Entry row (entry.publish). The event exists only for content types that have Draft & Publish turned on. From Strapi 5.60.0 the table also has a row per content type, so you can tick Publish for the types that have pages and leave the others out.

Tick Publish only. Strapi saves the draft before it publishes an entry, so entry.update is sent just before entry.publish, and with both ticked each publish calls the hook twice.

Strapi posts a JSON object with event, createdAt, model, uid and entry, and names the event in the X-Strapi-Event header. You can't change this body in the admin panel, so WRL finds no list of pages in it and runs a check. The check finds a new page in your site's sitemap, and an edited one if the sitemap gives it a <lastmod>.

To have the edited page captured without a sitemap date, send the request yourself. Strapi's docs suggest a lifecycle hook for a payload of your own: post {"urls": ["https://example.com/the-page"]} to the hook URL from it.


Webflow

Webflow's docs count a webhook as delivered only when the receiver answers with HTTP 200. After any other answer Webflow tries up to three more times, 10 minutes apart, and it deactivates a webhook that keeps failing. The hook answers 202. We haven't tried a Webflow webhook on the hook, and going by Webflow's docs you shouldn't point one straight at it.

Use one of these instead:

  • Turn on the daily check. It needs nothing in Webflow. A new page is on record within a day, and an edited one if your sitemap gives it a <lastmod>.
  • Put Zapier, Make or n8n in between. The automation's webhook trigger answers Webflow with 200, and its HTTP step calls the hook. Zapier, Make and n8n describes the step.

For the automation, add the webhook in Webflow: go to Site settings, then Apps & integrations, then Webhooks, and choose Add webhook. Pick the trigger type Site publish and an API version, and enter the URL of the automation's webhook trigger.

The body of a Site publish call names the site, the domains it was published to and the time. It doesn't list pages, so the automation's HTTP step sends no body and WRL runs a check. Webflow also has an event for a single CMS item that was published, collection_item_published. Its body has the item's slug and not its address, so the automation has to build the address before it can name the page.


Check that it works

Publish a change. With Contentful or Sanity, the page has a new capture about two minutes later:

curl "https://api.webresourceledger.com/v1/captures?host=example.com&limit=5" \
  -H "Authorization: Bearer YOUR_API_KEY"

If the payload or the projection builds a wrong address, WRL captures your site's "not found" page. In the dashboard that page is under Needs attention, with the state "HTTP 404".

With Ghost, Strapi or Webflow, open the site's Settings page in the dashboard. It says when the hook was last called and that the call asked for a check, and shows what the last check found. GET /v1/sites/example.com has the same under settings.hook.lastCallAt and settings.lastCheck.

If nothing arrives, call the hook yourself with curl -X POST and the URL. A hook URL that was replaced answers 404.