Home / apex / health-cloud-apis
health-cloud-apis
Use this skill when working with Health Cloud APIs: querying healthcare-specific SObjects (CarePlan, ClinicalEncounter, HealthCondition) via the standard SObject API, calling the Health Cloud Business APIs under /connect/health, using the FHIR R4 Salesforce Healthcare API, handling FHIR bundle limits, and the authentication differences between those layers. NOT for choosing or enabling the clinical objects — use data/health-cloud-data-model. NOT for EHR integration design, CDS Hooks, or SMART on FHIR — use apex/fhir-integration-patterns.
Open the skill folder on GitHub
Health Cloud APIs
Use this skill when an integration reads or writes Health Cloud (now branded Agentforce Health) data and must pick the right API surface: the standard SObject API on the clinical data model, the Health Cloud Business APIs that wrap multi-step business logic, or the FHIR R4 Salesforce Healthcare API for interoperability. Generic REST API patterns for non-health objects belong to integration/rest-api-patterns.
Before Starting
Gather this context before working on anything in this domain:
- Confirm the FHIR-Aligned Clinical Data Model org preference is enabled in Setup > FHIR R4 Support Settings. Many clinical objects (AllergyIntolerance, ClinicalEncounter, and others) are unavailable until it is on.
- Identify the consumer: an internal integration that wants records (standard SObject API), a workflow that needs a business operation such as enrolling a patient or recording a medication statement (Business APIs), or an external FHIR client that needs FHIR R4 resources (Healthcare API).
- For the Healthcare API: confirm the org accepted the Industry APIs terms, holds the Salesforce Healthcare API SKU, and has an external client app with the OAuth custom scopes for each resource plus the
refresh_tokenscope. - Know the bundle limits before designing batch writes: up to 30 entries per Bundle call, of which up to 10 can be read or search requests, and only Bundle type
batchis supported.
Questions to Ask Before Configuring
| Question | Why it matters | What a good answer adds | What proper configuration adds over just doing it |
|---|---|---|---|
| "Does the consumer need FHIR R4 resources, Salesforce records, or a business operation?" | The three layers use different hosts, payloads, and auth | The API layer per use case | No FHIR plumbing where plain records would do, and no record-level code where a Business API already enforces the process |
| "Which FHIR resources, and read or write, per consumer?" | Each Healthcare API resource and method maps to its own custom scope, such as system_condition_read or user_carePlan_write | The exact custom scope list for the external client app | Least-privilege tokens instead of system_all_write everywhere |
| "Which region and environment hosts the org: US, EU, CA, or AU, production or sandbox?" | The Healthcare API domain differs per region, and sandboxes use the /sandBox/ path | The base URL per environment | Calls that reach the right data center on the first try |
| "How many records per run, and how many parallel callers?" | Bundles cap at 30 entries; Salesforce recommends at most five concurrent Healthcare API requests per org | A chunk size and a concurrency cap | A load that completes instead of failing under throttling |
| "Who owns code validity: does the source system send correct CPT, SNOMED, or LOINC codes?" | The Healthcare API does not do FHIR semantic (code set) validation | A named upstream owner for code quality | Clean clinical data instead of silently stored invalid codes |
| "Is the FHIR R4 data model already enabled, and which permission sets do integration and portal users hold?" | Objects are hidden until the org preference is on; Experience Cloud users need the FHIR R4 for Experience Cloud Sites permission set | A prerequisite checklist signed off before build | No late 404s or "not supported" errors in UAT |
What a proper configuration adds over "just calling the endpoint": each consumer uses the layer that fits it, tokens carry only the scopes their resources need, bundles are sized and retried by dependency, and code-set quality has an owner because the platform will not check it.
Core Concepts
Three API Layers
| Layer | Endpoint shape | Auth | Use for |
|---|---|---|---|
| Standard SObject API | https://{MyDomain}.my.salesforce.com/services/data/vXX.X/sobjects/HealthCondition/{id} and /query | Standard OAuth access token for the org | Internal integrations, reporting, bulk loads on clinical objects (API 51.0+ for objects such as HealthCondition and ClinicalEncounter) |
| Health Cloud Business APIs | https://{MyDomain}.my.salesforce.com/services/data/vXX.X/connect/health/..., for example /connect/health/clinical/patients/{patientId}/medication-statement | Standard OAuth access token; follows Connect REST API conventions | Business operations that touch several objects in one call (care program enrollment, medication statements, appointments, referrals); some also exist as Apex, such as HealthCloudGA.PatientService.createPatient |
| Salesforce Healthcare API (FHIR R4) | https://api.healthcloud.salesforce.com/{FHIR module}/fhir-r4/v1/{Resource}, for example .../clinical-summary/fhir-r4/v1/Condition; regional hosts eu., ca., au.; sandboxes add /sandBox/ after the host | External client app with OAuth custom scopes per resource, plus refresh_token | FHIR R4 interoperability with EHRs, payers, and other FHIR systems |
An earlier version of this skill placed the Healthcare API under /services/data/vXX.0/healthcare/fhir/R4/ on the org instance and required an OAuth scope named healthcare. Neither appears in the Salesforce Healthcare API guide; see