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
- Sign in to Hermes Health and open Settings → Webhooks. The tab is
shown to anyone with the
ManageWebhookspermission. - Select Add webhook.
- Enter your receiver’s URL. It must be publicly resolvable; private and loopback addresses are rejected.
- Choose the environment,
productionorsandbox. An endpoint receives events only from projects in its own environment. - Pick the events (next section): tick a whole group, or single events.
- Choose the scope: which projects the endpoint covers.
- 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.
- Optionally, add up to 20 custom headers sent on every delivery, such as
an
Authorizationheader your receiver checks. - Copy the endpoint’s signing secret. You need it to verify deliveries.
Creating a webhook endpoint requires the
ManageWebhookspermission, because a webhook can send PHI to an external URL. You cannot override theContent-Type,HostorX-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.
| Group | Covers |
|---|---|
recordRequest | A record request is created, changes status, or reaches its follow-up date. |
siteSonar | Site Sonar facility discovery starts or finishes for a patient. |
patientHistories | Patient Histories clinical-history retrieval starts or finishes for a patient. |
ehrSearch | EHR Search starts or finishes for a patient. |
patient | A patient is created, their profile changes, or their overall search status changes. |
authorization | A patient’s authorization is reviewed or needs attention. |
clinicalData | A run adds clinical data the patient did not already have. Webhook endpoints only. |
note | A note is added or edited. |
aiResearch | An AI research run started by anyone in your company finishes. |
fee | A 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:
| Event | Fires when |
|---|---|
recordRequest.created | A record request is created. |
recordRequest.statusChanged | A record request moves to any new status. |
recordRequest.processing | A record request is sent to the facility and is awaiting records. |
recordRequest.needsResolution | A record request is blocked on your action, such as a denied authorization, a pending payment or a site-specific authorization. |
recordRequest.authorizationNeedsResolution | A 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.completed | Records were received, fully or partially. |
recordRequest.recordsNotFound | The facility could not provide records. |
recordRequest.canceled | A record request is canceled, voided or marked a duplicate. |
recordRequest.followUpDue | A 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.deliveryFailed | A 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.started | Site Sonar starts for a patient. |
siteSonar.completed | Site Sonar finishes for a patient, on every run, whatever the result. |
patientHistories.started | Patient Histories starts for a patient. |
patientHistories.completed | Patient Histories finishes for a patient, on every run, whatever the result. |
ehrSearch.started | EHR Search starts for a patient. |
ehrSearch.completed | EHR Search finishes for a patient, on every run, whatever the result. |
patient.created | A patient is created. |
patient.updated | A patient’s name, date of birth, sex, contact details or ZIP codes change. |
patient.searchStatusChanged | A patient’s overall searchStatus changes. |
authorization.statusChanged | A patient’s authorization status changes. |
authorization.approved | A patient’s authorization is approved. |
authorization.needsAttention | A patient’s authorization moves to any status other than approved. |
authorization.needsResolution | A 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.added | A run adds clinical data a patient did not already have, with counts of what is new by type. |
note.created | A 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.updated | A note’s text is edited. |
aiResearch.completed | An AI research run you started finishes. |
fee.siteFeeCreated | A 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:
| Field | What it is |
|---|---|
channel | fax, email, mail or roi (a release-of-information service). |
code | Why it failed, a stable value to branch on: faxFailed, faxCanceled, emailRejected, mailCanceled or roiRejected. |
message | A readable sentence for display. Do not parse it. |
failedAt | When 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
| Setting | Values |
|---|---|
| Projects | Every project in your account, including new ones (the default), or only the projects you pick. |
| Records | Every 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:
{
"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" }
}
}
| Field | What it is |
|---|---|
id | The delivery ID. Retries reuse it, so deduplicate on it. |
timestamp | When the event happened, not when this attempt was sent. |
version | Always events. |
eventType | The event, such as recordRequest.completed. |
resource | The record’s path. For clinicalData.added it is your company; for aiResearch.completed, the site; for fee.siteFeeCreated, the fee. |
changed | The fields of the record in data that changed. Empty for events that are not changes, such as .created. |
previous | What each changed field held before, keyed the same way. Empty when changed is. |
data | The record, under the key its GET endpoint uses: |
| Group | data |
|---|---|
recordRequest | request, as GET .../record-requests/{recordRequestId} returns it; recordRequest.deliveryFailed adds deliveryFailure |
siteSonar | patient, as GET .../patients/{patientId} returns it |
patientHistories | patient |
ehrSearch | patient |
patient | patient |
authorization | patient |
note | note |
clinicalData | patients: each patient, its project, the run, and counts of what is new by type |
aiResearch | siteId, siteName, url |
fee | feeId, 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:
| Header | Meaning |
|---|---|
X-Webhook-Id | The delivery id. |
X-Webhook-Timestamp | Unix seconds when this attempt was signed. |
X-Webhook-Signature | One or more hex-encoded HMAC-SHA256 signatures, comma-separated. |
To verify one:
- Reject the request if
X-Webhook-Timestampis older than your freshness window, for example five minutes. This stops a captured request being replayed. - Compute the hex-encoded HMAC-SHA256 of
{X-Webhook-Timestamp}.{raw_body}, using the exact bytes you received asraw_body. - 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.
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:
eventTypeis the event’s name, the record is nested indata, 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:
| Part | Values |
|---|---|
| Entity | recordRequest, patient or note |
| Trigger | rowCreated (the entity was created), columnChanged (a subscribed column changed) or followUpDue (a record request’s follow-up date is due; record requests only) |
| Scope | companyWide (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. |
| Columns | camelCase 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
searchStatusalone to learn that a search finished. A repeat run that ends in the samesearchStatuschanges nothing and sends nothing; watch thesiteSonar,patientHistoriesandehrSearchrequest flags instead, or upgrade and use the.completedevents.
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:
| Classic | Named events | |
|---|---|---|
eventType | <entity>.<trigger>, such as recordRequest.columnChanged | The event’s name, such as recordRequest.completed |
data | The columns you picked | The record, under request, patient or note |
changed | Subscribed columns that changed | Fields of the record that changed |
previous | Absent | The changed fields’ prior values |
version | Absent | events |
| Scope | Set on each subscription | Set 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 subscription | Named event |
|---|---|
recordRequest created | recordRequest.created |
recordRequest status changed | recordRequest.statusChanged (add the category events, such as recordRequest.completed, if you only care about outcomes) |
recordRequest follow-up due | recordRequest.followUpDue |
patient created | patient.created |
patient siteSonar, patientHistories or ehrSearch changed | That capability’s .started and .completed |
patient searchStatus changed | patient.searchStatusChanged |
patient authorizationStatus changed | authorization.statusChanged |
patient profile columns (name, date of birth, sex, contact details, ZIP codes) changed | patient.updated |
note created | note.created |
note content changed | note.updated |
| Clinical data added or AI research completed from the Entity dropdown’s Events group | clinicalData.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:
- 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 carriesclinicalDataAddedoraiResearchCompleted, verify named events with the timestamped signature. Deploy that first. - 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.
- 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.
- Confirm. The next change sends named events. Select Send test to see a sample of each subscribed group’s payload.
- 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
- Handle webhook retries and failures: what happens when your receiver is down, and what webhooks don’t guarantee.
- Manage webhook endpoints: rotate the secret, and change an endpoint’s events.
- Request records from a facility: the status changes most integrations subscribe to.