Ultimate Guide to API Compliance in Healthcare

HIPAA/GDPR checklist for healthcare APIs: map PHI flows, enforce OAuth/TLS/encryption, test controls, and keep audit evidence.
19
September 30, 2026
George Kramb
Nurse using patient engagement software to support an older patient and caregiver with compassionate, HIPAA-compliant care.
Ready to Transform Your Patient Engagement?
Experience how our real-time mentorship platform can deliver measurable ROI for your brand.
Book a Demo

Key Takeaways

HIPAA/GDPR checklist for healthcare APIs: map PHI flows, enforce OAuth/TLS/encryption, test controls, and keep audit evidence.

Author

George Kramb
George Kramb

Co-Founder and CEO of PatientPartner, a health technology platform that is creating a new type of patient experience for those going through surgery

Back to Blog

If your healthcare API touches PHI, it falls under the same rules as the rest of your stack. That means I need to treat the API, logs, tokens, vendors, backups, and test systems as part of the same compliance scope.

Here’s the short version:

  • First, I figure out which rules apply: HIPAA, GDPR, and state health privacy laws can all matter at once.
  • Then, I map PHI flow end to end: requests, responses, logs, webhooks, queues, backups, and third parties.
  • Next, I lock down access: OAuth 2.0, OIDC, SMART on FHIR, least-privilege scopes, MFA, TLS, and encryption at rest.
  • After that, I test the controls: threat modeling, code review, pen tests, access reviews, and negative authorization tests.
  • Then, I watch and keep proof: audit logs, alerts, incident playbooks, vendor reviews, and dated evidence of fixes.

A few facts shape the whole topic:

  • HIPAA breach notice to the covered entity by a business associate can be due within 60 calendar days after discovery.
  • GDPR breach notice to a supervisory authority can be due within 72 hours.
  • HIPAA applies to PHI in any form, not just in an EHR.
  • A cloud provider handling ePHI may still be a business associate, even if the data is encrypted.

The main point is simple: compliance is not a badge I get once. It is a repeatable process of identifying scope, applying controls, testing them, and keeping records that show what I did.

Before getting into the details, I’d read this guide as a five-part checklist: identify, map, control, validate, and monitor.

Mastering HIPAA Compliance in Healthcare Apps: Top 5 Developer Questions Answered

Which Rules Apply: HIPAA, GDPR, and U.S. State Privacy Laws

HIPAA vs GDPR vs U.S. State Health Privacy Laws: Key Differences at a Glance

HIPAA vs GDPR vs U.S. State Health Privacy Laws: Key Differences at a Glance

Before you choose a single technical control, figure out which laws apply to your API. That comes down to facts, not guesswork. Your role, the kind of data your API handles, where users live, and how vendors are involved all affect your legal duties.

Start with a written applicability assessment. Ask a few basic questions:

  • Is your organization a covered entity, a business associate, or a subcontractor?
  • Does the API create, receive, maintain, or transmit PHI?
  • Are any users located in the European Economic Area or in states with consumer health data laws?
  • Do vendors or cloud providers touch that data on your behalf?

Those answers shape everything that comes next. This is the Identify step in the compliance model. It tells you which controls belong in the next phase.

HIPAA Requirements for Covered Entities, Business Associates, and Subcontractors

HIPAA compliance for APIs falls into three rule sets. The Privacy Rule covers permitted uses and disclosures of PHI, individual rights, and minimum-necessary practices. The Security Rule requires administrative, physical, and technical safeguards for ePHI. The Breach Notification Rule applies when unsecured PHI is accessed, acquired, used, or disclosed in a way that counts as a breach.

Vendors that support your stack are not automatically outside HIPAA. HHS says that a cloud service provider that creates, receives, maintains, or transmits ePHI on behalf of a covered entity or business associate is a business associate - even when the data is encrypted and the provider cannot decrypt it. In plain terms, API gateways, cloud hosts, analytics tools, messaging services, and integration partners may need a Business Associate Agreement (BAA) before they handle PHI.

A BAA must spell out permitted uses, safeguards, breach reporting, subcontractor duties, and what happens to PHI when the relationship ends. If you use a cloud service to process or store ePHI without a BAA, that violates HIPAA. Business associates also have direct liability. They can be held responsible for failing to protect ePHI, failing to report breaches, and other violations.

Breach timing matters too. A business associate must notify the covered entity of a breach of unsecured PHI without unreasonable delay and no later than 60 calendar days after discovery. In practice, many contracts set shorter internal deadlines so the covered entity has time to meet its own notice duties.

Once you know the role and the rule set, map each PHI flow to the safeguard it needs.

GDPR can apply if your API serves people in the European Economic Area or monitors their behavior there. Under GDPR, health data is special-category personal data. Processing it needs both a lawful basis and an Article 9 condition. Consent by itself is often not enough.

For API design, that affects more than just privacy notices. It means data minimization, purpose-limited authorization, retention schedules, deletion workflows, and support for access, correction, portability, and objection rights. Deletion is not always immediate. Legal retention duties or patient-safety needs may allow continued retention, but those exceptions should be written down and justified.

For high-risk processing, a Data Protection Impact Assessment (DPIA) may be required. Cross-border transfers from the EEA also need a valid transfer mechanism, most often Standard Contractual Clauses, plus an assessment of destination-country protections and any onward transfers.

U.S. state laws can add duties that HIPAA does not cover. Washington's My Health My Data Act, for example, reaches personal health data outside HIPAA's scope and generally applies to businesses doing business in Washington or offering products or services there that collect, process, share, or sell consumer health data. State rules also differ on consent, geofencing limits, private rights of action, and breach notice deadlines. That's why a jurisdiction matrix is not just nice to have - it keeps teams from missing state-level rules.

Regulation Comparison Table: Scope, Protected Data, Rights, and Breach Duties

The comparison below shows where these regimes differ on scope, rights, and breach duties.

The table below is a high-level planning aid only. It does not constitute legal advice. Applicability depends on your specific facts, contracts, jurisdictions, and exemptions. Consult qualified legal and privacy counsel to confirm your obligations.

Dimension HIPAA GDPR U.S. State Laws (e.g., WA My Health My Data)
Scope Covered entities and their business associates and subcontractors Any organization processing personal data of EEA individuals in connection with offering services or monitoring behavior Varies by state; often covers businesses operating in-state or serving state residents, regardless of HIPAA status
Data PHI/ePHI: individually identifiable health information handled by covered entities, business associates, and subcontractors Personal data; health data is a special-category type of personal data Consumer health data, including inferred health information, location data, and wellness data outside HIPAA
Rights Limited rights for individuals Access, correction, portability, restriction, and objection where applicable Varies; often includes access, deletion, correction, and opt-out of targeted advertising or certain sales
Breach Business associate: notify covered entity within 60 days of discovery Notify supervisory authority within 72 hours; notify individuals without undue delay when high risk Varies by state; many have their own timelines and covered data definitions
Transfers No specific cross-border transfer framework; focus is on entity role and PHI handling Transfers outside EEA require adequacy decision, Standard Contractual Clauses, or other approved mechanism Generally domestic focus, but may apply to out-of-state businesses serving in-state residents

With the rules sorted out, the next move is to map each API data flow to the controls it requires.

How to Design Compliant Healthcare APIs

Compliant API design starts before code. If you don’t sort out data classification, authorization, and encryption early, audit scope grows fast and the work gets messy. Once you’ve mapped how PHI moves through your system, you can turn that map into concrete technical controls.

Classify PHI and Map Every API Data Flow

Don’t stop at endpoints and payloads. A full inventory should include endpoints, payloads, tokens, keys, logs, backups, queues, analytics, crash reports, APM payloads, staging databases, ML datasets, and third-party integrations that can expose PHI. HIPAA requires mechanisms that record and examine activity in systems containing or using ePHI, so this inventory becomes a central part of audit evidence.

After that, classify data at the field level, not just the endpoint level. Split it into identifiers, clinical data, billing data, auth data, consent data, operational metadata, or de-identified data. Then apply the minimum-necessary rule to every endpoint. That means documenting the business purpose, the permitted actor, the required fields, and the reason access is allowed. Don’t leave that work in policy docs alone. Enforce it with response filtering and field-level authorization.

Use a version-controlled data-flow and control matrix. Each row should record the source and destination systems, data elements transferred, identity and authorization scope, transport and storage protections, logging approach, retention period, third-party recipients, and how the control is tested. Update it any time an endpoint, schema, vendor, or logging destination changes.

Once the data map is done, set authentication and access rules for each flow. This is the Control step in the identify-map-control-validate-monitor framework.

Use OAuth 2.0, OpenID Connect, SMART on FHIR, Encryption, and Least Privilege

Use OAuth 2.0 for delegated access and OIDC for identity. For public clients, use Authorization Code + PKCE, exact redirect URIs, S256, state validation, and nonce checks. For confidential clients, use private-key JWT or mTLS. Don’t embed shared secrets in code. On every request, validate the issuer, audience, signature, expiration, not-before time, and scopes.

SMART on FHIR helps with interoperability, but it doesn’t handle compliance by itself. You still need identity proofing, consent, minimum-necessary access, logging, retention, vendor governance, and breach procedures.

For encryption, require modern TLS for every connection that carries PHI, including internal service-to-service traffic, webhooks, and admin interfaces. Encrypt databases, object storage, caches, message queues, and backups at rest with centrally managed keys. Store all secrets, including client credentials, signing keys, and webhook secrets, in a dedicated secrets-management system. Never put them in source code or CI logs. Keep access tokens short-lived, rotate refresh tokens, and revoke them when someone leaves the organization or loses a device.

Then narrow access as much as possible. Build a role-and-purpose model that separates patients, mentors, clinicians, care coordinators, support agents, administrators, partner applications, and background services. Give each identity access only to the resources, operations, fields, tenant, patient relationship, and time window needed for its task. Separate read and write permissions. Restrict bulk export. Require stronger authorization for sensitive actions. Deny access by default.

A mentor should see only assigned-patient data. A messaging service should see only delivery status. A reporting service should see only aggregated metrics. Require MFA for workforce and admin access, and use phishing-resistant methods where possible.

Security Control Comparison Table: Objective, Evidence, and Common Failure Points

The table below maps each core control to its security objective, implementation options, the evidence that shows it’s working, and the mistakes that most often weaken it.

This table is a practical reference, not a substitute for a formal risk analysis or legal review. Your specific controls should be selected based on your organization's risk assessment and documented as reasonable and appropriate for your environment.

Control Security Objective Implementation Options Evidence of Operation Common Failure Points
Authentication Establish the identity of users and clients OIDC, Authorization Code + PKCE, private-key JWT, MFA Token-validation tests, IdP logs, MFA enrollment records Password-only admin access, weak redirect-URI validation, accepting unsigned or incorrectly targeted tokens
Authorization Limit actions and records to approved purposes RBAC plus ABAC, SMART scopes, tenant and relationship checks, field filtering Policy tests, access reviews, denied-request logs Wildcard scopes, trusting client-supplied IDs, checking role but not patient or tenant relationship
Encryption Protect PHI and credentials in transit and at rest TLS, database and object-storage encryption, encrypted backups, mTLS TLS scans, key-management logs, configuration evidence, recovery tests Plaintext internal traffic, expired certificates, keys in source code, unencrypted exports
Secrets management Prevent credential and signing-key disclosure Managed vault, hardware-backed keys, private-key JWT, automated rotation Rotation history, access logs, secret inventory, compromise-response test Shared secrets, long-lived credentials, secrets in CI output or application logs
Session and token controls Limit replay, theft, and persistence Short-lived access tokens, refresh rotation, revocation, secure cookies, idle timeout Token-lifetime configuration, revocation tests, session-policy reviews Tokens in URLs or logs, no revocation, excessive lifetime, refresh-token reuse
API gateway enforcement Apply consistent edge protections Gateway or service mesh, schema validation, rate limiting, WAF, request-size limits Gateway policies, alert records, load tests, configuration reviews Bypassing the gateway via internal routes, inconsistent policies, no rate limits, overly detailed error messages

Gateway authorization alone isn’t enough. A valid token at the edge should not automatically open another patient’s record. Resource-level checks that verify object ownership and tenant boundaries on every request are what stop insecure direct object references. Pair gateway enforcement with application- and data-layer checks so a bypass in one layer doesn’t become a breach.

How to Operate APIs in a Compliant Way

Compliance at the API layer isn't a one-and-done task. It takes steady review: check logs, watch for odd behavior, test controls, and keep audit proof. This is the Monitor and Validate phase of the compliance model.

Audit Logging, Anomaly Monitoring, and Secure Evidence Retention

HIPAA requires mechanisms that record and examine activity in systems containing or using ePHI.

For API audit logs, the goal is simple: capture enough detail to reconstruct what happened without dumping sensitive data into the log stream. At a minimum, each record should include the timestamp in UTC, request ID or correlation ID, API route and method, the authenticated user or service identity, patient or tenant context with a pseudonymous identifier, the authorization decision, response status, record count or byte count, source IP and region, and the OAuth client ID.

Just as important, some data should not be logged. That includes names, full patient identifiers, access or refresh tokens, request or response bodies, diagnosis details, free-text notes, and raw FHIR resources. Use structured logs with field-level redaction. If you ever capture payloads for forensics, do it only for a documented investigation.

Treat logs like production data, because in many cases they are. Send them to a centralized platform with strict access controls, separate from production. Encrypt them in transit and at rest. Use immutable or append-only storage when it fits. Keep clocks in sync. Apply integrity checks or tamper-evident hashing. Limit administrator access, and where it fits, require dual approval before deletion. You also want alerts when logging gets disabled or when log volume drops without warning. If logs are exported during an investigation, maintain a documented chain of custody.

Monitoring needs context. A bulk export from an approved analytics service may be normal. The same export from a support user or a newly issued token should set off alarms. Risk-based thresholds work best when they're tuned to how your environment actually behaves.

Practical signals to watch include:

  • Excessive record downloads
  • Repeated failed authentication
  • Access from unexpected countries or regions, or outside normal hours
  • Sudden privilege or OAuth scope changes
  • Token reuse from multiple locations
  • Enumeration of patient identifiers
  • Unusual service-account behavior

Every alert should lead to a clear response path: identify the owner, preserve evidence, review authorization, revoke or limit tokens if needed, and document closure.

Testing, Risk Assessments, and Incident Response for API Environments

Every material release should be tested with threat modeling, dependency review, static and dynamic scanning, secret scanning, penetration testing, and negative authorization tests.

Negative tests matter a lot here. It's not enough to prove that access works for the right user. You also need to prove it fails for the wrong one. That means checking that a user can't pull another patient's record by changing an identifier, can't replay a revoked token, can't escalate scopes, and can't slip around tenant filters through an undocumented route.

For FHIR APIs, basic HTTP checks don't go far enough. You should validate resource profiles, required fields, terminology bindings, search behavior, SMART authorization flows, and error responses against the applicable implementation guide. A generic API security test may miss data-isolation issues that are very specific to FHIR.

Risk assessments should happen before production launch, at least once a year, and after any material change, such as a new data exchange, a new vendor, a new patient-facing feature, or a major vulnerability. HHS describes risk analysis as the first step in selecting reasonable and appropriate safeguards. Day-to-day signals should also drive review when needed, including new dependencies, failed controls, odd traffic, and vulnerability advisories.

Incident response playbooks need more than a PDF sitting in a folder. They need to be exercised. In API environments, that means planning for compromised tokens or credentials, unauthorized FHIR access, large data exports, exposed secrets, logging failure, and third-party integration compromise. Each playbook should spell out scope identification, containment, log preservation, eradication, restoration, and post-incident review.

Run tabletop exercises at least annually and after major changes. Track time to detect, contain, revoke access, and notify decision-makers. Those numbers show whether the playbook works in practice. They also help build the audit trail needed for review readiness.

Compliance Evidence Table: Control Owner, Proof, Review Cycle, and Remediation Path

Evidence should tie each control to a named owner, proof that the control exists, how often it's reviewed, the signal used to watch it, and what happens when something goes wrong. The table below gives teams a practical starting point for audits and internal reviews. Owners and review cycles should match your organization's risk profile and contract terms.

Control Control Owner Implementation Evidence Testing/Review Cycle Monitoring Signal Remediation Path
API inventory and PHI data-flow mapping API platform owner with privacy lead Approved inventory, data-flow diagrams, vendor register At launch, annually, and after material change Unknown endpoint, undocumented data store, new integration Assign owner, classify data, update diagrams, complete risk review before release
Authentication and authorization IAM owner and application owner OAuth/OIDC configuration, SMART scopes, role matrix, access-review records Continuous automated checks; formal review at least quarterly Failed logins, scope escalation, revoked-token use, privilege changes Revoke or rotate credentials, correct policy, investigate affected records, retest
Audit logging and log protection Security operations owner Logging configuration, sample events, retention settings, integrity controls Continuous collection; periodic control test and log-review records Logging gaps, volume anomaly, tamper alert, unreviewed queue Restore collection, preserve evidence, investigate gap, document risk decision
Anomaly detection and response Security operations center Detection rules, alert tickets, tuning history, response metrics Rule review monthly or quarterly; exercise at least annually Bulk downloads, geographic anomaly, token misuse, enumeration Triage, contain, tune rule, notify stakeholders, document closure
Vulnerability and dependency management Engineering security lead Scan reports, software bill of materials, patch records, exceptions Per build; critical findings reviewed immediately Known exploitable dependency, secret exposure, failed pipeline Patch or isolate, rotate secrets, retest, approve time-bound exception if needed
API and authorization testing QA or application security lead Threat models, test cases, penetration-test report, retest results Every material release; penetration test periodically and after major change Failed negative test, regression, unauthorized response Block release, fix, retest, approve only documented residual risk
FHIR and interoperability conformance Interoperability product owner Capability statement, validation output, conformance-test results Every version change and before production release Invalid resource, terminology mismatch, failed SMART flow Correct implementation, rerun validation, document version and result
Incident response readiness CISO or incident-response lead Playbooks, contact lists, tabletop records, after-action reports Tabletop at least annually; technical exercise after major change Missed escalation, slow containment, incomplete evidence Update playbook, assign corrective actions, retest within a defined deadline
Third-party and business-associate oversight Vendor-risk owner and procurement Contract or business-associate agreement, security assessment, SLA, incident terms Before onboarding and periodically based on risk Vendor control failure, breach notice, unexpected data flow Require corrective action, restrict access, suspend integration, reassess relationship
Backup, recovery, and availability controls Infrastructure or reliability owner Recovery objectives, restoration test results, failover records Scheduled recovery testing and after major architecture change Failed backup, restore error, service degradation Repair backup or failover, document impact, repeat test, update continuity plan

Evidence should demonstrate not only that a control exists, but that the organization reviews it and acts on findings. HHS audit materials review scope, threats, safeguards, and risk ratings.

Time-stamp every piece of evidence. Limit who can access or delete it. Keep it for the period set in your documented policy. An auditor should be able to follow a control from configuration to remediation proof and closure records, not just see that a tool was turned on. That operating evidence sets up the phased rollout in the next section.

Implementation Roadmap and Conclusion

From Inventory to Continuous Assurance: A Phased Rollout Plan

These controls only matter if they’re built into launch and change management. If your APIs are scattered, and your process lives in people’s heads, compliance won’t hold up under scrutiny. A defensible program needs a clear path from discovery to day-to-day operation.

Use this loop: Discover → Classify → Assess → Design → Build → Validate → Deploy → Maintain.

Start with a full inventory of every API, endpoint, data store, vendor, and integration. That includes shadow APIs that were never formally documented. From there, classify each field and each derived signal: PHI/ePHI, personal data, sensitive health data, operational metadata, or non-sensitive data. Once classification is done, perform a documented risk analysis that covers confidentiality, integrity, and availability, as required under the HIPAA Security Rule.

Those findings should shape the rules before development starts. That means defining data minimization, purpose limitation, consent rules, retention periods, tenant isolation, access controls, logging, and incident response requirements up front.

During build, put the approved controls in place and test them. Check for authorization failures, confirm tenant boundaries, verify consent withdrawal behavior, and make sure logging is complete. Before launch, require sign-off from security, privacy, legal, compliance, product, and business owners.

After launch, the work doesn’t stop. Reassess risks after material changes, review access and logs on a set schedule, rotate credentials, patch dependencies, and keep evidence that reviews were completed. If it isn’t documented, it’s hard to prove later.

Use this go-live checklist as evidence, not verbal confirmation:

Checklist Item What to Verify
Data inventory and flow map Current inventory, flow map, data dictionary, and owner
Regulatory assessment HIPAA, applicable state privacy laws, GDPR where relevant, contractual obligations, and cross-border transfers
BAAs and processor agreements Executed BAAs and processor agreements for regulated data vendors
Encryption TLS in transit, encryption at rest, and key-management responsibilities
OAuth 2.0 / SMART on FHIR Narrowly scoped tokens, secure redirect handling, expiration, refresh controls, and client authentication
Least privilege and tenant isolation Least-privilege roles, tenant isolation, administrator protections, service-account governance, and tested revocation
Consent enforcement Denial behavior tested for absent, expired, withdrawn, or out-of-scope consent
Audit logging Immutable or tamper-evident logs capturing actor, tenant, timestamp, endpoint, resource, action, authorization result, and correlation ID without unnecessary PHI
Security and abuse testing Completed security, privacy, performance, abuse, and interoperability testing, including broken object-level authorization and excessive data exposure tests
Retention, deletion, and backup Retention, archival, deletion, legal-hold, backup, and vendor-return procedures documented; deletion and restoration tested
Incident procedures Rehearsed runbook covering detection, containment, evidence preservation, escalation, notification, and remediation
Approval and rollback Signed approval record, risk acceptance for unresolved issues, monitoring dashboards, and rollback criteria

API Compliance Considerations for Patient Mentorship Programs

These controls matter just as much for patient mentorship workflows as they do for clinical integrations. For programs like PatientPartner, engagement data needs the same level of care as clinical data.

When APIs support mentor matching, treatment onboarding, or adherence tracking, they may handle patient identifiers, surgery or medication details, eligibility status, communications, and inferred sentiment signals. Once linked to an individual, that data can qualify as PHI or sensitive personal data.

For these integrations, compliance design should spell out the program’s purpose and the minimum data needed to support it. Responses should enforce the minimum-necessary rule on the server side. Access for patients, mentors, sponsors, and support staff should be split across separate tenants or security domains. Every enterprise user action should be auditable. Consent should be enforced as a stored and propagated policy decision. Retention and deletion rules should apply not only to records, but also to derived signals. BAA, processor, subcontractor, and incident-escalation duties should be assigned in writing.

Then verify those controls through documentation, contract review, testing evidence, and a clear responsibility matrix. That’s where intent turns into proof.

Key Takeaways for Healthcare API Compliance

Once the rollout is in place, the job becomes continuous proof. Four ideas run through the entire guide.

Determine applicability first. HIPAA, GDPR, state privacy laws, contracts, and organizational roles can all apply at the same time.

Map the data before anything else. Compliance depends on what each API receives, creates, maintains, transmits, derives, and shares. It does not depend on whether the API uses FHIR. FHIR is an interoperability standard, not a privacy or security framework.

Layer and enforce controls technically. Strong authentication, narrow scopes, least privilege, TLS, encryption at rest, tenant isolation, secure secrets, minimum-necessary responses, consent-aware decisions, and deletion workflows work together. None of them is a substitute for the others.

Validate continuously and preserve proof. Testing, access reviews, anomaly monitoring, incident exercises, and reassessments triggered by change should all produce evidence. That evidence should show what data moved, who accessed it, which control applied, when it was reviewed, and how exceptions were remediated.

FAQs

How do I know which healthcare privacy laws apply to my API?

Start by mapping your data flows and noting where your users live. HIPAA comes into play if your API creates, receives, maintains, or transmits PHI for U.S. patients. That includes production systems, staging environments, and backups.

GDPR applies when you process personal data from people in the European Union, even if your company is based in the U.S. Keep a record of processing activities that shows what data you collect, why you collect it, and where you store it.

Does using FHIR or SMART on FHIR make my API compliant?

No. Using FHIR and SMART on FHIR does not automatically make your API compliant.

They give you a framework for data exchange and authorization. But compliance comes from how you build, secure, and run the API inside your larger stack.

You still need measures like audit logging, FIPS-validated encryption for data at rest and in transit, role-based access controls, Business Associate Agreements, and meeting requirements such as data freshness and six-year audit log retention.

What evidence should I keep to prove API compliance?

Keep a complete audit trail that shows your technical setup and how you monitor it over time.

That means keeping immutable, encrypted audit logs for API events that involve PHI. You should also have proof that logs are reviewed on a regular basis, along with records of findings, follow-up actions, and any access changes.

Also keep:

  • a current API inventory and data flow diagrams
  • signed BAAs for vendors that handle PHI
  • evaluation records, incident reports, and compliance audit documentation

Related Blog Posts