> ## 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.

# Zapnito webhooks overview

> Subscribe your own URLs to events in your Zapnito community, such as new users, published content and discussion replies.

Webhooks let your systems react to activity in your Zapnito community. You register a URL for an event, and Zapnito sends a JSON payload to that URL whenever the event happens.

<Note>
  Webhooks are called REST hooks in the API. The subscription endpoints use the `rest_hooks` path.
</Note>

## How it works

<Steps>
  <Step title="Choose an event">
    Pick the event you want to hear about from the [events list](#events).
  </Step>

  <Step title="Create a subscription">
    Send a `POST` request to the event's subscriptions endpoint with the URL to notify. The response contains the subscription `id`.
  </Step>

  <Step title="Receive payloads">
    Zapnito sends a JSON payload to your URL each time the event happens.
  </Step>

  <Step title="Delete the subscription">
    Send a `DELETE` request with the subscription `id` when you no longer need notifications.
  </Step>
</Steps>

## Authentication

Every subscription request needs your API token in the `Authorization` header:

```text theme={null}
Authorization: Token token=YOUR_API_TOKEN
```

To have Zapnito authenticate itself to your endpoint, pass an `authorization_token` when you create the subscription. Zapnito then sends it in the `Authorization` header of each request to your URL, in the format `Token token=YOUR_ENDPOINT_TOKEN`.

## Subscription endpoints

All events use the same two endpoints, where `EVENT` is the API name from the [events list](#events):

| Action | Endpoint |
| - | - |
| Create a subscription | `POST https://your-community.zapnito.com/api/v1/rest_hooks/EVENT/subscriptions` |
| Delete a subscription | `DELETE https://your-community.zapnito.com/api/v1/rest_hooks/EVENT/subscriptions/:id` |

Replace `https://your-community.zapnito.com` with your community's domain.

Creating a subscription returns `201 Created` with the subscription `id`. Deleting one returns `204 No Content`, or `404 Not Found` if no subscription matches the ID.

## Request headers

Each payload Zapnito sends to your URL includes these 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.

## Payload conventions

Payload formats aren't yet consistent across events. The details below come from the example payload on each event page, so check the example for the event you're handling and parse values defensively.

### Timestamps

| Format | Example | Events |
| - | - | - |
| Date and time without a time zone | `2026-03-02 09:15` | [User registered](/webhooks/user-registered), [User updated](/webhooks/user-updated) |
| ISO 8601 in UTC | `2026-03-10T13:52:06Z` | [Content published](/webhooks/content-published), [Content updated](/webhooks/content-updated), [Content viewed](/webhooks/content-viewed), [Discussion created](/webhooks/discussion-created), [Discussion reply created](/webhooks/discussion-reply-created), [Event RSVP reply](/webhooks/event-rsvp-reply) |
| ISO 8601 with a UTC offset | `2026-03-12T08:40:35+00:00` | [Document downloaded](/webhooks/document-downloaded) |
| RFC 2822-style | `Wed, 18 Mar 2026 10:01:28 UTC +00:00` | [Course participation updated](/webhooks/course-participation-updated) |

### IDs

* **Strings:** the IDs in [User added to group](/webhooks/user-added-to-group), [User removed from group](/webhooks/user-removed-from-group), [Content viewed](/webhooks/content-viewed), [Discussion created](/webhooks/discussion-created) and [Discussion reply created](/webhooks/discussion-reply-created), and `room.id` in the content payloads.
* **Integers:** the IDs in [Document downloaded](/webhooks/document-downloaded), [Course participation updated](/webhooks/course-participation-updated) and [Event RSVP reply](/webhooks/event-rsvp-reply).

If you handle more than one event, convert IDs to a single type before you compare or store them.

### Booleans

The `confirmed` field in the User registered and User updated payloads is the string `"true"`, not a boolean. The `room` flags in the content payloads (`open`, `secret` and `private`) are booleans.

### Personal data

User-related payloads include names and email addresses. The [User deleted](/webhooks/user-deleted) payload still contains the deleted user's name, email address and professional registration number. Treat these payloads as personal data when you log or store them.

## Events

| Event | API name | Sent when |
| - | - | - |
| [User registered](/webhooks/user-registered) | `user_registered` | A new user registers on your community. |
| [User updated](/webhooks/user-updated) | `user_updated` | A user is updated on your community. |
| [User deleted](/webhooks/user-deleted) | `user_deleted` | A user is deleted from your community. |
| [Document downloaded](/webhooks/document-downloaded) | `document_downloaded` | A user downloads a document on your community. |
| [User added to group](/webhooks/user-added-to-group) | `group_membership_created` | A user joins a group on your community. |
| [User removed from group](/webhooks/user-removed-from-group) | `group_membership_destroyed` | A user is removed from a group on your community. |
| [Course participation updated](/webhooks/course-participation-updated) | `course_participation_updated` | A user completes an item of content in a course. |
| [Event RSVP reply](/webhooks/event-rsvp-reply) | `event_rsvp_reply` | A user RSVPs to an event on your community. |
| [Content published](/webhooks/content-published) | `content_published` | A piece of content is published on your community. |
| [Content updated](/webhooks/content-updated) | `content_updated` | A piece of content is updated on your community. |
| [Content viewed](/webhooks/content-viewed) | `content_viewed` | A piece of content is viewed on your community. |
| [Discussion created](/webhooks/discussion-created) | `discussion_created` | A discussion is created on your community. |
| [Discussion reply created](/webhooks/discussion-reply-created) | `discussion_reply_created` | A discussion is replied to on your community. |


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