Awell Health Developer Hub
Dev Hub

Learn how to set up and deploy a webhook to listen to events from Awell!

Interactive webhook builder

Select the webhooks you would like to listen to and copy/paste the corresponding code.

Webhooks

Triggered every time a care flow/pathway is started.

Triggered every time a care flow/pathway is completed.

Triggered every time an activity in the care flow/pathway is created, including system activities.

Triggered every time an activity in the care flow/pathway is completed, including system activities.

Triggered every time a form is submitted.

Triggered every time a new value for a data point is collected.

Triggered every time a reminder for a pending activity is created.

Triggered every time a hosted session is started.

Triggered every time a hosted session is completed.

Triggered every time a hosted session is expired.

  • server.js
01const express = require('express');
02const app = express();
03
04// If you are using Express v4 - v4.16 you need to use body-parser, not express, to retrieve the request body
05app.post('/awell-webhooks', express.json({type: 'application/json'}), (request, response) => {
06 const event = request.body;
07
08 // Handle the event
09 switch (event.event_type) {
10 default:
11 console.log(`Unhandled event type ${event.event_type}`);
12 }
13
14 // Return a response to acknowledge receipt of the event
15 response.json({received: true});
16});
17
18app.listen(8000, () => console.log('Running on port 8000'));