Sphere EHR

API Documentation

Public technical documentation for the Sphere EHR standardized API for patient and population services under 45 CFR 170.315(g)(10).

Supported Standards

FHIR
HL7 FHIR R4 4.0.1
USCDI
USCDI v3
US Core
US Core 6.1.0
SMART
SMART App Launch 2.2.0
Bulk Data
HL7 FHIR Bulk Data Access 2.0.0
Security
TLS 1.2 or higher, OpenID Connect, OAuth 2.0, PKCE S256

Service Base URL

Production service base URLs are published at /services-base-url and /services-base-url.ndjson. Each listed Endpoint identifies the deployed FHIR R4 base URL used by SMART, FHIR read/search, and Bulk Data operations.

API Syntax and Function Names

Function namesAPI syntaxReturn variables and structures
SMART discoveryGET /.well-known/smart-configurationJSON authorization metadata including issuer, endpoints, capabilities, and scopes_supported.
FHIR CapabilityStatementGET /metadata and GET /fhir/r4/metadataFHIR R4 CapabilityStatement with US Core 6.1.0 resource support.
FHIR readGET /fhir/r4/{resourceType}/{id}FHIR R4 resource or OperationOutcome.
FHIR searchGET /fhir/r4/{resourceType}?{searchParameters}FHIR R4 searchset Bundle or OperationOutcome.
Patient compartmentGET /fhir/r4/Patient/{id}/$everythingFHIR R4 Bundle containing USCDI v3 data available to the authorized app.
Bulk Data exportGET /Patient/$export and GET /Group/{groupId}/$export202 Accepted with Content-Location for status polling, then NDJSON file URLs.
Service base URL listGET /services-base-url and GET /services-base-url.ndjsonOrganization and Endpoint resources identifying deployed FHIR service base URLs.

Required and Optional Parameters

AreaRequired parameters and data typesOptional parameters and data types
OAuth authorizationresponse_type, client_id, redirect_uri, scope, state, audlaunch, code_challenge, code_challenge_method, prompt
OAuth tokengrant_type, client_id, code or refresh_token as applicableredirect_uri, code_verifier, client_assertion, client_assertion_type, scope
FHIR readresourceType, id, Authorization bearer token_format
FHIR searchresourceType, Authorization bearer token_id, patient, category, code, date, _lastUpdated, _include, _revinclude, _sort, _count
Bulk DataAuthorization bearer token with system or patient export scope_type, _since, _outputFormat, patient, includeAssociatedData

Authorization Server

Applications register with the authorization server through the app registration workflow. Public native and browser applications use PKCE S256. Confidential applications and backend service clients use registered credentials or signed client assertions. The SMART discovery document publishes the authorization endpoint, token endpoint, JWKS URL, supported capabilities, supported scopes, and token revocation endpoint.

Refresh token support is available for offline_access. Native applications capable of securing a refresh token receive refresh tokens valid for at least three months, subject to revocation and rotation. Access tokens expire after 3600 seconds. Token revocation takes effect immediately; revoking an access token also revokes bound refresh tokens for the same client and subject.

USCDI to FHIR Traceability

The API exposes USCDI v3 data using US Core 6.1.0 profiles and FHIR R4 resources. Resource-specific SMART scopes use patient/{Resource}.rs, patient/{Resource}.read, and applicable system/{Resource}.rs or system/{Resource}.read forms.

AllergyIntoleranceCarePlanCareTeamConditionCoverageDeviceDiagnosticReportDocumentReferenceEncounterGoalImmunizationLocationMedicationMedicationDispenseMedicationRequestObservationOrganizationPatientPractitionerPractitionerRoleProcedureQuestionnaireResponseRelatedPersonServiceRequestSpecimen

Exceptions and Exception Handling Methods

ReturnException handling method
400 invalid_requestMalformed OAuth, FHIR, or Bulk Data request.
401 invalid_tokenMissing, expired, revoked, or invalid bearer token.
403 insufficient_scopeToken does not authorize the requested resource, patient, or operation.
404 not_foundResource, patient, group, export job, or file was not found.
429 too_many_requestsClient exceeded the configured rate limit.
500 server_errorUnexpected server condition; response omits PHI and secret values.

Mandatory Software Components

Mandatory Software Configurations

Terms and Conditions

Third-party app developers may register and test the standardized API at no additional fee. Customer subscription, implementation, Direct messaging, and e-prescribing cost disclosures are published on the Certification disclosure page. API use remains subject to the customer agreement, Business Associate Agreement when PHI is exchanged, privacy controls, and security controls.

Reference Links