---
title: "Change webhooks"
description: "Get a signed call when a site's sitemap changes, so your site or CDN can drop its cached copy."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.atomicity.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Change webhooks

If your client's site keeps its own copy of the sitemap, for example in a CDN cache, Atomicity can tell it when the sitemap changes, so it can drop the old copy straight away instead of waiting for it to expire.

After URLs are added, updated, or removed, Atomicity calls each webhook address once. A burst of changes within a couple of seconds is one call.

Only your agency team can manage change webhooks.

## Add a webhook

1. Open the site, go to **Sitemap → API**, and find **Change notifications**.
2. Under **Add an address to call**, enter the endpoint. It must be a full URL that starts with `https://`.
3. Copy the webhook's **Signing secret** and store it with your receiver, such as in an environment variable.
4. Select **Send test** to check your endpoint answers.

A site can have up to 5 webhooks.

## The payload

Each call is a `POST` with this JSON body:

```json
{
  "event": "sitemap.updated",
  "siteId": "6719b201-a14e-43bf-a53a-9fa7ecb457cf",
  "sitemapUrl": "https://yourclient.com/sitemap.xml",
  "urls": 1204,
  "updatedAt": "2026-11-23T15:04:05.000Z",
  "test": false
}
```

| Field | Meaning |
| --- | --- |
| `siteId` | The site in Atomicity. |
| `sitemapUrl` | Where the site serves its sitemap: its primary domain's `/sitemap.xml`. `null` if the site has no domain. |
| `urls` | How many URLs the sitemap now holds. |
| `updatedAt` | When the change was published. |
| `test` | `true` for a **Send test**. |

## Verify the signature

Every call is signed with the webhook's secret in `X-Atomicity-Signature`. Check it, so only Atomicity can trigger your endpoint:

```js title="Node.js"
import crypto from "node:crypto";

const expected = Buffer.from("sha256=" + crypto.createHmac("sha256", process.env.SITEMAP_WEBHOOK_SECRET).update(rawBody).digest("hex"));
const received = Buffer.from(request.headers["x-atomicity-signature"] ?? "");
const valid = expected.length === received.length && crypto.timingSafeEqual(expected, received);
```

[Webhook signatures and retries](https://docs.atomicity.dev/reference/webhooks/) has the full details.

## Answer the call

Answer with any `2xx`. Anything else counts as a failure. Failed calls are retried on the [retry schedule](https://docs.atomicity.dev/reference/webhooks/#retry-schedule).

After 3 failed calls in a row, the webhook is paused. To start it again, select **Send test** and get a `2xx` answer, or switch it off and on.

## Related

- [Write API and site keys](https://docs.atomicity.dev/sitemaps/api/)
- [Install the proxy](https://docs.atomicity.dev/sitemaps/install/)
- [Webhook signatures and retries](https://docs.atomicity.dev/reference/webhooks/)

Source: https://docs.atomicity.dev/sitemaps/webhooks/index.mdx
