canonical: https://jentic.com/apis/junction.com/junction

# Junction API

The Junction API orders diagnostic lab tests and collects health data from wearables and health apps for the users of your product. On the lab side it creates orders for at-home test kits, mobile phlebotomy, or walk-in patient service center draws, books and reschedules collection appointments, tracks orders, and returns results as structured data or PDF, with insurance payor search and ICD code validation alongside. On the device side it issues Link tokens that let a user connect providers, then serves daily summaries for sleep, activity, workouts, and body measurements plus granular timeseries such as heart rate, HRV, glucose, and blood pressure. Separate US and EU hosts, each with a sandbox, keep data in the region you choose.

## For AI agents

Order lab tests, book phlebotomy or patient service center appointments, and read lab results, or pull a user's sleep, activity, workout, and vitals data from connected wearables. Includes user management, Link tokens, and insurance lookups.

## Scope

Does not handle electronic health record charting, e-prescribing, or claims submission. Use for lab test ordering and results and wearable health data only.

## Capabilities

- Create a lab order for a user with a lab_test_id, collection_method, and patient_details, then track it and download the result PDF
- Check phlebotomy or patient service center appointment availability and book, reschedule, or cancel the collection appointment for an order
- Search the lab compendium and orderable tests, list markers for a test, and estimate pricing for an order set
- Generate a Link token so a user can connect a wearable or health app provider to your team
- Read daily summaries of a user's sleep, activity, workouts, body, and meals between a start_date and end_date
- Pull grouped timeseries for metrics such as heartrate, hrv, glucose, blood_pressure, and steps with cursor paging
- Search insurance payors and diagnosis codes and validate ICD codes before submitting an order

## Use cases

### Agent-Run Lab Ordering via Jentic

An AI agent in a digital health product creates a Junction lab order for a user, then checks appointment availability near the patient and books a mobile phlebotomy or patient service center draw for that order. Through Jentic the agent finds each operation by intent and calls it with your stored team key, then follows the order's tracking until the result is ready to read back as structured data or a PDF.

Example prompt: Create an order for user_id with lab_test_id, collection_method 'walk_in_test', patient_details, and patient_address, then fetch patient service center availability and book the first open slot for that order

### Wearable Data for Coaching and Remote Monitoring

A coaching or remote-monitoring app creates a Junction user with its own client_user_id, issues a Link token so the user connects a provider, and then reads daily sleep, activity, and workout summaries. For clinical detail it pulls grouped timeseries such as heart rate, HRV, glucose, and blood pressure between dates, paging with the returned cursor.

Example prompt: Create a user with client_user_id 'patient-8841', generate a Link token for them, and after connection read their sleep summaries and grouped hrv timeseries for the last 7 days

### Results Review and Unmatched Result Handling

Clinical operations teams read order results as raw data, metadata, or PDF and send results that arrived without a matching order to a review queue. Unmatched results can be listed, inspected, accepted, or resolved, so no lab result is left unattached.

Example prompt: List unmatched results, inspect each one, and accept the results that match an existing patient by name and date of birth

### Insurance and Coding Checks Before Ordering

Before placing an insurance-billed order, a team searches payor information and diagnosis codes and validates the ICD codes it plans to attach. That catches coding errors before the order reaches the lab.

Example prompt: Search diagnosis codes for 'type 2 diabetes', validate the chosen ICD codes, and search the patient's insurance payor before creating the order

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v3/order` | Create a lab order |
| GET | `/v3/order/{order_id}` | Get an order |
| GET | `/v3/order/{order_id}/result/pdf` | Get the lab result PDF |
| POST | `/v3/order/{order_id}/phlebotomy/appointment/book` | Book a phlebotomy appointment |
| POST | `/v2/user` | Create a user |
| POST | `/v2/link/token` | Generate a Link token |
| GET | `/v2/summary/sleep/{user_id}` | Get a user's sleep summaries |
| GET | `/v2/timeseries/{user_id}/glucose/grouped` | Get grouped glucose timeseries |

## Key resources

- **Users** — Your product's users, keyed by user_id or your own client_user_id, with connected providers and demographics.
- **Link** — Link tokens and provider connection flows for wearables and health apps.
- **Summaries and timeseries** — Daily sleep, activity, workout, body, and meal summaries plus granular vitals timeseries.
- **Lab tests and orders** — Orderable tests, markers, orders, appointments, tracking, and results.
- **Insurance** — Payor search, diagnosis search, and ICD code validation.

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 48 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 58 / 100
  - Developer Experience & Jentic Compatibility: 54 / 100
  - AI-Readiness & Agent Experience: 45 / 100
  - Agent Usability: 46 / 100
  - Security: 50 / 100
  - AI Discoverability: 40 / 100
- **View full report:** https://jentic.com/apis/junction.com/junction/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Junction by hand means sending its `x-vital-api-key` header, picking the right US or EU host and sandbox, running the Link token flow for each user's providers, and sending idempotency keys on order creation. Through Jentic you install once, import Junction from the API Directory, store the team key once, and your agent calls it.
- **Permission scoping:** Junction puts the user_id and order_id in the URL path (`/v2/summary/sleep/{user_id}`, `/v3/order/{order_id}`), so a rule can pin your agent to one user or one order and the operations you pick. You choose the operations it may call, so actions like deleting a user, cancelling an order, or placing a new order are not included unless you add them.
- **Credential handling:** Your Junction team key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'order a lab test' or 'get a user's sleep data', and Jentic returns the matching Junction operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ROOK** — ROOK aggregates wearable health data; Junction pairs wearable data with lab test ordering.
- **Spike Health Data API** — Spike unifies data from wearables and health apps; Junction adds diagnostics ordering and results.
- **Oura Ring API** — Oura exposes data from Oura rings directly; Junction can read the same user's data alongside other providers.
- **Fitbit Web API** — Fitbit's own API serves Fitbit device data; Junction normalises it with other providers.

## FAQ

### What authentication does the Junction API use?

The Junction API authenticates with a team API key sent in the `x-vital-api-key` header, per its OpenAPI spec. A handful of Link operations that a user's browser calls while connecting a provider, such as the provider list and password or email provider connection, skip the team key and take a Link token in the x-vital-link-token header instead. Through Jentic the team key is stored encrypted by your own Jentic One instance and injected at call time.

### Is there a Junction MCP server?

You don't need an MCP server to give your agent Junction. Jentic connects it directly from the API Directory: import it, store your team key once, and your agent orders lab tests or reads health data as it needs to. Operations are discovered on demand, so no extra server's tool definitions sit in your agent's context.

### Can I limit what my agent is allowed to do with the Junction API?

Yes. For example, write a rule that allows only the summary and timeseries reads under `/v2/summary/sleep/{user_id}` and `/v2/timeseries/{user_id}`/, so a coaching agent can read one user's sleep and vitals but cannot place lab orders or delete users. Because user_id and order_id sit in the path, the same approach holds an operations agent to one order, and every call it makes is logged.

### Does the Junction API have separate US and EU environments?

Yes. The Junction OpenAPI spec lists production hosts at api.us.junction.com and api.eu.junction.com, plus sandbox hosts at api.sandbox.us.junction.com and api.sandbox.eu.junction.com. Use the host that matches the region your team was created in.

### What are the rate limits for the Junction API?

The Junction OpenAPI spec does not specify rate limits. Check the Junction documentation at https://docs.junction.com/ for current limits.

### How do I order a lab test with the Junction API through Jentic?

Search Jentic for an intent like 'order a lab test for a patient', import Junction from the API Directory, and store your team key once. Your agent then calls POST `/v3/order` with the user_id, patient_details, patient_address, and the lab_test_id to run, and follows up with GET `/v3/order/{order_id}` to track it. To run it on your own infrastructure, install Jentic One from its GitHub repo.
