Unmatched Lab Results Integration Guide
The Unmatched Results API lets you review a lab result that could not be safely attached to an order automatically. You can accept a proposed match, reject the result, or ask the Junction operations team to review it. This guide covers:- receiving review notifications by webhook;
- listing and retrieving unmatched results;
- accepting, rejecting, or escalating a result; and
- understanding the available match cases.
Recommended integration flow
- Subscribe your webhook endpoint to
labtest.match_review.created. - When the webhook arrives, store its
data.idas the unmatched-result ID. - Fetch the full item with
GET /v3/unmatched_result/{id}. - Present the result, patient context, and candidate orders to a reviewer.
- Display only the actions listed in
allowed_actions. - Call the accept or resolve endpoint with the reviewer’s decision.
- Use the returned resource as the source of truth for the final state and store its
order_transaction.idto track related orders.
Test your integration in Sandbox
The unmatched-result testing API creates realistic review items in Junction Sandbox. It creates the required Sandbox orders, or uses orders that you provide, generates a central-lab result, and sends it through the normal matching and review flow. You do not need to create HL7, upload a result, or configure a lab account. After a test run succeeds, use itsraw_result_id with the normal unmatched-results API to test your polling, webhook, review, accept, reject, and escalation flows.
The testing API is available only in Sandbox and returns
404 Not Found in production. It also requires the unmatched-result testing feature to be enabled for your Sandbox team. Contact your Junction representative to enable it.- support Labcorp, Quest, Sonora Quest, and BioReference panels;
- produce the same decision codes described in Available decision cases;
- emit the normal
labtest.match_review.createdandlabtest.match_review.updatedwebhooks; and - persist in Sandbox. There is no cleanup or cancellation endpoint.
Run a test
- Call the case catalog and choose a case.
- Choose
managedorders for Junction-created fixtures orprovidedorders to use existing Sandbox orders. - Create a test run with a stable
X-Idempotency-Key. - Poll the run until its status is
succeededorfailed. - On success, retrieve the generated item with
GET /v3/unmatched_result/{raw_result_id}and process it through the normal accept or resolve endpoints. - Reconcile the API state with the normal match-review webhooks.
202 Accepted with a run ID:
raw_result_id and any orders that Junction created:
wrong_collection. That case requires a provided at-home phlebotomy order. In provided mode, the orders object must contain exactly the role names returned by the case catalog, and the orders must belong to the authenticated Sandbox team.
If Junction finds more than one eligible central-lab panel, include lab_test_id in the create request. For wrong_lab, use wrong_lab_test_id in managed mode to select the panel for the order at the other central lab.
Keep the idempotency key stable when retrying after a client timeout. Reusing the same key and request returns the existing run; reusing it with a different request returns 409 Conflict.
Webhook
Event type
data.id from the API before displaying or resolving the item.
Example payload:
API endpoints
List unmatched results
Without a
status filter, the endpoint returns actionable customer items and items that you escalated with unsure. Resolved items are excluded by default.
Response:
next_cursor unchanged into the next request. Do not parse or construct cursor values in your application.
Get one unmatched result
Candidate confidence and reason codes are review aids; they do not replace human confirmation. A
provenance_order is the order associated with the incoming sample or result history. An order_option is another order that may be a valid target.
Accept a match
accept only when it appears in allowed_actions.
Request fields:
If both
user_id and order_id are supplied, the order must belong to that user. Send an empty object only when accepting the system’s unambiguous default target. For ambiguous demographic or no-match cases, explicitly select an order_id or user_id.
Example:
Track related orders with an order transaction
An order transaction groups orders that belong to the same order lifecycle. For example, an original order and an order created to replace it can have different order IDs while sharing one order transaction ID. The candidate records exposeorder_transaction_id when one is available. The order returned by accept includes the authoritative order_transaction. An abridged response looks like:
order_transaction.id as the grouping key in your system and keep each individual order ID as a member of that group. Use parent_id to identify the direct predecessor and low_level_status to determine what happened to each order. Do not overwrite the original order ID with the replacement order ID or assume that a candidate order remains the active order after acceptance.
You can retrieve all orders in the group with:
accept. If acceptance creates an order for a different patient, its transaction may differ from the candidate transaction shown before review.
Reject or escalate a result
Example escalation:
unsure, its status is pending_ops_review and allowed_actions is empty. After reject, its status is resolved and allowed_actions is empty.
Review statuses
Available decision cases
Thedecision_code describes why automatic matching stopped. Use the API’s reason, candidates, and allowed_actions together when presenting a case.
Candidate reason codes
Each candidate may include one or more machine-readable reasons:Error handling
Because another reviewer may act on an item first, re-fetch the item after a failed action before prompting the user to retry. Never attempt to work around a
404 by using an ID from another team.
Integration checklist
- Enable the unmatched-results review queue for the correct environment and team.
- Subscribe the existing webhook destination to
labtest.match_review.created. - Verify webhook signatures and handle repeated deliveries safely.
- Fetch the full item from the API after receiving a webhook.
- Use
allowed_actionsto control available review actions. - Require an explicit patient/order selection for ambiguous cases.
- Store the order and
order_transaction.idreturned byaccept. - Group related orders by transaction ID while retaining each individual order ID.
- Reconcile outstanding items periodically with the list endpoint.