Receive webhooks
Get events as they happen, verify that they come from Enlytning, and handle each one once.
Webhooks send your system an HTTPS POST when something happens in your organisation, such as a learner completing a course or a member joining. Use them instead of polling the API for changes.
Plan availability
Add an endpoint
Admins and Owners add endpoints from Settings > API, in the Webhooks section.
- Select Add endpoint.
- Enter the URL that receives events. It must use
httpsand resolve to a public address. - Choose the events it receives. You can change them later.
- Open the endpoint and select Reveal to copy its signing secret. Store the secret in your secret manager.
Select Send test event to check your endpoint. It sends a webhook.test event whatever the endpoint subscribes to. Each endpoint's page lists every delivery, with the payload, each attempt, and the response your endpoint returned.
An organisation can have up to 10 endpoints.
What a delivery looks like
Every delivery has the same envelope. data holds the event's payload, which uses the same resource shapes as the API.
{
"id": "0199c3a0-5b7e-7c1d-9a52-3f1e2d4c6b8a",
"type": "course.completed",
"created_at": "2026-10-09T14:05:33.000Z",
"organisation_id": "6c1f2d0e-8b4a-4f3e-9d21-7a5b3c9e1f04",
"data": { "id": "…", "assignment_id": "…", "outcome": "passed" }
}Events can arrive out of order. Use created_at, or fetch the resource from the API, when order matters.
Events
The Webhook events section of the API reference has a page for every event type, including webhook.test. Each page says when the event is sent and shows its full payload with an example.
Two rules shape what you receive:
- Anonymised surveys send nothing. A survey that anonymises its responses never sends
survey.submitted, because any per-submission event could identify the person. - Recurring work never goes overdue. A recurring assignment sends
assignment.period_missedeach time a period closes without a completion. Only fixed deadlines sendassignment.overdue. Both arrive within about an hour.
Verify signatures
Every delivery is signed following Standard Webhooks, in the webhook-id, webhook-timestamp and webhook-signature headers.
Verify every request before you act on it, using the raw request body. Parsing and re-serialising the JSON changes the bytes and breaks the signature. The Standard Webhooks libraries check the signature and reject timestamps more than five minutes from your server's clock, which stops an old request being replayed.
Node
npm install standardwebhooksimport express from 'express';
import { Webhook } from 'standardwebhooks';
const webhook = new Webhook(process.env.ENLYTNING_WEBHOOK_SECRET);
const app = express();
// express.raw keeps the body exactly as it was sent.
app.post(
'/webhooks/enlytning',
express.raw({ type: 'application/json' }),
(req, res) => {
let event;
try {
event = webhook.verify(req.body, req.headers);
} catch {
return res.status(400).end();
}
// Respond first, then handle the event in the background.
res.status(204).end();
queue.add(event);
},
);Python
pip install standardwebhooksimport os
from flask import Flask, request
from standardwebhooks.webhooks import Webhook
webhook = Webhook(os.environ["ENLYTNING_WEBHOOK_SECRET"])
app = Flask(__name__)
@app.post("/webhooks/enlytning")
def receive():
try:
event = webhook.verify(request.get_data(), request.headers)
except Exception:
return "", 400
# Respond first, then handle the event in the background.
queue.enqueue(event)
return "", 204Other languages have Standard Webhooks libraries too.
Handle each event once
The same event can arrive more than once, for example after a retry or a replay. Each delivery of an event carries the same webhook-id. Store the ids you've handled and skip any you've seen.
Respond quickly
Return any 2xx status within 15 seconds. Anything else counts as a failure, including redirects and timeouts. Do slow work after you respond, as the examples do.
A failed delivery is retried after 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours. After the last retry fails, the delivery shows as Failed in the endpoint's delivery log. Up to 5 deliveries go to one endpoint at a time.
If an endpoint fails continuously for 5 days, Enlytning turns it off and tells your organisation's Owners and Admins in the app and by email. Turn it back on from its page once it's fixed. Events that happen while an endpoint is off aren't sent later.
To send a delivery again, open it in the endpoint's delivery log and select Replay. A replay sends the event again with a fresh timestamp and signature.
Rotate the signing secret
Rotate the secret from the endpoint's page with Rotate secret, for example if it may have leaked. Enlytning signs with the new secret straight away and keeps signing with the old one for 24 hours, so each delivery carries one signature per secret. Update your systems with the new secret within that time. A receiver holding either secret accepts the delivery.