Overview
A webhook pushes a JSON payload to a URL you own each time something happens in a lab session: a session starts, a sandbox is provisioned, a learner completes a task.
Use them to record learner progress in an LMS, prospect activity in a CRM, or to trigger automation without polling the API.
Add an endpoint
Section titled “Add an endpoint”An endpoint is a publicly reachable URL that Instruqt delivers events to. Endpoints belong to a team and receive events for every lab on that team.
Adding one needs the team webhook administrator permission.
- Open Settings → Webhooks.
- Click Add Endpoint.
- Enter your Endpoint URL, or click with Svix Play to try it without writing code.
- Optionally add a Description.
- Under Subscribe to events, select the event types this endpoint receives.
- Click Create.
Subscribe to events
Section titled “Subscribe to events”Subscribe to events groups the types by family. Tick the lab group to receive every lab event, or expand it and tick individual types. The event reference explains what each one means.
Try it without writing code
Section titled “Try it without writing code”On the New Endpoint form, click with Svix Play next to the URL field. It fills in a throwaway URL that captures deliveries in your browser, so you can start a lab and read real payloads before building a handler.
See what was delivered
Section titled “See what was delivered”The tabs at the top of the Webhooks page:
- Endpoints — your endpoints, with the error rate of each.
- Event Catalog — every event type and the schema of its payload.
- Logs — every delivery attempt, successful or failed, with the payload and the response. You can replay a delivery from here.
- Activity — a chart of recent delivery attempts.
Change or delete an endpoint
Section titled “Change or delete an endpoint”Open Settings → Webhooks and click the endpoint. From its page you can change the URL, the description, and the subscribed events, or delete the endpoint.
Verify that an event came from Instruqt
Section titled “Verify that an event came from Instruqt”Your endpoint is public, so anyone who learns the URL can post to it. Instruqt signs every webhook with a key unique to the endpoint. Verify that signature before you act on a payload.
The signature is in the svix-signature header, and the endpoint’s signing secret is on the endpoint’s page. Follow this guide to verifying payloads, which has libraries for most languages.
Delivery
Section titled “Delivery”- Respond with a
2xxquickly. Acknowledge the delivery and do your own work afterwards. A failed delivery is retried over a backoff schedule, and repeated failures can get the endpoint disabled. - Expect the same event more than once. Delivery is at-least-once. Deduplicate on
session_id,type, andactivity_idwhere the event has one, and make your handler safe to repeat. - Handle event types you do not recognise by ignoring them.
- An event can be lost. Delivery is not guaranteed, and a lost event leaves no error. Do not make webhooks your only record of something that must be right — reconcile a certificate, a grade, or an invoice against the Instruqt API.
Payloads carry no personal data
Section titled “Payloads carry no personal data”Payloads identify people and content by identifier only. They never carry a name, an email address, or an IP address.
If you need personal data, resolve it from the identifiers in the payload — user_id, and invite_id where the session came from an invite — through the Instruqt API.
