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

# Content updated webhook

> Receive a JSON payload at your own URL when content is updated on your Zapnito community, including its author, room and canonical URL.

Subscribe a URL of your choosing to be notified when a piece of content is updated on your community. Before you start, read the [webhooks overview](/webhooks/overview) for how subscriptions and authentication work.

## Payload

When you subscribe to the Content updated webhook, your URL is sent a JSON payload with details of the event.

### Request headers

```text title="Headers sent to your URL" theme={null}
Accept: application/json
X-Zapnito-Hostname: community.acme.org
Authorization: Token token=YOUR_ENDPOINT_TOKEN
```

* `X-Zapnito-Hostname` is the hostname of the Zapnito community that sent the event.
* `Authorization` is only sent if you set an `authorization_token` when you created the subscription.

### Example payload

<ResponseExample>
  ```json title="Content updated payload" theme={null}
  {
    "slug": "preparing-for-an-audit",
    "title": "Preparing for an audit",
    "introduction": "A practical checklist for getting ready for your first audit.",
    "content": "Start by listing the policies an auditor is likely to ask for, then gather the evidence for each one. This field holds the full content, so it can be long.",
    "type": "Post",
    "canonical_url": "https://your-community.zapnito.com/users/3-maya-patel/posts/preparing-for-an-audit",
    "seo_title": "How to prepare for a compliance audit",
    "seo_description": "A practical guide to getting your team ready for a compliance audit.",
    "published_at": "2026-03-10T09:00:00Z",
    "created_at": "2026-03-09T16:30:00Z",
    "updated_at": "2026-03-12T11:20:00Z",
    "author": {
      "name": "Maya Patel",
      "title": "Head of Compliance",
      "avatar_url": "https://images.your-community.zapnito.com/users/3/avatar"
    },
    "doi": "https://doi.org/10.12345/26271228261",
    "room": {
      "id": "123",
      "name": "Audit Readiness",
      "slug": "audit-readiness",
      "open": true,
      "secret": false,
      "private": false,
      "state": "open"
    }
  }
  ```
</ResponseExample>

## Create a subscription

<ParamField header="Authorization" type="string" required>
  Your API token in the format `Token token=YOUR_API_TOKEN`.
</ParamField>

<ParamField body="url" type="string" required>
  The URL you want Zapnito to notify when a piece of content is updated on your community.
</ParamField>

<ParamField body="authorization_token" type="string">
  A token that Zapnito sends in the `Authorization` header of each request to your URL, in the format `Token token=YOUR_ENDPOINT_TOKEN`.
</ParamField>

```bash title="Create a subscription" theme={null}
curl -X POST https://your-community.zapnito.com/api/v1/rest_hooks/content_updated/subscriptions \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/webhooks/content-updated", "authorization_token": "YOUR_ENDPOINT_TOKEN"}'
```

`POST https://your-community.zapnito.com/api/v1/rest_hooks/content_updated/subscriptions`

* `201 Created`: the subscription was created. The response body is `{"id": "27"}`. Keep the `id` so you can delete the subscription later.

## Delete a subscription

Remove a previously registered URL for the Content updated webhook.

<ParamField header="Authorization" type="string" required>
  Your API token in the format `Token token=YOUR_API_TOKEN`.
</ParamField>

<ParamField path="id" type="integer" required>
  The ID of the subscription that was returned when you created it.
</ParamField>

```bash title="Delete a subscription" theme={null}
curl -X DELETE https://your-community.zapnito.com/api/v1/rest_hooks/content_updated/subscriptions/27 \
  -H "Authorization: Token token=YOUR_API_TOKEN"
```

`DELETE https://your-community.zapnito.com/api/v1/rest_hooks/content_updated/subscriptions/:id`

* `204 No Content`: the subscription was deleted.
* `404 Not Found`: no subscription matches the provided ID.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.