Skip to content
Hermes Health API
GuidesOpenAPI spec

Endpoints

Site finder

POST/v0/site-finder

Start a site-finder job

Start a site-finder job to resolve a site by name, address, and optional identifiers.

Runs the site resolution pipeline (geocoding, embedding search, AI matching) in the background and returns a jobId. Poll GET /v0/site-finder/jobs/<job_id> until status is completed or failed to retrieve the result. An AI agent reads that result only with the “View facility lookups” permission in its grant.

By default the search tries in-network facilities first, those Hermes requests records from directly, and looks at the others only when none of them matches.

Set researchMode to lite or full to also run AI research on the matched site; this needs the research permission, and a caller without it receives a 403. The job’s research object reports its progress.

A sandbox API key starts no search and is never charged: it gets a job whose result is always the same synthetic site, ACME Hospital, and research is never run for it.

Send ?quote=true to learn what the lookup would cost without starting it: the body and the research permission are checked as the call would check them, a caller with a daily lookup limit is refused once it is used up, and the response is the fee quote. Nothing is started, charged or counted against the limit, so a quote is safe to repeat. Send the quote’s confirmationToken back as ?confirmQuote= with the same body to start the lookup at no more than the quoted price.

Parameters

  • quotebooleanquery

    `true` to get what this call would cost without making it. The body is checked as the call would check it, and the response is a fee quote: nothing is created, changed, charged or sent. Leave it out, or send `false`, to make the call (an AI agent must confirm with `confirmQuote` instead). Any other value, or `quote` given more than once, is refused with `400`.

  • confirmQuotestringquery

    The `confirmationToken` of a quote for this same call, to make the call at no more than the quote's `totalHigh`. The method, path, query and body must be the ones that were quoted. A token is short-lived and is spent once the call starts, so a call that then fails needs a fresh quote. A person's or an API key's token is spent in memory, so it may be accepted again after a server restart within its lifetime; an AI agent's is journaled against its grant and is spent for good. An AI agent must send one: its call without a token is answered with the quote and not made. Anyone else may send one, or leave it out to make the call unconfirmed. Refused with `400` when it was altered or issued to another caller, when it is sent together with `quote=true`, or when `confirmQuote` is given more than once; with `409` when the call changed, the token expired or was already used, the call would now cost more than was quoted, or too many confirmations are outstanding, in which case retry shortly with the same token; and, for an AI agent, with `403` when the call would take it past the spending allowance it was given.

Request bodyapplication/json

  • namestring

    Name of the facility or provider to find, as the caller knows it. A provider's name is resolved to the facility they practice at when possible.

  • addressLine1string

    First street address line of the site.

Optional parameters

  • addressLine2string

    Optional secondary address line — suite/unit/apt, or for Puerto Rico addresses the `URB <name>` urbanization line per USPS Publication 28.

  • citystring

    City of the site. May be omitted or null.

  • statestring

    Two-letter US state code of the site. May be omitted or null.

  • zipstring

    ZIP code of the site. May be omitted or null.

  • latitudenumber

    Latitude of the site in decimal degrees. Optional: the submitted address is geocoded, and these coordinates are used only when that lookup finds nothing. Supply it together with `longitude`.

  • longitudenumber

    Longitude of the site in decimal degrees. Optional: the submitted address is geocoded, and these coordinates are used only when that lookup finds nothing. Supply it together with `latitude`.

  • npistring

    10-digit National Provider Identifier. When exactly one existing site carries this NPI, that site is returned without an address search.

  • ncpdpstring

    NCPDP Provider ID for pharmacy sites. Matched ahead of NPI in the shortcut pipeline because NCPDP uniquely identifies a dispensing location.

  • taxIdstring

    Federal tax identification number of the organization. Carried into the new-site proposal when no existing site matches.

  • isFacilityboolean

    Whether the name is a facility (true) or an individual provider (false). When omitted or null, it is inferred from the name.

  • phonestring

    Main phone number of the site. Carried into the new-site proposal when no existing site matches.

  • systemNamestring

    Name of the health system the site belongs to. Carried into the new-site proposal when no existing site matches.

  • primarySpecialtystring

    Primary specialty of the site or provider, as free text. Carried into the new-site proposal when no existing site matches.

  • acceptsEsignatureboolean

    Whether the site accepts electronically signed authorizations. Carried into the new-site proposal when no existing site matches.

  • operationalStatusstring

    Operational status to stamp on a site created from this search's new-site proposal. Omit it for an operating site.

  • researchModestring

    AI research to run on the site the lookup matches, once the match is made: `none` (the default) runs no research, `lite` researches the medical records department of a facility that has not been researched in the last two months, and `full` researches every contact when the site has never been researched or its research is out of date. Full research supersedes lite research. Research needs the research permission; the job's `research` object reports how it went.

ReturnsSuccess

object | object

Errors

400401403409429500

POST/v0/site-finder/embed-token

Mint a site-finder embed token

Mint an embed token for iframing the site-finder UI.

The token authorizes the interactive embed at GET /ui/site-finder/embed?token=...: anyone holding it can run finder searches, create sites from finder proposals, and trigger AI research, all attributed and billed to the minting user’s company. Tokens are stateless, sealed with authenticated encryption (encrypt-then-MAC, keyed apart from both the generic URL-query oracle and the auth-check embed tokens), and expire one hour after minting — mint a fresh token each time you render the page that hosts the iframe.

See Embedding the site finder for the full iframe integration guide.

Request bodyapplication/json

object

ReturnsSuccess

  • tokenstring

    The embed token: an opaque encrypted string to pass to the embed as its `token` query parameter. It grants access to what it was minted for until it expires, so mint a fresh one rather than storing it.

Errors

400401403429500

GET/v0/site-finder/jobs/{job_id}

Retrieve a site-finder job

Fetch the status and result of a site-finder job started via POST /v0/site-finder.

Poll this endpoint until status is completed or failed. On completion, siteFinder contains the resolution result and siteFinderProposal contains a signed proposal to create a new site if no match was found.

When the job was started with a researchMode of lite or full, research runs after the match and research.status reports it separately from the job’s own status. Keep polling until research.status is completed, skipped or failed, then read the researched site with GET /v0/sites/<siteId>.

A job started with a sandbox API key is already completed, matched to the synthetic site ACME Hospital, with research reported as notRequested. A sandbox key can read only those jobs: any other id answers 404 to it.

Parameters

  • job_idstringpath, required

    The `jobId` returned when the job was started with `POST /v0/site-finder`.

ReturnsSuccess

  • idstring

    Identifier of the job, as returned by `POST /v0/site-finder`.

  • statusstring

    Where the job is in its lifecycle.

  • inputSummaryobject

    The name and address the job was started with.

  • inputSummary.namestring

    Facility or provider name the job was started with.

  • inputSummary.addressstring

    First street address line the job was started with.

  • researchobject

    Progress of the AI research requested with `researchMode`. Research starts once the job has matched a site, so poll until its `status` is `completed`, `skipped` or `failed`.

  • research.modestring

    The `researchMode` the job was started with.

  • research.statusstring

    Where the research stands.

  • createdAtstring

    When the job was started (RFC 3339, UTC).

Conditional attributes

  • externalIdstring

    The caller's own reference for the row, taken from the `id` column of a batch upload; absent for single lookups.

  • inputSummary.citystring

    City the job was started with; absent when none was given.

  • inputSummary.statestring

    State the job was started with; absent when none was given.

  • inputSummary.zipstring

    ZIP code the job was started with; absent when none was given.

  • siteFinderobject

    The search result: the matched site, other candidate matches, and nearby sites. Present only once `status` is `completed`.

  • outcomestring | string | string | object | string | string

    How the result was reached. Present only once `status` is `completed`.

  • nameResolutionobject | object | object

    Whether the submitted name was treated as a facility or a provider. Absent until the job completes, and when an identifier in the request matched a site directly.

  • siteFinderProposalobject

    Signed proposal for creating the site when no existing site matched. Absent when a site matched, when the name is a provider whose facility could not be determined, when the entity is not a healthcare organization, or when the proposal could not be prepared.

  • spellingCorrectionobject

    The corrected name and/or city the search used, when the submitted spelling could not be located.

  • siteEligibilityobject

    Web-search check of an unmatched name and address. Present only when no existing site matched and the check ran; a `category` of `other` means the entity is not a medical facility, pharmacy or lab, and no `siteFinderProposal` is returned.

  • research.siteIdstring

    The site research runs on, or would have run on. Absent until the job has matched a site. Read the site with `GET /v0/sites/<siteId>` once `status` is `completed`.

  • research.reasonstring

    Why research did not run. Present only when `status` is `skipped`.

  • errorstring

    Message describing why the job failed. Present only when `status` is `failed`.

  • startedAtstring

    When the job began running (RFC 3339, UTC); absent while it is still `pending`.

  • finishedAtstring

    When the job reached `completed` or `failed` (RFC 3339, UTC); absent until then.

Errors

401404500