Webhooks

Webhooks allow you to build or set up integrations which subscribe to certain events on the Elation Platform without polling our API for changes. When one of those events is triggered, we'll send a HTTP POST payload to the webhook's configured URL.

📘

Prevent Echo

Note that updates made by an application will not trigger webhook callbacks to the same application.

Supported models

At the moment, you will receive events for the following models:

Modelevent name
Appointmentappointments
Allergiesallergies
Billbills
Cardiac Orderscardiac_orders
Clinical Documentsclinical_documents
Delegate Permissionsdelegate_permissions
Document Tagsdocument_tags
Drug Intolerancesdrug_intolerances
Imaging Ordersimgaging_orders
Immunizationsimmunizations
Incoming Files (fax)incoming_files
Insurance companiesinsurance_companies
Insurance plansinsurance_plans
Lab Order Setslab_order_sets
Lab Order Testslab_order_tests
Lab Orderlab_orders
Lab Vendor Patient Siteslab_vendor_patient_sites
Lab Vendorslab_vendors
Lettersletters
Medicationsmedications
Message Threadsmessage_threads
Non-visit Notesnon_visit_notes
Office Staffoffice_staff
Patientpatients
Patient Photopatient_photos
Physiciansphysicians
Pulmonary Orderspulmonary_orders
Referral Ordersreferral_orders
Reportsreports
Service Locationsservice_locations
Sleep Orderssleep_orders
Staff Groupsstaff_groups
Visit Notesvisit_notes
Vitalsvitals
Historyhistories
Family Historyfamily_histories

Acknowledging events

We are expecting status code 200 when we POST the event payload to your webhook URL. We will retry the POST for up to 72 hours until we get a status code 200 response.

You can programmatically register your event listener (e.x. webhook URL) using The Event Subscription API.

Webhook Signatures

Elation’s webhook requests are signed using the Ed25519 digital signature scheme. The base64 encoded signature can be found in the El8-Ed25519-Signature request header. The base64 encoded signing key for your webhook subscription can be in the signing_pub_key field in the response from the Subscription endpoint.

Libraries exist for all common programming languages that support the verification of Ed25519 signatures.

Example Implementation

The following is an example implementation, using Flask and PyNaCl.

from flask import Flask, request

from nacl.signing import VerifyKey
from nacl.encoding import Base64Encoder

# This base64 encoded value is obtained from the Subscription endpoint
verify_key = VerifyKey("8gUqjclkmFz6AFVB05RpWDYwTxR5MzsLzJnwZ9MlYCw=", encoder=Base64Encoder)

app = Flask(__name__)

@app.route("/", methods=["POST"])
def test_verification():
    b64_signature = request.headers["El8-Ed25519-Signature"]
    signature = Base64Encoder.decode(b64_signature)
    message = request.get_data()

    # verify() raises an exception if verification fails
    verify_key.verify(message, signature)
    return "Signature Verified"