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"
}
| Field | Required | Type | Format | Description |
|---|
htu | Yes | string | base64url (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. |
htm | Yes | string | base64url (SHA-256) | Base64url-encoded SHA-256 hash of the HTTP method in uppercase (e.g., GET, POST). |
iss | Yes | string | Max 256 chars | Issuer of the JWT. Must be the client ID of the requesting partner. |
aud | Yes | string | Fixed: “partner.allclearid.com” | Audience claim. Must always be “partner.allclearid.com”. |
iat | Yes | integer | int64 (Unix timestamp) | Issued at timestamp. |
nbf | Yes | integer | int64 (Unix timestamp) | Not before timestamp. Minimum: 5 min before iat. |
exp | Yes | integer | int64 (Unix timestamp) | Expiration timestamp. Maximum: 5 min after iat. |
jti | Yes | string | uuid | Unique 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"
}
| Field | Type | Format | Description |
|---|
typ | string | Fixed: “JWT” | Token type. Always “JWT”. |
alg | string | RFC 7518 | Signing algorithm. Default “RS256” unless agreed otherwise. |
kid | string | Max 255 chars | ID 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
- Notification received — The partner’s public endpoint receives an HTTP request containing only the event type and event ID.
- Validate event notification — The notification is a signed JWT allowing the partner to verify it was sent by AllClear.
- De-duplicate event by event ID — Look up the event ID in a local list of already-processed events.
- Request full event data — Send an authenticated
GET /events/{id} request to fetch the full payload. - Full event data delivered — AllClear responds with the full event data as JSON.
- Process event — Process the event according to your business logic.
- Acknowledge with 200 OK — Return
200 OK within 5 seconds. - 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
- Validate the JWT header:
alg equals “RS256”; kid is AllClear’s signing key. - Verify the JWT signature with AllClear’s key identified by
kid. - 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
| Status | Description |
|---|
401 Unauthorized | Invalid or missing Client Access Token |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Unexpected 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 Name | Description |
|---|
connection.connected | A new connection between the partner and a patient is established. |
connection.updated | The attributes of a connection are updated. |
connection.disconnected | A connection is fully terminated. Partner loses access to patient records. |
Record Events
| Event Name | Description |
|---|
record.added | New 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
| Name | Type | Required | Description |
|---|
client_id | string | Always | Unique identifier. Must start with prod- (production) or sandbox- (non-production). |
outbound.endpoints[].url | string (uri) | Events API | HTTPS URL for event notifications. |
outbound.endpoints[].allowed_ips | array | Production only | Allowed IPs the endpoint domain may resolve to. |
outbound.endpoints[].tls_public_keys | array (base64) | Production only | Base64-encoded DER public key from your server certificate. |
inbound.jwt_sig_keys | JWKS | Always | JWKS containing your JWT public keys. RSA keys must be at least 3072 bits. |
inbound.allowed_ips | array | Production only | IPs from which you will send API requests. |
inbound.mtls_client_keys | array (base64) | Production only | Base64-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.