ChartVoyant Developers
Markdown

Core Guides

Authentication & credentials

ChartVoyant never shares one catch-all credential across unrelated trust boundaries. Each surface uses a purpose-built token bound to a single practice (and, where applicable, a single patient or HL7 interface).

Credential comparison matrix

CredentialPrefix / TypeAccepted OnLifetimeHow Issued
Practice API keyBearer cvk_…REST API, Practice MCP, REST C-CDA14d (sandbox) · 90d default / 365d max (prod)Self-serve sandbox modal, or ChartVoyant onboarding
Patient MCP keyBearer cvpk_… or URL segmentPatient MCP only30, 90, 180, or 365 daysCreated by the patient in Portal → Account → AI assistants or /mcp-self-register/
HL7 sender keyBearer cvk_… (ingest-only)One bound HL7 v2 interfacePer interface termIssued during HL7 interface setup
SMART user/patient tokenOpaque OAuth 2 BearerFHIR R4, SMART Write3,600s read (300s with write scope); 95d offline refreshauth.chartvoyant.com Authorization Code + PKCE S256
SMART backend tokenOpaque OAuth 2 BearerFHIR R4, Bulk Data, HL7 (with system/hl7v2-ingest)3,600s read (300s write); no refresh tokenclient_credentials + private_key_jwt (RS384 or ES384)

Practice API keys (cvk_)

Send the key on every request as Authorization: Bearer cvk_… over HTTPS. Every key resolves to a single tenant — there is no header or query parameter that switches practices. Keys carry either read_only (safe HTTP methods + read-only MCP tools) or full (reads + permitted writes).

Patient MCP keys (cvpk_)

Created exclusively by the patient after re-entering their portal password. Accepted only on POST https://chartvoyant.com/api/v1/portal/mcp (via Authorization: Bearer) or POST https://chartvoyant.com/api/v1/portal/mcp/{key} for URL-only connectors. Always read-only and scoped to that single patient's portal-visible chart.

SMART App Launch OAuth 2 & PKCE

Interactive patient, clinician, and EHR launches discover endpoints from https://fhir.chartvoyant.com/r4/{practice}/.well-known/smart-configuration. Every authorization code flow requires:

  • code_challenge_method=S256 (plain or missing PKCE is rejected)
  • aud matching the exact FHIR base URL from the Practice Endpoint Directory
  • Exact registered redirect_uri (HTTPS, or localhost / 127.0.0.1 loopback for native apps)

See SMART App Launch 2 and the SMART on FHIR-4 developer guide for complete browser PKCE code.

SMART Backend Services (private_key_jwt)

Headless system integrations authenticate to POST https://auth.chartvoyant.com/oauth/token using grant_type=client_credentials and client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer signed with RS384 or ES384 against your registered public JWKS. Assertions expire within 5 minutes and require a unique jti. See SMART Backend Services.

HL7 v2 interface credentials

Each HL7 v2 interface accepts only the single credential bound to its interfaceId: either a dedicated HL7 sender key (Bearer cvk_… with ingest-only permission) or a SMART Backend Services token carrying scope=system/hl7v2-ingest. Ordinary REST API keys and sandbox keys are rejected with 401.

Credential security rules

  • TLS 1.2+ everywhere. Plain HTTP is never served on any ChartVoyant host.
  • Quote prefixes, never secrets. When contacting support, share only the 12-character key prefix (for example a1b2c3d4e5f6) and correlationId.
  • Keep keys out of client bundles and chat transcripts. Never ship a cvk_ key in browser JS, mobile binaries, git repositories, CI logs, or AI chat prompts.
  • Immediate rotation & revocation. Report any suspected leak to info@chartvoyant.com within 24 hours; revocation takes effect on the next request.