Developer Docs






Getting Started — AllClear Developer Platform


Welcome, Developer!

Here’s everything you need to quickly get started.

MCP Server Address

Connect your AI tool or agent to the AllClear MCP server:



https://mcp.app.allclearid.com/mcp

Developer tier limited to 100 tool calls per day. By accessing the MCP server, you agree to the Developer Terms of Use.


Available Tools (14)
+

The AllClear MCP server exposes the following tools to connected AI agents.

get_patient_basic_info

Retrieve the patient’s basic demographic and contact information — name, date of birth, age, gender, email, mobile phone, and mailing address.

get_medications

Retrieve the patient’s medications — prescriptions, dosages, drug names, medication schedules, and pharmacological treatments.

Optional: status
(e.g. active, completed, stopped)  · 
page

get_conditions

Retrieve the patient’s medical conditions — diagnoses, chronic illnesses, ongoing health problems, and documented medical history.

Optional: status
(e.g. active, resolved, inactive)  · 
page

get_allergies

Retrieve the patient’s known allergies and adverse reactions — drug allergies, food intolerances, environmental sensitivities, and documented reactions including severity.

Optional: page

get_lab_results

Retrieve the patient’s laboratory test results — blood tests, urine analysis, pathology reports, biomarker values, and diagnostic lab work with result values and reference ranges.

Optional: page

get_immunizations

Retrieve the patient’s vaccination and immunization history — vaccines received, immunization dates, booster doses, and immunization status.

Optional: page

get_vital_signs

Retrieve the patient’s vital sign measurements — blood pressure, heart rate, body temperature, respiratory rate, oxygen saturation, weight, height, and BMI readings over time.

Optional: page

get_procedures

Retrieve the patient’s medical procedures — surgeries, therapeutic interventions, diagnostic procedures, and clinical procedures performed including dates and outcomes.

Optional: page

get_encounters

Retrieve the patient’s clinical encounters and visits — hospital admissions, outpatient visits, emergency department visits, telehealth consultations, and documented healthcare interactions including dates, providers, and visit reasons.

Optional: page

get_care_plans

Retrieve the patient’s care plans — treatment plans, clinical goals, recommended activities, follow-up schedules, and coordinated care instructions set by the care team.

Optional: page

list_patient_documents

List all medical documents available for the patient — returns document IDs that can be passed to other tools to filter retrieval to specific records or providers. Call this first when working with a particular provider’s documents or a specific file.

summarize_document

Summarize a patient document given its document ID. Use list_patient_documents first to discover available IDs.

Required: document_id

search_medical_data

Search the patient’s medical data using free-text semantic similarity. Use when the question spans multiple data categories or when the relevant document type is unknown. Prefer the specific get_* tools when the category is clear.

Required: query  · 
Optional: document_ids,
page

search_faqs

Search indexed platform FAQs using a free-text query. Use for questions about AllClear platform services, features, account management, policies, or procedures — not for personal medical data questions.

Required: query

Quickstart Guide — Self Access

Connect your AI tool to access your own Production health records via OAuth in under 60 seconds.


🔜
Sandbox mode (synthetic data for development) — coming soon

1

Install the AllClear digital ID  Free for Bootstrap Developer Members (limited time offer)

The app is required to authenticate and access your health records.

Click here to download

or scan the QR code with your phone:


QR code — download AllClear app

2

Connect your AI tool




Claude Code

+

Terminal / CLI

1

Run this command in your system terminal (not inside Claude Code):

claude mcp add --transport http allclear "https://mcp.app.allclearid.com/mcp"

2

Open Claude Code, run
/mcp,
select allclear and click Authenticate.




Claude

+

Desktop app, desktop web, mobile web → syncs to mobile app

Easiest: click the link below to open the Add Connector dialog directly.

1

Make sure you’re logged in to claude.ai, then
open Add Custom Connector.

2

Enter AllClear as the name.

3

Paste the URL below as the Remote MCP server URL:

https://mcp.app.allclearid.com/mcp

4

Click Add and complete the login flow.

Add connectors from: Claude Desktop (macOS/Windows), claude.ai (desktop web), or claude.ai (mobile web).
The native mobile app cannot add connectors — but once added, it syncs and works there too.




ChatGPT

+

Set up on web, works everywhere (including native app)

Set up on chatgpt.com in any browser. Once saved, it works in the native iOS/Android app too.

1

Open chatgpt.com in your browser (desktop or mobile).
Tap your name → Settings → Apps → Advanced settings.

2

Enable Developer mode.

3

Tap Create App, enter AllClear as the name (leave description blank).

4

Paste the URL below as the MCP server URL:

https://mcp.app.allclearid.com/mcp

5

Tap Continue and complete the login flow.

Requires ChatGPT Plus, Pro, or Enterprise.

Quickstart Guide — Multi-patient Access (requires Commercial license)

Multi-patient access and OAuth integration guide: AI instructions here


HB1 OAuth Integration — AI Agent Instructions
+

Copy these instructions into your AI agent’s system prompt or context to enable OAuth-based multi-patient access.

# HB1 OAuth Integration — AI Agent Instructions

## Setup: Register a Client (one-time)

1. **Discover endpoints** — `GET https://oauth.app.allclearid.com/.well-known/oauth-authorization-server`. Never hardcode URLs; parse the JSON response for all endpoint locations.
2. **Register via DCR** — `POST /register` with `client_name`, `redirect_uris`, `token_endpoint_auth_method: "none"`, `response_types: ["code"]`, `grant_types: ["authorization_code", "refresh_token"]`.
3. **Persist the `client_id`** durably and securely. No `client_secret` is issued (public client). Losing the `client_id` forces re-registration and invalidates all user sessions.

## Auth Flow: Obtain a Token

4. **Generate a PKCE pair** — `verifier` = base64url(32 random bytes); `challenge` = base64url(SHA-256(verifier)). Only `S256` is accepted.
5. **Redirect the user** to `/authorize` with params: `response_type=code`, `client_id`, `redirect_uri` (must match registration exactly), `code_challenge`, `code_challenge_method=S256`, `state` (CSRF random). Store `verifier` server-side keyed by `state`.
6. **Exchange the code** — `POST /token` with `grant_type=authorization_code`, `code`, `redirect_uri`, `client_id`, `code_verifier`. Response contains `access_token` (~1h TTL), `refresh_token` (~30d TTL).

## Calling HB1: Use MCP Tools

7. **Invoke MCP tools** — `POST https://mcp.app.allclearid.com/mcp` with `Authorization: Bearer <access_token>` and a JSON-RPC body: `{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "<tool_name>", "arguments": {} } }`.
8. **Resolve user identity** by calling the `get_patient_basic_info` tool. This returns XML-tagged demographics (name, DOB, email, etc.). Cache in-session; do not call repeatedly. **Never** decode the access token for identity — it is opaque to your app.

## Token Lifecycle

9. **Refresh tokens** — `POST /token` with `grant_type=refresh_token`, `refresh_token`, `client_id`. Always use the same `client_id` that obtained the original tokens.
10. **Handle rotation atomically** — each refresh returns a new refresh token and retires the old one. Persist the new token before discarding the old one. Replaying a retired token triggers reuse-detection and **revokes the entire connection**.
11. **Revoke on logout** — `POST /revoke` with the refresh token. Don't just discard tokens locally.

## Critical Constraints

- **No OIDC today** — no `id_token`, no `openid-configuration`, no stable cross-session user identifier. Identity is resolved only via the MCP tool.
- **`email` may be empty** in the identity response — handle its absence explicitly.
- **`redirect_uri` is locked at registration.** Changing it requires a new DCR → new `client_id` → all users must re-authorize. Use a stable domain you control (e.g., `https://auth.yourorg.com/callback`).
- **Register separate `client_id`s per trust level** (e.g., end-user vs. admin flows). Never share across trust levels.
- **Treat tokens as PHI credentials** — encrypt at rest, exclude from source control, audit access.
- **Redirect URI schemes allowed:** `https://` (any host), `http://` loopback only, custom schemes for native apps. Non-loopback `http://` is rejected.

The process generally involves the following steps:

  • MCP client registration — register your application to obtain a client ID and secret via Open Dynamic Client Registration
  • OAuth integration — redirect patients through the AllClear authorization flow to obtain per-patient access tokens
  • Patient token management — handle access token storage, refresh, and expiration securely server-side; tokens must never be exposed to the client
  • Data access handling — pass the patient’s access token to the MCP server on each request; handle server responses utilizing parsing or local LLM processing

Integration with our full set of partner APIs is also available. View the documentation here.
+

The AllClear Partner API allows partners to receive event notifications, fetch patient information, and access patient health records.

This document covers all three APIs:

  • Events API — Real-time event notifications (connections, records)
  • Patient API — Patient demographic and insurance data
  • Patient Records API — Health record metadata and file downloads

Authentication

All API requests from partners to AllClear must be authenticated using a client-signed JWT bearer access token (Client Access Token), provided in the Authorization header.

Authorization: Bearer <Client Access Token>

Client Access Token Format

JWT Payload

{
  "htu": "85aff782ac67a43b074f1f46144193f89c693c8cc5456f1e4a83685ce3d4eabf",
  "htm": "9aee6b1bcdf617d8e39bb1f2b624c68ea33deb9d48e0364aeaded836d3d00293",
  "iss": "prod_client_name_981298",
  "aud": "partner.allclearid.com",
  "iat": 1738262025,
  "nbf": 1738262025,
  "exp": 1738262325,
  "jti": "155e9353-42f1-4813-a23a-267f43b18c4c"
}
FieldRequiredTypeFormatDescription
htuYesstringbase64url (SHA-256)Base64url-encoded SHA-256 hash of the full request URI. Ensures the JWT is valid only for the specific URI it was issued for.
htmYesstringbase64url (SHA-256)Base64url-encoded SHA-256 hash of the HTTP method in uppercase (e.g., GET, POST).
issYesstringMax 256 charsIssuer of the JWT. Must be the client ID of the requesting partner.
audYesstringFixed: “partner.allclearid.com”Audience claim. Must always be “partner.allclearid.com”.
iatYesintegerint64 (Unix timestamp)Issued at timestamp.
nbfYesintegerint64 (Unix timestamp)Not before timestamp. Minimum: 5 min before iat.
expYesintegerint64 (Unix timestamp)Expiration timestamp. Maximum: 5 min after iat.
jtiYesstringuuidUnique identifier for the JWT to prevent replay attacks.

How to compute htu and htm

import crypto from "crypto";

const sha256Base64Url = (input) => {
  return crypto.createHash("sha256")
    .update(input, "utf8")
    .digest("base64url");
};

const requestUrl = "https://api.example.com/resource?query=value";
const httpMethod = "POST";

const htu = sha256Base64Url(requestUrl);
const htm = sha256Base64Url(httpMethod);

JWT Signature

The Client Access Token must be signed using RS256 (unless otherwise agreed). AllClear will verify the signature using the partner’s public key identified by the kid value in the token’s header.

JWT Header

{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "prod-client_name-sig-rs256-20250130"
}
FieldTypeFormatDescription
typstringFixed: “JWT”Token type. Always “JWT”.
algstringRFC 7518Signing algorithm. Default “RS256” unless agreed otherwise.
kidstringMax 255 charsID of key used for signature verification.

Events API

The Events API delivers real-time event notifications by sending HTTP POST requests to partner endpoints when designated events occur.

Event Notification Flow

  1. Notification received — The partner’s public endpoint receives an HTTP request containing only the event type and event ID.
  2. Validate event notification — The notification is a signed JWT allowing the partner to verify it was sent by AllClear.
  3. De-duplicate event by event ID — Look up the event ID in a local list of already-processed events.
  4. Request full event data — Send an authenticated GET /events/{id} request to fetch the full payload.
  5. Full event data delivered — AllClear responds with the full event data as JSON.
  6. Process event — Process the event according to your business logic.
  7. Acknowledge with 200 OK — Return 200 OK within 5 seconds.
  8. Notification marked as acknowledged — AllClear marks the notification as acknowledged and will not re-deliver it.

Receiving Event Notifications

POST /your-notification-endpoint HTTP/1.1
Host: your-server.com
Content-Type: application/jwt

eyJhbGciOiJIUzI1NiIsImtpZCI6I...

Notification JWT Payload

{
  "type": "event_notification",
  "event": {
    "type": "connection.connected",
    "id": "b7b96067-691c-4e3a-b50f-762edd11f1b2"
  },
  "iss": "partner.allclearid.com",
  "aud": "prod_client_name_981298",
  "iat": 1700000000,
  "nbf": 1700000000,
  "exp": 1700003600,
  "jti": "93c8100c-f77e-436c-a003-60bcbc1b6ed8"
}

Minimal Data in Event Notifications
Event notifications contain only the event type and id. Full event data can be retrieved by calling GET /events/{id}.

Notification JWT Header

{
  "typ": "JWT",
  "alg": "RS256",
  "kid": "healthbankone-sig-rs256-20250130"
}

Validating Event Notifications

  1. Validate the JWT header: alg equals “RS256”; kid is AllClear’s signing key.
  2. Verify the JWT signature with AllClear’s key identified by kid.
  3. Validate JWT metadata: iss is “partner.allclearid.com”; aud matches your client ID; nbf in the past; exp in the future.

Requesting Full Event Data

GET /events/{event.id}
Authorization: Bearer <Client Access Token>

Example Response

{
  "type": "connection.connected",
  "timestamp": "2025-01-24T10:30:00Z",
  "id": "b7b96067-691c-4e3a-b50f-762edd11f1b2",
  "patient_id": "dd27837a-ba7f-4e28-b042-ba0dc00addac",
  "patient": { "id": "...", "first_name": "Floyd", "last_name": "Perkins", ... },
  "permissions": ["records:read", "records:add"],
  "portal_link": "https://adminportal.app.allclearid.com/...",
  "promo_code": "PROMO2025"
}

Error Responses

StatusDescription
401 UnauthorizedInvalid or missing Client Access Token
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorUnexpected server error

Acknowledging Event Notifications

Respond with HTTP 200 OK within 5 seconds. Delivery failures include: invalid SSL, disallowed IP, any non-200 response, or timeout. Upon consistent failures, we may disable event delivery.

Retry Strategy

Upon failure, we retry after 30 seconds, then with exponential backoff for up to 5 retries (after 1, 2, 4, and 8 minutes). We may add jitter and temporarily throttle on high failure rates.

Event Types

Connection Events

Event NameDescription
connection.connectedA new connection between the partner and a patient is established.
connection.updatedThe attributes of a connection are updated.
connection.disconnectedA connection is fully terminated. Partner loses access to patient records.

Record Events

Event NameDescription
record.addedNew medical records are added to a connection.

The connection.connected Event

{
  "type": "connection.connected",
  "timestamp": "2025-01-24T10:30:00Z",
  "id": "b7b96067-691c-4e3a-b50f-762edd11f1b2",
  "patient_id": "dd27837a-ba7f-4e28-b042-ba0dc00addac",
  "patient": {
    "id": "dd27837a-ba7f-4e28-b042-ba0dc00addac",
    "first_name": "Floyd", "last_name": "Perkins",
    "gender": "Male", "date_of_birth": "1976-05-12",
    "email": "pfloyd@email.com", "mobile_phone": "+15551234567",
    "address": { "street1": "123 Elm St.", "city": "Springfield", "state": "IL", "zip": "12345" }
  },
  "permissions": ["records:read", "records:add"],
  "portal_link": "https://adminportal.app.allclearid.com/...",
  "promo_code": "PROMO2025"
}

Without records:read, the patient object is omitted and only patient_id, permissions, portal_link, and promo_code are returned.

The connection.updated event has the same structure. The connection.disconnected event omits patient and permissions.

The record.added Event

{
  "type": "record.added",
  "timestamp": "2025-01-24T10:30:00Z",
  "id": "fa032c9c-6e4b-4090-a719-cb49de0a5ebc",
  "patient_id": "9a8b419b-816e-4ae6-82f4-802f7c206fdb",
  "records": [
    {
      "id": "fa032c9c-6e4b-4090-a719-cb49de0a5ebc",
      "portal_link": "https://adminportal.app.allclearid.com/..."
    }
  ]
}

Patient API

Allows partners to fetch demographic and insurance information about connected patients.

GET /patients/{id}
Authorization: Bearer <Client Access Token>
{
  "id": "60389406-7863-428d-9831-cd5fa1e79e64",
  "first_name": "Floyd", "last_name": "Perkins",
  "gender": "Male", "date_of_birth": "1976-05-12",
  "email": "pfloyd@email.com", "mobile_phone": "+15551234567",
  "address": { "street1": "123 Elm St.", "city": "Springfield", "state": "IL", "zip": "12345" },
  "primary_insurance": {
    "health_insurance_provider": "BlueCross BlueShield of Texas",
    "member_id_number": "TC001001", "group_number": "123456789",
    "member_name": "Floyd Perkins", "insurance_plans": ["Blue Edge PPO"]
  }
}

Patient Records API

Allows partners to list and download health records for connected patients.

List All Records

GET /patients/{patient.id}/records
Authorization: Bearer <Client Access Token>
[
  { "id": "b44a4e8e-...", "file_name": "AUSTIN REGIONAL CLINIC_09-08-2025.pdf", "file_type": "pdf" },
  { "id": "a12b3c4d-...", "file_name": "LAB_RESULTS_09-10-2025.pdf", "file_type": "pdf" }
]

Get a Specific Record

GET /patients/{patient.id}/records/{record.id}
Authorization: Bearer <Client Access Token>
{
  "id": "b44a4e8e-dc25-4f1c-9bfc-c2c8f68cc34f",
  "file_name": "AUSTIN REGIONAL CLINIC_09-08-2025.pdf",
  "file_type": "pdf",
  "download": {
    "url": "https://storage.googleapis.com/healthid-medical-records-dev/...",
    "expires_at": "2025-09-08T13:38:25.419Z"
  }
}

The download.url already includes authorization — no extra authorization needed. Valid until download.expires_at.


Additional Security Requirements For Production Tenants

mTLS (Mutual TLS) with Certificate Key Pinning

You must authenticate using mutual TLS (mTLS). Your client must provide a valid certificate signed by a trusted CA. We enforce certificate key pinning and will only accept requests with a certificate containing a public key associated with your client ID.

Certificate Key Pinning for Notification Endpoint

We enforce certificate key pinning for your notification endpoint. We will only send event notifications to endpoints which present certificates containing a key associated with your client ID.

Certificate Key Pinning Mechanics

  • You can renew or replace your TLS certificate at any time without coordination, as long as the public key remains the same.
  • To rotate your key, send us the new public key first so we can pin it alongside the existing one before removing the old key.

Static IPs

  • Incoming Requests: We will only accept requests from predefined static IP addresses.
  • Outgoing Requests (Events API only): We will only send event notifications to predefined IPs you have registered.

Access & Configuration

To start using the Partner APIs, provide configuration details and cryptographic keys in a structured JSON format.

Required Configuration Parameters

NameTypeRequiredDescription
client_idstringAlwaysUnique identifier. Must start with prod- (production) or sandbox- (non-production).
outbound.endpoints[].urlstring (uri)Events APIHTTPS URL for event notifications.
outbound.endpoints[].allowed_ipsarrayProduction onlyAllowed IPs the endpoint domain may resolve to.
outbound.endpoints[].tls_public_keysarray (base64)Production onlyBase64-encoded DER public key from your server certificate.
inbound.jwt_sig_keysJWKSAlwaysJWKS containing your JWT public keys. RSA keys must be at least 3072 bits.
inbound.allowed_ipsarrayProduction onlyIPs from which you will send API requests.
inbound.mtls_client_keysarray (base64)Production onlyBase64-encoded DER public key from your mTLS client certificate.

How to Create Private Keys

openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:3072

How to Extract Public Keys

TLS Public Key

openssl x509 -in your_server_cert.pem -pubkey -noout | openssl rsa -pubin -outform DER | base64

mTLS Client Certificate

openssl x509 -in your_mtls_client_cert.pem -pubkey -noout | openssl rsa -pubin -outform DER | base64

JWT Signing Key → JWKS

import { createPublicKey } from "crypto";
import fs from "fs";
const pemKey = fs.readFileSync("privateKey.pem", "utf8");
const publicKey = createPublicKey(pemKey);
const jwk = publicKey.export({ format: "jwk" });
jwk.kid = '<clientid>-sig-rs256-20250820';
jwk.alg = 'RS256';
jwk.use = 'sig';
console.log(JSON.stringify({ keys: [jwk] }, null, 2));

JSON Configuration Example

{
  "client_id": "prod-spacex",
  "outbound": {
    "endpoints": [{
      "url": "https://api.spacex.com/webhook",
      "allowed_ips": ["192.168.100.1"],
      "tls_public_keys": ["MIIBIjAN..."]
    }]
  },
  "inbound": {
    "allowed_ips": ["203.0.113.10"],
    "mtls_client_keys": ["MIIBIjAN..."],
    "jwt_sig_keys": {
      "keys": [{
        "kty": "RSA", "alg": "RS256", "use": "sig",
        "kid": "prod_spacex-sig-rs256-20250212",
        "n": "sXW2Lk5z...", "e": "AQAB"
      }]
    }
  }
}

If you are not using the Events API, omit the outbound section entirely.

Final Checklist Before Submission

  • TLS Public Key → outbound.endpoints[].tls_public_keys (Events API only)
  • mTLS Client Key → inbound.mtls_client_keys
  • JWT Signing Key (JWKS) → inbound.jwt_sig_keys
  • Keys are in correct format: Base64 DER for TLS & mTLS; JWKS for JWT key

Send the JSON file via Slack or email to our integration team.


Need Help?

If you run into any issues, we’ll treat it as our top priority. Message us on Slack or email. We’ll jump in quickly to keep you moving.

Ready to build for real users?

The free tier is for development and testing only. To deploy production applications,
access patient data beyond your own, or unlock the full Partner API —
you need a commercial agreement.


Contact us about a commercial license