Webhooks are called REST hooks in the API. The subscription endpoints use the
rest_hooks path.How it works
1
Choose an event
Pick the event you want to hear about from the events list.
2
Create a subscription
Send a
POST request to the event’s subscriptions endpoint with the URL to notify. The response contains the subscription id.3
Receive payloads
Zapnito sends a JSON payload to your URL each time the event happens.
4
Delete the subscription
Send a
DELETE request with the subscription id when you no longer need notifications.Authentication
Every subscription request needs your API token in theAuthorization header:
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, whereEVENT is the API name from the events list:
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.Headers sent to your URL
X-Zapnito-Hostnameis the hostname of the Zapnito community that sent the event.Authorizationis only sent if you set anauthorization_tokenwhen 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
IDs
- Strings: the IDs in User added to group, User removed from group, Content viewed, Discussion created and Discussion reply created, and
room.idin the content payloads. - Integers: the IDs in Document downloaded, Course participation updated and Event RSVP reply.
Booleans
Theconfirmed 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.

