Diese Anleitung ist noch nicht übersetzt und wird deshalb auf Englisch angezeigt.
Tell the bot when your site changes
A synced sitemap is read again on a schedule: every day on Pro, every hour on Business. A webhook lets your site say something changed, read it now the moment it happens: on a deploy, on a publish in your CMS, on a save in WordPress.
The call carries no content. It names the pages that changed, and Grounded reads them itself, from your published site, the same way a scheduled run does. Nothing you send can put text into the bot that your site does not serve. For documents that are not on a public site, use the MCP server instead.
Webhooks are part of Pro and Business, like auto-sync.
Set it up
Open the bot's Documents page. On the card of a synced sitemap, open Webhook:
- Copy the endpoint:
https://…/api/sources/{id}/hook. - Press Create secret and copy it now. It starts with
whsec_, it is shown once, and only a hash of it is kept, so it cannot be shown again. Lose it, and Rotate secret makes a new one; the old one stops working at once.
Each source has its own secret. Treat it like a password: keep it in your CI's secret store, not in the repository.
The call
curl -X POST 'https://grounded.buzz/api/sources/SOURCE_ID/hook' \
-H "Authorization: Bearer $WHSEC" \
-H 'Content-Type: application/json' \
-d '{"urls": ["https://docs.acme.com/pricing", "https://docs.acme.com/docs/setup"]}'
| Body | What happens |
|---|---|
{"urls": ["…", "…"]} |
Those pages are read now, whatever their <lastmod> says. |
empty, {} or {"urls": []} |
The whole source is read on the next run, which starts within five minutes. |
At most 100 URLs per call. More is a 400; split it.
What happens to each named page:
- It is in the source already — it is read again.
- It is new — it is added, if it is on the source's host, inside the paths the sitemap was
set up to follow, allowed by
robots.txt, and your plan has room for another document. - It is gone — if it answers
404or410, it is removed from the bot. A page that still answers200stays; any other answer leaves it as it is until the next run.
Pages on any other host are ignored, and counted in the answer. Only your site's own address is ever fetched.
The answer
The call is answered at once; the reading happens after. You can leave it. This page's state, and whatever is still being read, shows on the card.
| Status | Body | Meaning |
|---|---|---|
202 |
{"scope":"urls","accepted":2,"ignored":1} |
Accepted. accepted is how many named pages were kept, ignored how many were dropped. A call with no URLs answers "scope":"source" and "accepted":null. |
400 |
{"error":"…","code":"invalid_body"} |
The body is not JSON of that shape, or too_many_urls. |
401 |
{"code":"unauthorized"} |
No secret, a wrong one, or one that was rotated out. Nothing is read. |
403 |
{"code":"plan"} or "suspended" |
The plan has no auto-sync, or the account is suspended. |
409 |
{"code":"paused"} or "bot_inactive" |
The source is paused, or its bot is switched off. The message says which. |
413 |
{"code":"too_large"} |
The body is over 128 KB. |
429 |
{"code":"rate_limited"} |
More than 30 calls a minute for this source. Retry-After says how many seconds to wait. |
A loop of deploys will hit the limit before it hits your site: send one call per deploy with all the pages, not one call per page.
What is counted is crawling, not only calls. Grounded reads your site one page at a time,
politely, so a bot's webhooks share a minute of that: 120 named pages a minute at the default
pace, fewer if your robots.txt asks for a longer Crawl-delay (6 a minute at ten seconds). All of
a bot's sources draw on it, so adding sources does not add crawling. A call with no URLs counts as
a tenth of the minute, so six full reads a minute at most. A call that names more pages than a
minute allows is a 400 that says how many it can take; a call that finds the minute spent is a
429 with Retry-After.
In a deploy step
# .github/workflows/deploy.yml — after the site is live
- name: Tell Grounded
run: |
curl --fail-with-body -X POST "$GROUNDED_HOOK" \
-H "Authorization: Bearer $GROUNDED_WHSEC" \
-H 'Content-Type: application/json' \
-d '{}'
env:
GROUNDED_HOOK: ${{ vars.GROUNDED_HOOK }}
GROUNDED_WHSEC: ${{ secrets.GROUNDED_WHSEC }}
An empty body reads the whole source, which is the right call after a deploy that touched many pages. To name pages, build the list from your changed files.
What you will see
The card says Webhook: last called 5 min ago (or set up, not called yet). The pages being read show as Syncing — N pages left to read. A webhook run does not replace the card's Last run line: that stays the summary of the last scheduled run.