Skip to content
Hermes Health API
API referenceOpenAPI spec

Guide

Receive webhook events

Be told when a record changes instead of polling for it.

Webhooks notify your server when something happens, so you don’t have to poll. You create an endpoint in the Hermes Health web app: a URL plus the named events it receives and the scope they cover. There is no API for managing endpoints yet.

Create an endpoint

  1. Sign in to Hermes Health and open Settings → Webhooks. The tab is shown to anyone with the ManageWebhooks permission.
  2. Select Add webhook.
  3. Enter your receiver’s URL. It must be publicly resolvable; private and loopback addresses are rejected.
  4. Choose the environment, production or sandbox. An endpoint receives events only from projects in its own environment.
  5. Pick the events (next section): tick a whole group, or single events.
  6. Choose the scope: which projects the endpoint covers.
  7. Choose the payload: Full record (the default) sends the record each event is about; ID only sends no record, for a receiver that reads it from the API. You can change it later from the endpoint’s card. See Read the payload.
  8. Optionally, add up to 20 custom headers sent on every delivery, such as an Authorization header your receiver checks.
  9. Copy the endpoint’s signing secret. You need it to verify deliveries.

Creating a webhook endpoint requires the ManageWebhooks permission, because a webhook can send PHI to an external URL. You cannot override the Content-Type, Host or X-Webhook-* headers.

Point a sandbox endpoint at a test receiver while you build. Sandbox projects complete searches and requests on their own, so they exercise the whole flow.

Choose events

Events are named group.event. Ticking a group subscribes to every event it has when you save.

GroupCovers
recordRequestA record request is created, changes status, or reaches its follow-up date.
siteSonarSite Sonar facility discovery starts or finishes for a patient.
patientHistoriesPatient Histories clinical-history retrieval starts or finishes for a patient.
ehrSearchEHR Search starts or finishes for a patient.
patientA patient is created, their profile changes, or their overall search status changes.
authorizationA patient’s authorization is reviewed or needs attention.
clinicalDataA run adds clinical data the patient did not already have. Webhook endpoints only.
noteA note is added or edited.
aiResearchAn AI research run started by anyone in your company finishes.
feeA site fee is charged on a record request created by you, or for a webhook, by anyone in your company. Needs the ViewFees permission.

The events:

EventFires when
recordRequest.createdA record request is created.
recordRequest.statusChangedA record request moves to any new status.
recordRequest.processingA record request is sent to the facility and is awaiting records.
recordRequest.needsResolutionA record request is blocked on your action, such as a denied authorization, a pending payment or a site-specific authorization.
recordRequest.authorizationNeedsResolutionA record request needs a new patient authorization: the facility denied the one sent (AuthDenied) or requires one naming it (NeedSiteSpecificAuth). Sent on every move into either status, including from one to the other; a pending payment does not send it.
recordRequest.completedRecords were received, fully or partially.
recordRequest.recordsNotFoundThe facility could not provide records.
recordRequest.canceledA record request is canceled, voided or marked a duplicate.
recordRequest.followUpDueA record request’s follow-up date has arrived. Sent at most once a day while the date is due, and needs the ConfigureFollowUpNotifications permission.
recordRequest.deliveryFailedA send of a record request to its facility failed: a fax that was not delivered, an email the facility’s address refused, a letter that was canceled, or a release-of-information request that was not accepted. Sent once per failed send. The request keeps its status, and Hermes does not retry the send. See Delivery failures.
siteSonar.startedSite Sonar starts for a patient.
siteSonar.completedSite Sonar finishes for a patient, on every run, whatever the result.
patientHistories.startedPatient Histories starts for a patient.
patientHistories.completedPatient Histories finishes for a patient, on every run, whatever the result.
ehrSearch.startedEHR Search starts for a patient.
ehrSearch.completedEHR Search finishes for a patient, on every run, whatever the result.
patient.createdA patient is created.
patient.updatedA patient’s name, date of birth, sex, contact details or ZIP codes change.
patient.searchStatusChangedA patient’s overall searchStatus changes.
authorization.statusChangedA patient’s authorization status changes.
authorization.approvedA patient’s authorization is approved.
authorization.needsAttentionA patient’s authorization moves to any status other than approved.
authorization.needsResolutionA patient’s authorization needs your action: it moves to a status that is neither NeedsApproval nor Approved, such as MissingSignature, while Site Sonar or Patient Histories is requested for the patient. Sent on every such move, including from one of these statuses to another.
clinicalData.addedA run adds clinical data a patient did not already have, with counts of what is new by type.
note.createdA note is added to a patient or a record request. An endpoint belonging to the note’s author is not sent their own note.
note.updatedA note’s text is edited.
aiResearch.completedAn AI research run you started finishes.
fee.siteFeeCreatedA site fee is charged on a record request you created, with its amount. Sent only to the request creator’s own endpoints or their company’s webhooks, and only while the endpoint’s owner holds ViewFees; a site fee charged on no record request, or a fee changed to a site fee later, is not sent.

A status change sends recordRequest.statusChanged and, when the request moves into a new category, the category event too: a request that moves from RequestSent to Completed sends both recordRequest.statusChanged and recordRequest.completed. A move onto an authorization problem also sends recordRequest.authorizationNeedsResolution, even when the request was already waiting on a different resolution. A patient’s authorization moving to a status that needs your action sends authorization.needsResolution beside authorization.needsAttention, as long as Site Sonar or Patient Histories is requested for the patient; a move to NeedsApproval, such as a new document arriving for review, sends only authorization.needsAttention. It is sent on a move only: a patient created already AwaitingAuthorization, or one whose status already needs your action when a search is newly requested, is not sent it. Changing who created or owns a record (userId or ownerUserId) sends no event on its own.

Delivery failures

recordRequest.deliveryFailed is sent once for every send that fails, on any channel, in sandbox and production alike. Its data holds the request, as for every record request event, and deliveryFailure, the failed send:

FieldWhat it is
channelfax, email, mail or roi (a release-of-information service).
codeWhy it failed, a stable value to branch on: faxFailed, faxCanceled, emailRejected, mailCanceled or roiRejected.
messageA readable sentence for display. Do not parse it.
failedAtWhen Hermes learned the send failed.

The same failure is the request’s lastDeliveryFailure until a later send is accepted, which sets it back to null. A failed send does not change the request’s status and sends no recordRequest.statusChanged, and Hermes does not send it again: send the request again, or change it, as you decide.

To learn that a search finished, subscribe to its .completed event. It is sent once per run, whether or not the run found anything; a patient created with a search already requested also sends that search’s .started.

Choose the scope

SettingValues
ProjectsEvery project in your account, including new ones (the default), or only the projects you pick.
RecordsEvery record in your company. A webhook endpoint belongs to your company, so it cannot be limited to the records one person follows; an email notification can (“Records I follow”: the records they created or are assigned, followed automatically, and any they followed by hand).

Picked projects must all be sandbox or all production; the endpoint takes their environment. A webhook endpoint belongs to your company rather than to the person who created it, and it only ever receives the records and fields a company administrator can see.

Read the payload

Every delivery is a POST with this JSON body:

Delivery envelope
json
{
  "id":        "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": "2026-06-24T12:34:56Z",
  "version":   "events",
  "eventType": "recordRequest.completed",
  "resource":  "companies/1/projects/p_123/patients/pat_456/record-requests/req_789",
  "changed":   ["status"],
  "previous":  { "status": "RequestSent" },
  "data": {
    "request": { "id": "req_789", "status": "Completed", "patientId": "pat_456" }
  }
}
FieldWhat it is
idThe delivery ID. Retries reuse it, so deduplicate on it.
timestampWhen the event happened, not when this attempt was sent.
versionAlways events.
eventTypeThe event, such as recordRequest.completed.
resourceThe record’s path. For clinicalData.added it is your company; for aiResearch.completed, the site; for fee.siteFeeCreated, the fee.
changedThe fields of the record in data that changed. Empty for events that are not changes, such as .created.
previousWhat each changed field held before, keyed the same way. Empty when changed is.
dataThe record, under the key its GET endpoint uses:
Groupdata
recordRequestrequest, as GET .../record-requests/{recordRequestId} returns it; recordRequest.deliveryFailed adds deliveryFailure
siteSonarpatient, as GET .../patients/{patientId} returns it
patientHistoriespatient
ehrSearchpatient
patientpatient
authorizationpatient
notenote
clinicalDatapatients: each patient, its project, the run, and counts of what is new by type
aiResearchsiteId, siteName, url
feefeeId, amount (US dollars, as a decimal string), projectId, patientId, requestId, createdAt

The record has the fields its GET returns, except those the GET builds on request: download and upload links, deliverable listings, authorization check results, partner delivery status, notes and embed tokens. GET the resource path for those.

data is the record when the event was processed, so it can already show changes made moments later. Changes close together can arrive as one event, such as two quick status moves as one recordRequest.statusChanged, and events from different groups can arrive out of order.

ID only

With ID only, data and previous are always empty objects, including on clinicalData.added, aiResearch.completed and fee.siteFeeCreated; every other field is sent as usual. Use it to keep patient data out of your receiver and read the record from resource instead.

Verify a delivery

Each delivery carries three headers:

HeaderMeaning
X-Webhook-IdThe delivery id.
X-Webhook-TimestampUnix seconds when this attempt was signed.
X-Webhook-SignatureOne or more hex-encoded HMAC-SHA256 signatures, comma-separated.

To verify one:

  1. Reject the request if X-Webhook-Timestamp is older than your freshness window, for example five minutes. This stops a captured request being replayed.
  2. Compute the hex-encoded HMAC-SHA256 of {X-Webhook-Timestamp}.{raw_body}, using the exact bytes you received as raw_body.
  3. Accept the request if your value matches any signature in X-Webhook-Signature. Compare in constant time.

Key the HMAC with the signing secret’s 16 raw UUID bytes, not its string form. Hashing the string produces a signature that never matches.

Both samples below take the signing secret as you copied it, the two headers, and the raw request body, before any JSON parsing.

Verify a delivery
Python
import hashlib
import hmac
import time
import uuid

FRESHNESS_SECONDS = 300

def verify(secret: str, timestamp: str, signatures: str, raw_body: bytes) -> bool:
    if abs(time.time() - int(timestamp)) > FRESHNESS_SECONDS:
        return False

    key = uuid.UUID(secret).bytes
    expected = hmac.new(key, f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()

    return any(
        hmac.compare_digest(expected, candidate.strip())
        for candidate in signatures.split(",")
    )
import { createHmac, timingSafeEqual } from "node:crypto";

const FRESHNESS_SECONDS = 300;

export function verify(
  secret: string,
  timestamp: string,
  signatures: string,
  rawBody: Buffer,
): boolean {
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > FRESHNESS_SECONDS) {
    return false;
  }

  const key = Buffer.from(secret.replace(/-/g, ""), "hex");
  const expected = createHmac("sha256", key)
    .update(`${timestamp}.`)
    .update(rawBody)
    .digest();

  return signatures.split(",").some((candidate) => {
    const received = Buffer.from(candidate.trim(), "hex");

    return received.length === expected.length && timingSafeEqual(received, expected);
  });
}

During a secret rotation the header carries two signatures. Accepting any match is what keeps deliveries flowing; see Manage webhook endpoints.

Respond

Return any 2xx within 10 seconds. Anything else, including a timeout, counts as a failure and the delivery is retried. See Handle webhook retries and failures.

Send a test

Send test on the Webhooks page sends one sample payload per group you subscribe to, shaped like the real event, to your URL and shows the result. A test is sent once, never retried, and never counts toward auto-disable.

Classic endpoints (deprecated)

Classic endpoints use column subscriptions instead of named events. They keep receiving exactly the deliveries they always did until January 31, 2027. You can still create a Classic endpoint until then, but it is not recommended: create a named-events endpoint instead. Each Classic endpoint on the Webhooks page shows an Upgrade to Events button that previews how its subscriptions map to named events, which of its columns are still in a payload, and which you would now read with a GET, before you confirm. The URL, secret and headers carry over.

Classic ends on January 31, 2027. On that date every Classic endpoint, webhooks and email notifications alike, is moved to named events automatically, with the Full record payload, even where the move loses something. From then on your receiver gets the named-event format described in Move a Classic endpoint to named events: eventType is the event’s name, the record is nested in data, the body carries "version": "events", and any column that maps to no event stops triggering a delivery. An endpoint that cannot be moved is stopped. Upgrade before then to choose the events yourself, and make sure your receiver accepts the named-event format first.

A Classic subscription names four things:

PartValues
EntityrecordRequest, patient or note
TriggerrowCreated (the entity was created), columnChanged (a subscribed column changed) or followUpDue (a record request’s follow-up date is due; record requests only)
ScopecompanyWide (every matching record in your company). tracked (only the records you follow: ones you created or are assigned, and ones you followed by hand) is for email notifications and is rejected on a webhook endpoint.
ColumnscamelCase column keys, such as status or searchStatus, or userId and ownerUserId for who created and is assigned the record

A Classic delivery’s eventType is <entity>.<trigger>, such as recordRequest.columnChanged, its data holds only the subscribed columns, and its body has no version or previous field. Otherwise it is the envelope above, signed and retried the same way. The exception is the Classic clinicalDataAdded and aiResearchCompleted deliveries: their body has only eventType and data, they carry no X-Webhook-Timestamp, no X-Webhook-Id and none of the endpoint’s custom headers, their X-Webhook-Signature is the HMAC-SHA256 of the raw body alone, and they are sent once with no retry.

On a Classic endpoint, do not subscribe to searchStatus alone to learn that a search finished. A repeat run that ends in the same searchStatus changes nothing and sends nothing; watch the siteSonar, patientHistories and ehrSearch request flags instead, or upgrade and use the .completed events.

Move a Classic endpoint to named events

Upgrading switches an endpoint’s deliveries from the Classic format to named events in one step. Upgrading is permanent: an upgraded endpoint cannot go back to Classic.

What your receiver sees change:

ClassicNamed events
eventType<entity>.<trigger>, such as recordRequest.columnChangedThe event’s name, such as recordRequest.completed
dataThe columns you pickedThe record, under request, patient or note
changedSubscribed columns that changedFields of the record that changed
previousAbsentThe changed fields’ prior values
versionAbsentevents
ScopeSet on each subscriptionSet once on the endpoint

The URL, signing secret and custom headers stay the same. So do the signature scheme, X-Webhook-Id and retries for every Classic subscription except the clinicalDataAdded and aiResearchCompleted events: Classic signs those over the raw body alone, sends them with no X-Webhook-Timestamp, no X-Webhook-Id and none of the endpoint’s custom headers, and sends them once. After the upgrade, clinicalData.added and aiResearch.completed are signed over {X-Webhook-Timestamp}.{raw_body}, carry X-Webhook-Id and the endpoint’s custom headers, and are retried like every other event, so a receiver that verifies them the Classic way rejects them. Verify them as in Verify a delivery before you upgrade.

How Classic subscriptions map to events:

Classic subscriptionNamed event
recordRequest createdrecordRequest.created
recordRequest status changedrecordRequest.statusChanged (add the category events, such as recordRequest.completed, if you only care about outcomes)
recordRequest follow-up duerecordRequest.followUpDue
patient createdpatient.created
patient siteSonar, patientHistories or ehrSearch changedThat capability’s .started and .completed
patient searchStatus changedpatient.searchStatusChanged
patient authorizationStatus changedauthorization.statusChanged
patient profile columns (name, date of birth, sex, contact details, ZIP codes) changedpatient.updated
note creatednote.created
note content changednote.updated
Clinical data added or AI research completed from the Entity dropdown’s Events groupclinicalData.added or aiResearch.completed

Any other column stops triggering a delivery. The upgrade preview says, for each one, whether it is still a field of the record in data or whether you now read it with a GET on the resource path, as you do a deliverable’s link.

To upgrade without dropping a delivery:

  1. Update your receiver to accept both formats. Branch on version: a body with "version": "events" is a named event, and a body without it is Classic. If the endpoint carries clinicalDataAdded or aiResearchCompleted, verify named events with the timestamped signature. Deploy that first.
  2. Open the preview. On the Webhooks page, select Upgrade to Events on the Classic endpoint. The preview lists each subscription, the events it becomes, and what happens to each column. The events are pre-ticked, and you can add or remove any before you confirm.
  3. Check the scope. Named events use one scope for the whole endpoint. If your subscriptions had different scopes, the upgrade takes the broadest one and the preview says so. Narrow it there, or split the work across two endpoints.
  4. Confirm. The next change sends named events. Select Send test to see a sample of each subscribed group’s payload.
  5. Remove the Classic branch from your receiver once named events are arriving.

To run both side by side instead, create a new endpoint with named events at a second URL, move your integration across, then delete the Classic endpoint.

Next steps