Connection API Reference
Which API should I use?
Act for one user at a time, on the OAuth token they grant. Self-serve, no keys.
Reach all your connections from your backend. Partner-signed tokens over mTLS. Available today through a partner agreement.
Compare them in detail
Who does it act for?
One user at a time
All of your connections
How do you call it?
MCP tools today; REST on the user’s token is coming
REST endpoints
What do you use to authenticate?
An OAuth token the user granted
A partner-signed token over mTLS
How do you get set up?
Self-serve: your app registers itself, no keys
A partner agreement, then a tenant set up with us: signing keys, source-IP ranges
What you can reach. “Coming” in the Connection API column means calling it with a user’s OAuth token. To reach document downloads and connection events today, use the Partner API.
Records
✓
✓
Document downloads
Coming
✓
Connection events
Coming
✓
Messaging
Coming
Coming
This guide covers the Connection API. For the Partner API, see its documentation.
Every response on this page is the server’s actual reply from production, with per-client values replaced by placeholders. Values in angle brackets are placeholders for secrets or per-client values.
0. Instructions for your coding agent
Paste this into the agent that writes your integration. Sections 1 to 8 and 9a are live in production and the sections further down this page show each call’s actual response. Section 9b (the Consumer APIs on a user’s access token) is not live yet and is marked as such, so your agent knows what is coming without building against it. Partners reach the Consumer APIs today with Partner API credentials (see the Partner API).
1. Discovery
The MCP server tells a client where to get authorized. Verbatim:
The authorization server describes itself. Verbatim:
What it says in words: public clients, PKCE with S256, authorization code and refresh grants, self-registration, revocation. No client secrets anywhere.
2. The 401 that starts the flow
An unauthenticated MCP call. Verbatim:
A spec-conformant MCP client follows that header on its own. This is the whole reason “point your client at one server” is true.
3. Point an MCP client at it
No auth block is needed. The client discovers the authorization server from the 401.
4. Register a client
Public client, RFC 7591. Request:
Response (values illustrative, shape exact):
5. Ask for permission
Real scopes. Two are enough for an agent that reads records and keeps a standing connection:
Scope
What the user is asked
What it does
records:read
Share my records with Your Agent
Read access over MCP
records:add
Receive my records from Your Agent
Your app can contribute records
account:assist
Authorize Your Agent to assist with sharing and ordering my records
Act on the account’s behalf
messages:send
Allow Your Agent to send me messages and notifications
Notifications to the user
offline_access
(standing connection)
Refresh token
openid profile email address phone
Identity claims (OpenID Connect)
Authorize URL, built by the client:
The user signs in to AllClear, sees the request in plain words, and taps Authorize. The redirect back carries code, state, and iss (the server supports the iss response parameter, so the client can check who answered).
Node, no SDK needed:
Which scopes for which flow
The scope string you request decides what the user approves and what you get back. Four common flows:
Flow
Scopes to request
What it gives you
Identity
openid profile email
A signed id_token that identifies a verified person, plus their details from /userinfo. No record access.
One-time data share
records:read
Read access to the user’s records over MCP. Omit offline_access when you only need to read once.
Standing connection
records:read offline_access
Read access plus a standing connection you can refresh without the user, until they disconnect or the refresh token goes 30 days unused.
Login and standing records
openid records:read offline_access
Identity and ongoing record access in one grant: the shape a full connector uses.
6. Exchange the code
Response shape, from the server code (field names exact, values illustrative):
Treat both tokens as opaque; the format is the server’s business and may change. What a client needs to know: the access token is bound to the grant the user gave, to your client, and to the MCP server it was issued for; it lasts one hour; the refresh token renews it under the same grant without the user, and each refresh issues a fresh 30-day refresh token; when the user disconnects, both stop working at once, and a refresh token left unused for 30 days expires.
7. Call a tool
Tools the server advertised on 2026-09-08 (the live answer is tools/list): get_patient_basic_info, get_medications, get_conditions, get_allergies, get_lab_results, get_vital_signs, get_immunizations, get_encounters, get_procedures, get_care_plans, get_patient_insurance, list_patient_documents, summarize_document, search_medical_data, search_faqs, search_faqs, list_connections, connect_provider.
Response envelope from an account with no active medications (structure is the point; a populated account fills fhir_records and retrieved_context):
list_connections (values illustrative, shape exact):
Two notes for the page: records come back as they are, structured where the source had structure (the fhir half) and as the clinical documents themselves where it did not (the document half), which keeps the context a conversion would lose; and there is no per-record source or consent id in the output today.
8. Refresh
Same response shape as section 6. Access tokens live one hour; the standing connection is the refresh token, which the user can end at any time from the app. client_id is optional on the refresh grant (the token identifies the grant); if you do send it, it must match your registered client.
9. Revoke
From your side:
From the user’s side: they open Connections in the AllClear app and disconnect. Either way, the next MCP call answers 401 and the flow in section 2 starts again. No webhook exists; the page shows the 401 instead of a webhook.
10. What the user sees
Real screens from the consent flow, in order:
Header “Connection Request”, title “Choose Your Settings”, card “You’re connecting with Your Agent”. Verified clients show a shield and their domain; unverified ones show “Not verified by Health Bank One”.
Four toggles, worded as the user reads them: “Share my records with Your Agent”, “Receive my records from Your Agent”, “Authorize Your Agent to assist with sharing and ordering my records”, “Allow Your Agent to send me messages and notifications”.
“Confirm Your Settings” with the same lines read back, then Authorize or Cancel.