> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Epic OAuth 2.0 connector profile – StackOne setup guide

> Set up a connector profile using OAuth 2.0 for Epic in StackOne to allow users to link their accounts.

> [!WARNING]
>
> You need an Epic on FHIR developer account. Each health system must activate your client ID before its users can sign in.

## Register a Clinicians app

A Clinicians app lets each clinician sign in with their own Epic account. It must be a confidential client with a client secret.

**1. Create the app**

Sign in to [Epic on FHIR](https://fhir.epic.com) and open **Build Apps**.

<ul>
  <li>Click **Create**.</li>
  <li>**Application Name**: `StackOne`</li>
  <li>Select **Clinicians, Staff, or Administrative Users** as the user type.</li>
</ul>

**2. Set up OAuth 2.0**

The callback URL is where Epic returns each user after they sign in.

<ul>
  <li>Leave **Use OAuth 2.0** checked.</li>
  <li>**Endpoint URI**: the **Callback URL** from your Connector Profile</li>
  <li>**App FHIR Version**: **R4**</li>
</ul>

**3. Add the APIs**

Epic grants the app only the APIs you add, and health systems review the list before they activate the app.

<ul>
  <li>Check **Incoming API**.</li>
  <li>Under **Incoming APIs**, add each of these APIs:</li>
  <li>**Patient.Search (Demographics) (R4)**</li>
  <li>**Patient.Read (Demographics) (R4)**</li>
  <li>**AllergyIntolerance.Search (Patient Chart) (R4)**</li>
  <li>**AllergyIntolerance.Read (Patient Chart) (R4)**</li>
  <li>**Condition.Search (Problems) (R4)**</li>
  <li>**Condition.Read (Problems) (R4)**</li>
  <li>**Condition.Search (Encounter Diagnosis) (R4)**</li>
  <li>**Condition.Read (Encounter Diagnosis) (R4)**</li>
  <li>**Condition.Search (Health Concerns) (R4)**</li>
  <li>**Condition.Read (Health Concerns) (R4)**</li>
  <li>**Condition.Search (Medical History) (R4)**</li>
  <li>**Condition.Read (Medical History) (R4)**</li>
  <li>**MedicationRequest.Search (Signed Medication Order) (R4)**</li>
  <li>**MedicationRequest.Read (Signed Medication Order) (R4)**</li>
  <li>**MedicationAdministration.Search (R4)**</li>
  <li>**MedicationAdministration.Read (R4)**</li>
  <li>**Observation.Search (Labs) (R4)**</li>
  <li>**Observation.Read (Labs) (R4)**</li>
  <li>**Observation.Search (Vital Signs) (R4)**</li>
  <li>**Observation.Read (Vital Signs) (R4)**</li>
  <li>**Observation.Search (Social History) (R4)**</li>
  <li>**Observation.Read (Social History) (R4)**</li>
  <li>**Observation.Search (Flowsheets) (R4)**</li>
  <li>**Observation.Read (Flowsheets) (R4)**</li>
  <li>**DiagnosticReport.Search (Results) (R4)**</li>
  <li>**DiagnosticReport.Read (Results) (R4)**</li>
  <li>**Binary.Read (Labs) (R4)**</li>
  <li>**Binary.Read (Radiology Results) (R4)**</li>
  <li>**Procedure.Search (Orders) (R4)**</li>
  <li>**Procedure.Read (Orders) (R4)**</li>
  <li>**Procedure.Search (Surgeries) (R4)**</li>
  <li>**Procedure.Read (Surgeries) (R4)**</li>
  <li>**Immunization.Search (Patient Chart) (R4)**</li>
  <li>**Immunization.Read (Patient Chart) (R4)**</li>
  <li>**Encounter.Search (Patient Chart) (R4)**</li>
  <li>**Encounter.Read (Patient Chart) (R4)**</li>
  <li>**Appointment.Search (Appointments) (R4)**</li>
  <li>**Appointment.Read (Appointments) (R4)**</li>
  <li>**DocumentReference.Search (Clinical Notes) (R4)**</li>
  <li>**DocumentReference.Read (Clinical Notes) (R4)**</li>
  <li>**Binary.Read (Clinical Notes) (R4)**</li>
  <li>**ServiceRequest.Search (Orders) (R4)**</li>
  <li>**ServiceRequest.Read (Orders) (R4)**</li>
  <li>**Coverage.Search (Patient Insurance Information) (R4)**</li>
  <li>**Coverage.Read (Patient Insurance Information) (R4)**</li>
  <li>**Practitioner.Search (Organizational Directory) (R4)**</li>
  <li>**Practitioner.Read (Organizational Directory) (R4)**</li>
  <li>**CarePlan.Search (Longitudinal) (R4)**</li>
  <li>**CarePlan.Read (Longitudinal) (R4)**</li>
  <li>**CarePlan.Search (Encounter) (R4)**</li>
  <li>**CarePlan.Read (Encounter) (R4)**</li>
  <li>**CarePlan.Search (Outpatient) (R4)**</li>
  <li>**CarePlan.Read (Outpatient) (R4)**</li>
  <li>**CareTeam.Search (Longitudinal CareTeam) (R4)**</li>
  <li>**CareTeam.Read (Longitudinal CareTeam) (R4)**</li>
  <li>**Goal.Search (Patient) (R4)**</li>
  <li>**Goal.Read (Patient) (R4)**</li>
  <li>**Device.Search (Implants) (R4)**</li>
  <li>**Device.Read (Implants) (R4)**</li>
  <li>**FamilyMemberHistory.Search (R4)**</li>
  <li>**FamilyMemberHistory.Read (R4)**</li>
  <li>**ExplanationOfBenefit.Search (Claim) (R4)**</li>
  <li>**ExplanationOfBenefit.Read (Claim) (R4)**</li>
  <li>**QuestionnaireResponse.Search (Patient-Entered Questionnaires) (R4)**</li>
  <li>**QuestionnaireResponse.Read (Patient-Entered Questionnaires) (R4)**</li>
  <li>**AllergyIntolerance.Create (Patient Chart) (R4)**</li>
  <li>**Condition.Create (Problems) (R4)**</li>
  <li>**DocumentReference.Create (Clinical Notes) (R4)**</li>
  <li>**Observation.Create (Vital Signs) (R4)**</li>
  <li>**Observation.Create (Flowsheets) (R4)**</li>
  <li>**Patient.$match (Patient Match) (R4)</strong></li>   <li><strong>Patient.$summary (International Patient Summary) (R4)**</li>
  <li>**Appointment.$find (STU3)</strong></li>   <li><strong>Appointment.$book (STU3)**</li>
  <li>**Bulk Data Kick-off**</li>
  <li>**Bulk Data Status Request**</li>
  <li>**Bulk Data File Request**</li>
  <li>**Bulk Data Delete Request**</li>
</ul>

**4. Turn on the client secret**

Epic offers a client secret and persistent access only to confidential clients.

<ul>
  <li>Check the **Is this app a confidential client?** box.</li>
  <li>Generate a **Sandbox Client Secret**.</li>
  <li>Check **Requires Persistent Access**.</li>
  <li>Click **Save**.</li>
  <li>Note: Epic syncs a new app to its sandbox within about an hour.</li>
</ul>

**5. Set the app ready for production**

A health system can request the app only after you mark it ready for production. Epic's sandbox skips this step.

<ul>
  <li>On **Build Apps**, select the app.</li>
  <li>Check the box to accept the Terms and Conditions.</li>
  <li>Click **Save and Ready for Production**. Epic locks the API list from then on.</li>
  <li>Give the health system your **Production Client ID** so they can request the app.</li>
</ul>

**6. Activate the app for a health system**

Activate the app once the health system's request arrives.

<ul>
  <li>Click **Review and Manage Downloads** for the app.</li>
  <li>Select the environment type, non-production before production.</li>
  <li>Generate a client secret for that environment.</li>
  <li>Click **Activate**.</li>
</ul>

**7. Copy the credentials**

Use the client ID and client secret for the environment you are connecting.

<ul>
  <li>**Sandbox:** Copy the **Non-Production Client ID** and the **Sandbox Client Secret** into your Connector Profile.</li>
  <li>**Production:** Copy the **Production Client ID** and the client secret you generated for the health system into your Connector Profile.</li>
</ul>

## List the allowed hosts

Accounts linked under this profile can connect only to the FHIR hosts you list here. With no list, only Epic's sandbox is allowed.

<ul>
  <li>Find each health system's FHIR R4 base URL under **Production Endpoints** in [Epic's endpoint directory](https://open.epic.com/MyApps/Endpoints), or ask the health system's Epic team.</li>
  <li>Format: host names separated by commas, with no `https://` and no path.</li>
  <li>Example: the base URL `https://fhir.example-health.org/FHIR/api/FHIR/R4` gives the host `fhir.example-health.org`; two health systems give `fhir.example-health.org, epicproxy.et0927.epichosted.com`.</li>
  <li>Copy the **Allowed FHIR Hosts** into your Connector Profile.</li>
</ul>

## Create the StackOne Connector Profile

**1. Create a Connector Profile**

Enable the connector and create a Connector Profile in your project. See [Setup Connector Profile](https://docs.stackone.com/gateway/quickstart.md#setup-connector-profile).

**2. Link an Account**

Once the Connector Profile is created, continue to [link an account](https://docs.stackone.com/connectors/epic/guides/link-account/oauth-2-0.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.