# Network

Source: https://www.flexpa.com/docs/network

## 3-in-1 network

Patient health records from everywhere, to anywhere, any time. Flexpa connects to every patient access network: medical record systems, health insurers, and national exchanges. No patient data left behind.

**Largest Coverage:** Proven connectivity across all three patient access networks.

**Three Network Types:** Medical record systems share clinical records, health insurers share claims, coverage and plan-held clinical data, and national exchanges support record discovery across facilities.

**Intelligent Routing:** Automatic selection of the best source with patient context.

*Image: Flexpa connects medical record systems, health insurers, and national exchanges*

### Network types

Flexpa connects to three patient access networks.

Health insurers
Claims data via CMS-9115

Network:
CMS-9115 federally mandated APIs and proprietary patient portals

Best for:
Longitudinal health & financial data

Medical record systems
Clinical records via ONC (g)(10)

Network:
ONC (g)(10) federally mandated APIs with separate authorizations per facility

Best for:
Targeted facility access

Nationwide exchanges
Longitudinal history via TEFCA IAS

Network:
TEFCA IAS with single authorization discovering records across all matching facilities

Best for:
Multi-facility provider data

#### How they compare
Each network is modular and can be initiated separately to support different needs at different lifecycles of a product or workflow.

|               | Health insurers (CMS-9115) | Medical record systems (ONC g10) | Nationwide exchanges (TEFCA IAS) |
|---------------|------------|---------------|-------|
| **Data source** | Health insurance payers | Healthcare providers' and facilities' EHR systems | TEFCA Network QHIN Participants. Flexpa is an IAS participant through two QHINs: Kno2 and CommonWell |
| **Flexpa Network coverage** | 95% of government program enrollment and 73% of commercial enrollment (November 2026). [See coverage by plan type.](https://www.flexpa.com/docs/network/directory) | Connected to 86 of 300 active ONC (g)(10) certified product listings, from 48 developers including Epic, Oracle Health (Cerner), and athenahealth (November 2026). [See the CHPL directory.](https://www.flexpa.com/docs/network/chpl) | 88,000+ facilities reached in production. [See nationwide exchanges for details.](https://www.flexpa.com/docs/network#nationwide-exchanges) |
| **Best for** | Fastest, highest signal, longitudinal health overview. | Supplying additional information on an as-needed basis for a particular facility | A single authorization to get clinical data from multiple facilities |
| **Patient authorization mechanism** | Insurance portal login | Patient portal login | Identity verification process (via CLEAR, ID.me, or Persona) |
| **Has insurance coverage information?** | Yes | No | No |
| **Has financial adjudication?** | Yes | No | No |
| **Has clinical details?** | Yes | Yes | Yes |
| **Has unstructured doctor's notes?** | Sometimes | Yes | Yes |
| **Has lab/imaging results?** | Sometimes | Yes | Yes |
| **Flexpa retrieval** | Starts within minutes of consent | Starts within minutes of consent | Starts within minutes of consent |
| **New records available at the source** | Within 24 hours of claims adjudication (typically ~5-30 days) | ~24 hours | ~24-72 hours |

#### Combining networks

All three networks work seamlessly together within the same Flexpa integration. You can retrieve data from multiple networks for the same patient, with each authorization providing access to a different network.

Data from all networks is accessible through the same FHIR API endpoints. On health insurer and medical record system connections, Flexpa sets `meta.source` from the source endpoint's address and the resource's ID at that source. Flexpa doesn't set `meta.source` on nationwide exchange resources, since they have no single source endpoint. Any value you see there was passed through from the upstream document, so don't rely on it to identify the network. To attribute data across all three networks, use the Flexpa [tags](https://www.flexpa.com/docs/records#tags) in `meta.tag`: `PatientAuthorizationId` identifies the connection the data came from, and `AuthorizationType` records how that connection was authorized. Records retrieved natively over nationwide exchange are `IAL2`. Records from a SMART on FHIR source are `OAUTH`, including Epic sites reached through a nationwide exchange consent.

**Common patterns:**

- **Health insurers + Medical record systems:** Use insurer data for longitudinal health history and financial information, supplement with medical record systems for detailed clinical documentation from specific facilities.
- **Nationwide exchanges + Medical record systems:** Use TEFCA for broad nationwide coverage, supplement with individual medical record systems for facilities not yet participating in TEFCA.
- **All three networks:** Maximum coverage by combining insurer claims, TEFCA nationwide provider records, and targeted individual medical record system connections.

---

## Health insurers

Health insurers provide claims data with the most comprehensive longitudinal view of a patient's health history. With a single authorization, patients can share both financial and clinical data spanning all their healthcare encounters across multiple providers and facilities.

### Overview

Flexpa connects to health insurers through two pathways:

1. **CMS-9115:** The CMS Interoperability and Patient Access Final Rule federally mandates all payers to provide Patient Access APIs that allow patients in Medicare, MA, and Medicaid lines of business to access their health data in a standardized FHIR format. This data includes both financial and clinical information.

2. **Patient portals:** Flexpa's proprietary patient portal integration unlocks access to the same data for employer-sponsored and off-exchange plans that are not required to have Patient Access APIs. This dramatically expands coverage beyond CMS-mandated endpoints.

Flexpa Consent automatically manages the logic for when to route patients to CMS-9115 or to patient portals, ensuring the best possible coverage and user experience.

*Image: Flexpa Network Sources - Payers*

#### Coverage by plan type

Flexpa's combined approach delivers industry-leading coverage across all major plan types:

---

### CMS-9115 data strengths

**Longitudinal financial data:** Claims provide detailed financial adjudication of all past encounters, including insurance coverage information and out-of-pocket costs. This is the only source for complete financial healthcare data.

**High-signal medications:** Unlike medical record systems that show what was prescribed, insurer data shows what medications were actually picked up from pharmacies, providing a more accurate picture of medication adherence.

**Cross-facility overview:** A single insurer authorization provides data across all doctors, facilities, and encounters covered under that insurance plan, eliminating the need for multiple facility-specific authorizations.

---
### Data particularities

#### Patient portal data limitations

Patient portal connections for commercial/employer plans have specific limitations:
- The following clinical data elements are not available for commercial/employer claims outside of CMS 9115-F
  - Diagnosis codes
  - Allergies
  - Limited or no unstructured clinical notes
  - Limited or no lab/imaging results
- Institutional claim sub-types (inpatient vs. outpatient) are not available, resulting in "unknown" values for fields like `subType.code`
  - Procedure codes are still accessible through `ExplanationOfBenefit.item.productOrService` which contains applicable CPT codes, even when institutional-specific procedure fields may be absent

#### Data masking and privacy

Some data may be marked as "masked" when a payer has determined the information is too sensitive to share. This typically occurs for:
- Substance use disorder treatment (protected under 42 CFR Part 2)
- Mental health services
- Other sensitive healthcare services covered by federal or state privacy regulations

When you see a data-absent reason of "masked," it indicates the payer has applied privacy protections to that specific data element.

Not every source masks sensitive data. Through patient access, patients receive almost everything in the source systems, so expect mental health and substance use records to arrive as a normal part of the data, inside ordinary resources like `Condition`, `Encounter`, and `MedicationRequest`. Flexpa does not filter sensitive data or apply any security labels to it. Any filtering happens at the source, including choices the patient makes there, such as which data categories to share when they sign in.

Security labels come directly from the source, and sources apply them rarely and inconsistently, so a record with no label, or a "normal" label, may still be sensitive.

#### Optional fields and missing data

FHIR defines many fields as optional, and payers don't always provide all available data elements. When a field is required by FHIR but the underlying data is unavailable, you'll see data-absent indicators such as:
- `"masked"` - Data exists but is privacy-protected
- `"unknown"` - Data is not available from the payer's system
- Field absence - The data element was not provided

These variations are normal and expected. Your application should be designed to handle missing or masked data gracefully, particularly when working with patient portal connections to commercial plans.

---

### Syncing dependents

Dependent syncing behavior varies by connection type:

#### CMS 9115-F
One authorization per plan member. During the authorization flow, the patient can choose which plan member to authorize (self or a dependent). To access multiple members' data, the patient must complete separate authorization flows for each member.

#### Patient portals
When the authorizing user is the subscriber or a delegate of the subscriber on the plan, the patient portal integration automatically syncs data for all dependents and creates separate Patient resources for each. When the dependent is the authorizing user, they only see their own information.

- **Subscriber or delegate login:** Retrieves data for all dependents on the plan
- **Dependent login:** Retrieves only that dependent's data

For patient portal authorizations with multiple dependents, use the `/fhir/Patient/$PATIENT_ID/$everything` endpoint to retrieve the records of all patients, rather than assuming a single patient per authorization. The related API differences are:

- **$everything operation:**
Returns the records of every patient in the authorization. See [aggregated operations](https://www.flexpa.com/docs/guides/patient-linking#aggregated-operations). Patient references may appear as contained resources rather than standalone Patient resources.

```bash
# Retrieve all data for all patients in an authorization
GET /fhir/Patient/$PATIENT_ID/$everything
```

- **$expunge operation:**
The `$expunge` operation respects the same authorization scheme with regards to the authorizing user and dependents.

```bash
# Expunge all data for a consent
POST /fhir/Group/$expunge
```

#### EHR proxy access (minor patients)

For clinical records, a parent or guardian can connect to a child's records through a provider EHR (such as Epic MyChart, Cerner, or athenahealth) using their own credentials, provided they have already been granted proxy or delegate access through that EHR's upstream process.

During the OAuth authorization step, the parent selects the child's chart. The resulting access token carries the child's FHIR patient ID, not the parent's. Each child requires a separate Flexpa authorization. There is no single authorization that returns both the parent's and child's records.

TEFCA is not a route for a parent to reach a child's records. IAL2 identity verification is completed by the patient whose records are requested, and there is no guardian or proxy path through it, so a parent cannot verify on a child's behalf.

**Age cutoffs**

Proxy access is time-limited and varies by EHR and jurisdiction. Epic has widely-deployed age-based cutoffs, though the exact ages are configured per organization and may vary. Cerner and athenahealth do not have platform-wide defaults; cutoffs are state-law and practice-configured.

**When proxy access is revoked**

Proxy revocation is not reflected in real-time against active access tokens. When Flexpa next attempts to refresh the token, the refresh fails and the sync falls back to the token loaded for that job, which may still be valid. If every FHIR request in the sync returns 401 with the recognized consent-revocation message, the PatientAuthorization transitions to a revoked state. For generic refresh failures without that signal, the authorization remains open and syncs continue to fail while the child's data goes stale.

Applications should treat repeated sync failures on a child's authorization as a signal to prompt the parent to re-verify proxy access with the EHR.

---

## Nationwide exchanges

Flexpa is an **Individual Access Services (IAS) Provider on TEFCA** (Trusted Exchange Framework and Common Agreement), enabling nationwide patient record discovery and clinical document retrieval across participating health information networks.

### Overview

TEFCA is the [national framework for health information exchange](https://www.healthit.gov/topic/interoperability/policy/trusted-exchange-framework-and-common-agreement-tefca) established by the 21st Century Cures Act. It enables nationwide patient record discovery across 88,000+ facilities through a network of Qualified Health Information Networks (QHINs).

Flexpa participates in TEFCA as an IAS provider through partnerships with Kno2 and CommonWell as our QHIN providers. We discover patient records nationwide, retrieve clinical documents, and wrap them in FHIR DocumentReference resources for seamless integration with your existing workflows.

#### QHINs and network connectivity

Flexpa uses Kno2 and CommonWell as our Qualified Health Information Network (QHIN) providers. Both QHINs connect across the TEFCA network, enabling nationwide patient record discovery and document retrieval.

*Image: Flexpa Network Sources - TEFCA*

**Note:**
TEFCA support is live. Contact [partnerships@flexpa.com](mailto:partnerships@flexpa.com) to enable TEFCA for your application.

---

### TEFCA strengths

**Superior patient experience:** TEFCA provides access to data from multiple facilities with a single authorization and identity verification. Patients complete one IAL2 identity verification (via CLEAR, ID.me, or Persona) and receive records from all matching facilities nationwide, eliminating the need for separate logins to each provider portal. Facilities that respond over a FHIR API that Flexpa supports, rather than over document exchange, are the exception: Flexpa Consent asks the patient to sign in to each of those, and each one becomes its own patient authorization on the same consent.

**Nationwide coverage:** TEFCA provides the broadest network for clinical data from medical record systems — Flexpa has matched patients at more than 88,000 distinct facilities in live production. This includes hospitals, clinics, imaging centers, and other care facilities across all 50 states.

**Comprehensive clinical documentation:** TEFCA returns complete C-CDA clinical documents including unstructured notes, detailed lab and imaging results, and the full clinical record maintained by each facility.

---

### Patient Identity Verification

When a patient initiates a TEFCA connection, they first verify their identity using an identity provider. This identity verification establishes their demographic information including name, date of birth, and address to ensure proper authentication and authorization for nationwide health information exchange. Flexpa then queries the TEFCA network using this verified information to find patient matches across participating facilities nationwide. When matches are found, clinical documents are retrieved from those facilities.

#### Supported credentials providers
Flexpa supports CLEAR, ID.me, and Persona as [IAL2-compliant identity providers](https://kantarainitiative.org/trust-framework/trustmark/). All three meet NIST Identity Assurance Level 2 requirements for TEFCA connections. The identity provider selection is randomized in the Flexpa Consent interface to prevent selection bias. By supporting multiple providers, Flexpa maximizes the chances that a patient has already completed identity verification with one of them.

For users with existing CLEAR, ID.me, or Persona accounts, verification typically takes less than a minute. First-time users creating new accounts should expect 3-7 minutes to complete the full identity verification process, which includes uploading a government-issued ID and completing identity checks. Initial identity verification is a one-time process.

A government-issued photo ID (such as a driver's license or passport) is required for all three providers — a Social Security Number alone does not satisfy IAL2 requirements. CLEAR, ID.me, and Persona each require physical document evidence plus a biometric selfie comparison as part of their IAL2-compliant verification process.

*Image: Flexpa Network Sources - TEFCA Identity Verification*

#### Use with Flexpa Consent SDK

When using TEFCA, Flexpa Consent displays a specialized consent screen that explains the TEFCA network and nationwide record access, shows which identity provider will be used for verification, requires explicit patient consent before proceeding, and references both your application's privacy policy and Flexpa's privacy policies.

Enable TEFCA by passing the `flexpa_ial2_mode` query parameter to the authorization endpoint. From a developer perspective, TEFCA uses the same integration as other data sources, with FHIR resources returned via the standard Flexpa API. See [CMS Aligned Networks](https://www.flexpa.com/docs/network/cms) for integration details and timeline.

The patient experience follows the standard flow:
1. **Choose TEFCA:** Patient selects TEFCA for provider data
2. **Consent:** Patient reviews and consents to nationwide record discovery
3. **Authorize:** Patient verifies identity via CLEAR, ID.me, or Persona
4. **Sync:** Flexpa discovers and retrieves records from matching facilities

First-time users will need to create an account with their chosen provider (typically 3-7 minutes), upload a government-issued ID, complete identity verification, and consent to record access.

---

### Data format

QHINs return clinical documents in [C-CDA](http://www.hl7.org/implement/standards/product_brief.cfm?product_id=492) (Consolidated Clinical Document Architecture) XML format.\* Flexpa wraps these documents as [FHIR R4 DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) resources and automatically [converts them into structured FHIR resources](https://www.flexpa.com/docs/network/cms#c-cda-to-fhir-transforms).

Supported document types include:
- [Continuity of Care Documents (CCD)](http://hl7.org/fhir/us/ccda/)
- [Discharge Summaries](http://hl7.org/fhir/us/ccda/)
- [Clinical Notes](http://hl7.org/fhir/us/ccda/)
- Other IHE XDS-b document types

\* Labcorp is the exception. Through CommonWell it responds with FHIR rather than C-CDA, so its attachment holds a FHIR Bundle of `Observation` and `DiagnosticReport` resources and no conversion applies. See [Lab results](#lab-results-quest-diagnostics-and-labcorp).

#### DocumentReference API

TEFCA documents are available as FHIR [DocumentReference](https://www.flexpa.com/docs/fhir/document-reference) resources through the standard Flexpa API endpoints. Each DocumentReference wraps a C-CDA document with metadata including the facility name (organization that created the document), author (provider who authored it), document type (LOINC-coded classification), creation date, and a unique persistent identifier.

The C-CDA document content is base64-encoded in the `content[0].attachment.data` field. Decode this field to access the full XML document for parsing or processing. Check `content[0].attachment.contentType` first: it is `text/xml` or `application/xml` for C-CDA, and `application/fhir+json` for the Labcorp Bundles described above.

TEFCA records are accessible through the same FHIR API endpoints as payer data. DocumentReference resources from TEFCA will be returned in standard `/fhir/DocumentReference` queries. The `custodian` field identifies the facility that created the document, allowing applications to distinguish between different data sources.

*Get Documents*

```bash
GET /fhir/DocumentReference
Authorization: Bearer {access_token}
```

```json
{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry": [{
    "resource": {
      "resourceType": "DocumentReference",
      "id": "doc-123",
      "status": "current",
      "type": {
        "coding": [{
          "system": "http://loinc.org",
          "code": "34133-9",
          "display": "Summarization of Episode Note"
        }]
      },
      "subject": {
        "reference": "Patient/patient-123"
      },
      "date": "2024-10-05T12:00:00-05:00",
      "author": [{
        "display": "Dr. John Smith"
      }],
      "custodian": {
        "display": "Flexpa Test Medical Center"
      },
      "content": [{
        "attachment": {
          "contentType": "text/xml",
          "data": "PD94bWwgdmVyc2lvbj0i..."
        }
      }]
    }
  }]
}
```

*Filter by Type*

```bash
GET /fhir/DocumentReference?type=http://loinc.org|34133-9
```

```bash
GET /fhir/DocumentReference?type=http://loinc.org|18842-5
```

*Decode Content*

```javascript
const documentData = entry.resource.content[0].attachment.data;
const ccda = atob(documentData); // Decode base64
// Parse XML or process as needed
```

#### Interoperability standards

Flexpa implements the [XCPD](https://profiles.ihe.net/ITI/TF/Volume1/ch-27.html) (Cross-Community Patient Discovery) [ITI-55](https://profiles.ihe.net/ITI/TF/Volume2/ITI-55.html) profile for patient matching and the [XCA](https://profiles.ihe.net/ITI/TF/Volume1/ch-18.html) (Cross-Community Access) [ITI-18](https://profiles.ihe.net/ITI/TF/Volume2/ITI-18.html) (Document Query) and [ITI-43](https://profiles.ihe.net/ITI/TF/Volume2/ITI-43.html) (Document Retrieve) profiles for document query and retrieval. Patient authentication uses [IAL2](https://pages.nist.gov/800-63-3/sp800-63a.html#sec4) OIDC-based identity verification with demographic claims, while document metadata follows the [IHE XDS-b](https://profiles.ihe.net/ITI/TF/Volume1/ch-10.html) standard.

#### When no records are found

When no patient matches are found across the TEFCA network, the API will return an empty result set. This can occur if the patient has never received care at TEFCA-participating facilities or if their demographic information doesn't match records in the network. In test mode, Flexpa-managed fixtures are always returned regardless of QHIN matches.

---

## Medical record systems

ONC (g)(10) federally mandated APIs provide direct access to individual provider and hospital EHR systems. These APIs enable patients to retrieve their clinical records from specific healthcare facilities where they've received care.

### Overview

The ONC Cures Act Final Rule requires healthcare providers to make patient data available through standardized FHIR APIs. Also known as the "Patient Access API" requirement for providers, ONC (g)(10) mandates that providers give patients API-based access to their electronic health information.

Flexpa connects to medical record systems from Epic, Oracle Health (Cerner), athenahealth, and other EHR developers: 86 of the 300 active ONC (g)(10) certified product listings, from 48 developers, as of November 2026. The [CHPL directory](https://www.flexpa.com/docs/network/chpl) shows Flexpa's status for every listing.

*Image: Flexpa Network Sources - Providers ONC(g)(10)*

---
### ONC (g)(10) strengths

**Facility-specific detail:** Medical record systems give access to the most complete clinical documentation for a specific facility, including comprehensive lab and imaging results, unstructured clinical notes, and the full care record maintained by that facility's EHR system.

**Direct from source:** Data comes directly from the facility's EHR system, providing the most current and detailed view of care delivered at that facility.

**Supplement insurer data:** Medical record systems are ideal for filling in clinical details that may be limited in insurer data, such as detailed lab results, imaging reports, and clinical notes from specific encounters.

---
### How it Works
When a patient initiates a provider connection through Flexpa Consent, they select a healthcare facility from available options. The patient is then redirected to their provider's patient portal where they authenticate using their existing portal credentials. After successful authentication, the patient authorizes your application to access their health records. Flexpa retrieves the authorized FHIR resources and makes them available through the standard Flexpa API endpoints.

#### Facility selection
You may specify an endpoint ID up front to pre-select a specific facility for the patient; otherwise, the patient searches for and selects their healthcare facility during the authorization flow. Endpoint IDs are UUID-format identifiers unique to each EHR system deployment. Look up endpoint IDs for your target healthcare organizations in the [Endpoint Directory](https://www.flexpa.com/docs/network/directory).

#### Use with Flexpa Consent SDK

Enable provider APIs by passing the `flexpa_ial2_mode` query parameter to the authorization endpoint. From a developer perspective, provider APIs use the same integration as other data sources, with FHIR resources returned via the standard Flexpa API. See [CMS Aligned Networks](https://www.flexpa.com/docs/network/cms) for integration details and timeline.

The patient experience follows the standard flow:
1. **Select:** Patient searches for and selects their healthcare facility
2. **Consent:** Patient reviews and consents to data sharing
3. **Authorize:** Patient verifies identity via CLEAR, ID.me, or Persona, then logs in to the facility's patient portal
4. **Sync:** Flexpa retrieves and standardizes the data

**Note:**
The exact configuration parameter for enabling provider APIs is being finalized. Check with your Flexpa account manager for the current implementation.

---
### Relation to TEFCA

[TEFCA](https://www.flexpa.com/docs/network/tefca) provides access to the same type of clinical data from medical record systems as individual ONC (g)(10) APIs, but with a superior patient experience. The key differences:

|  | TEFCA IAS | ONC (g)(10) |
|-------|-------|------------|
| **Coverage scope** | Single authorization for records from 88,000+ facilities nationwide | Direct connection to specific facility EHR systems |
| **Authorization** | One identity verification retrieves data from all matching facilities | Separate authorization required for each facility |
| **Patient discovery** | Nationwide patient discovery and matching across facilities | Patient must know which specific facility to connect to |

**When to use ONC (g)(10):** Use ONC (g)(10) when you need data from a specific facility, when the facility is not yet part of the TEFCA network, or when you want to supplement insurer data with detailed records from a known facility. In most cases, [TEFCA](https://www.flexpa.com/docs/network/tefca) is the preferred approach for medical record system data due to the dramatically improved patient experience. However, ONC (g)(10) remains valuable for accessing specific facilities or supplementing data from other sources.

---
### Lab results: Quest Diagnostics and Labcorp

The two national labs reach Flexpa over different networks, so the patient step differs. Both return discrete FHIR results.

|  | Quest Diagnostics | Labcorp |
|---|---|---|
| **Network** | Quest's patient-facing FHIR API, connected as a provider endpoint | [TEFCA](https://www.flexpa.com/docs/network/tefca) IAS |
| **Patient authorization** | Patient signs in to their Quest account | IAL2 identity verification with CLEAR, ID.me, or Persona |
| **Resources returned** | `Patient`, `Observation` (`laboratory` and `vital-signs` categories), and `DiagnosticReport` | `Patient`, `Observation`, and `DiagnosticReport` as native FHIR, delivered inside a `DocumentReference` whose attachment is `application/fhir+json` |
| **Where to read result values** | `Observation`. `DiagnosticReport` groups the results for an order | `Observation.valueQuantity`, with `referenceRange` and `interpretation`. `DiagnosticReport.result` groups the results for an order |

Patients find Quest by searching for Quest Diagnostics in Flexpa Consent. Its endpoint is listed in the [Endpoint Directory](https://www.flexpa.com/docs/network/directory). Flexpa doesn't connect to Labcorp directly. Labcorp results arrive through a TEFCA connection, which must be enabled for your application. See [How to share your Quest and Labcorp lab results](https://www.flexpa.com/blog/share-lab-results-quest-labcorp) for the patient steps.

---

## Network API

Explore organizations and endpoints across our payer and provider networks using the Network API. This API provides programmatic access to information about available data sources, their capabilities, and current status.

*Image: Flexpa API*

### Organizations

An organization is a payer, provider, or vendor entity that operates an Endpoint.

This API returns data also available in our [Endpoint Directory](https://www.flexpa.com/docs/network/directory).

Results are returned one page at a time. Read records from the `organizations` field and follow `meta.nextCursor` (passed back as `?cursor=`) until it is `null` — the same [cursor pagination](https://www.flexpa.com/docs/consent#list-consents) used by `GET /rest/consents`.

**Query parameters**

- `limit` (integer):
The maximum number of organizations to return in a single page. Defaults to `100`, with a maximum of `1000`.

- `cursor` (string):
An opaque token from a previous response's `meta.nextCursor`. Pass it to fetch the next page. Omit it to fetch the first page.

- `includeUnavailable` (boolean):
When set to `true`, includes organizations that are no longer available (for example, soft-deleted entries) in the results. Defaults to `false`.

**Response fields**

- `name` (string):
The `name` of the organization

- `id` (string):
The `id` that Flexpa uses to identify this organization

- `type` (string):
The `type` details whether the organization is a payer, a provider, a vendor, or another type of entity.

*Request*

```bash
curl https://api.flexpa.com/organizations \
  -H 'Content-Type: application/json'
```

```js
const response = await fetch("https://api.flexpa.com/organizations", {
  method: "GET",
  headers: {
    "content-type": "application/json",
  }
});

const response = await response.json();
```

```json
{
    "organizations": [
        {
            "name": "SCAN Health Plan",
            "id": "a4212073-f832-483c-8fd0-706f97fe3d8e",
            "type": "PAYER"
        },
        {
            "name": "Blue Cross and Blue Shield of North Carolina",
            "id": "12db2e9e-26f5-4ee6-b705-29ee9349f653",
            "type": "PAYER"
        },
        ...
    ],
    "meta": {
        "hasMore": true,
        "nextCursor": "YTQyMTIwNzMtZjgzMi00ODNjLThmZDAtNzA2Zjk3ZmUzZDhl"
    }
}
```

---

### Endpoints

Endpoints are individual FHIR REST API servers in Flexpa's network operated by organizations that make patient data available.

This API returns data also available on our [endpoint directory](https://www.flexpa.com/docs/network/directory).

Each endpoint has a logo at `https://cdn.flexpa.com/logos/{id}`, where `{id}` is the endpoint's `id`. Use the URL as the `src` of an image in your own search interface. Not every endpoint has a logo, so show a generic fallback icon when the image does not load.

Results are returned one page at a time. Read records from the `endpoints` field and follow `meta.nextCursor` (passed back as `?cursor=`) until it is `null` — the same [cursor pagination](https://www.flexpa.com/docs/consent#list-consents) used by `GET /rest/consents`.

**Query parameters**

- `limit` (integer):
The maximum number of endpoints to return in a single page. Defaults to `100`, with a maximum of `1000`.

- `cursor` (string):
An opaque token from a previous response's `meta.nextCursor`. Pass it to fetch the next page. Omit it to fetch the first page.

- `includeUnavailable` (boolean):
When set to `true`, includes endpoints that are not currently available (for example, those still in progress or not yet implemented) in the results. Defaults to `false`.

- `connectableViaConsent` (boolean):
When set to `true`, filters the response to only include endpoints that are currently connectable through Flexpa Consent. Endpoints from vendors not yet supported are excluded.

**Response fields**

- `endpoints` (array):
The array of endpoint objects for this page. Each object has the following fields:

  - `name` (string):
The `name` attribute is a human-readable unique identifier for the endpoint. This attribute is subject to change, so we recommend using the `id` attribute as a static identifier.

  - `id` (string):
The `id` that Flexpa uses to identify this endpoint

  - `mode` (string):
The `mode` is used to detail whether the endpoint is for test or live mode

  - `label` (array):
The `label` is a human-readable name for the endpoint. This is often equivalent to the payer name, but may be a brand level name if the payer has multiple brands.

  - `refreshable` (boolean):
The `refreshable` is a boolean that indicates whether the endpoint supports refreshing an authorization without the original user present. If you attempt to use `MULTIPLE` as your intended `usage` for a non-refreshable endpoint we will still complete the authorization but only one time, and Flexpa will not sync fresh patient data from the endpoint without further user interaction. A `refresh_token` is still issued — see [usage patterns](https://www.flexpa.com/docs/guides/usage#what-does-the-refresh-token-do-on-a-one-time-authorization).

  - `maxAuthPeriod` (number):
The `maxAuthPeriod` represents the maximum time (in seconds) for which an endpoint will allow a user to keep an application authorized to it. After this period elapses, the user is required to re-authorize. A `0` indicates that the endpoint can be authorized indefinitely. If the endpoint is refreshable, a `null` suggests that this value is unknown to Flexpa.

  - `status` (enum):
The `status` is an enumerated list of values:

CONNECTED
The endpoint is connected and available for use.

IN_PROGRESS
The endpoint is currently being implemented and not yet available.

BROKEN
The endpoint is experiencing issues. Flexpa Consent does not disable an endpoint because it is BROKEN: patients can still select it, and it is labeled as experiencing intermittent issues.

UNKNOWN
The endpoint has an unknown or undetermined status.

UNAVAILABLE
The endpoint is not yet implemented and not available for use.

  - `resources` (array):
`resources` is an array of FHIR resources supported by the endpoint

  - `organization` (object):
The `organization` is a JSON object that shows the ID and name of the organization associated with the endpoint.

- `meta` (object):
Pagination metadata.

  - `hasMore` (boolean):
Whether more results are available beyond this page.

  - `nextCursor` (string | null):
Cursor to pass as the `cursor` query parameter for the next page. Null when there are no more results.

*Request*

```bash
curl https://api.flexpa.com/endpoints \
  -H 'Content-Type: application/json'

# Only endpoints connectable through Flexpa Consent
curl https://api.flexpa.com/endpoints?connectableViaConsent=true \
  -H 'Content-Type: application/json'
```

```js
const response = await fetch("https://api.flexpa.com/endpoints", {
  method: "GET",
  headers: {
    "content-type": "application/json",
  }
});

const endpoints = await response.json();

// Only endpoints connectable through Flexpa Consent
const linkResponse = await fetch(
  "https://api.flexpa.com/endpoints?connectableViaConsent=true",
  {
    method: "GET",
    headers: {
      "content-type": "application/json",
    }
  }
);

const linkEndpoints = await linkResponse.json();
```

```json
{
    "endpoints": [
        {
            "name": "san-francisco-health-plan-test",
            "id": "46062592-1111-4a06-8974-da9589119238",
            "mode": "TEST",
            "label": ["San Francisco Health Plan"],
            "refreshable": false,
            "status": "CONNECTED",
            "resources": [
                "Account",
                "ActivityDefinition",
                "AdverseEvent",
                "AllergyIntolerance",
                "Appointment",
                ...
            ],
            "organization": {
                "id": "de83b67b-b176-49ef-b83d-8f8edcd45761",
                "name": "San Francisco Health Plan (SFHP)"
            }
        },
        {
            "name": "village-care-max-test",
            "id": "5c34e5d2-bb46-42d3-a1ce-9b9d2d1fec26",
            "mode": "TEST",
            "label": ["VillageCareMAX"],
            "status": "CONNECTED",
            "refreshable": false,
            "refreshValidFor": 86400,
            "maxAuthPeriod": 31536000,
            "resources": [
                "AccessPolicy",
                "Account",
                "ActivityDefinition",
                "AdverseEvent",
                "AidboxConfig",
                ...
            ],
            "organization": {
                "id": "603889da-dc1e-4f67-b0cf-04d76edc2dcf",
                "name": "Horizon Blue Cross Blue Shield of New Jersey"
            }
        },
        ...
    ],
    "meta": {
        "hasMore": true,
        "nextCursor": "NWMzNGU1ZDItYmI0Ni00MmQzLWExY2UtOWI5ZDJkMWZlYzI2"
    }
}
```

---

### Endpoint Directory

The Endpoint Directory is also available to AI agents through [Health tools for agents](https://www.flexpa.com/docs/guides/mcp-registry), Flexpa's public MCP registry. Its directory capabilities enable programmatic search and validation of payer and provider endpoints, including line of business support and authentication flow detection.

No authentication required — the directory capabilities are read-only and expose only public endpoint metadata.

**Capabilities available through `execute_tool`:**
- `directory.search_endpoints` — Search by payer or provider name, brand, acronym, or state
- `directory.get_endpoint_details` — Get detailed info for a specific endpoint
- `directory.check_lob_support` — Validate plan type support and auth flow
- `directory.list_endpoints` — List all endpoints with optional filters

Paste the setup message into your agent to add the connection, or use the [manual setup](https://www.flexpa.com/docs/guides/mcp-registry#manual-setup) options. See [Endpoint directory for agents](https://www.flexpa.com/docs/network/directory-tools) for usage details. The legacy `https://api.flexpa.com/mcp/directory` connection remains available with the original tool names.

*Setup message*

```text
Connect this agent to Flexpa’s health tool search.

Read https://www.flexpa.com/agents.md and follow the setup instructions. Help me complete any steps that need my input.

If I have not already told you what I need help with, ask me. Otherwise, find relevant health tools for my request.
```

This page also renders tables generated from Flexpa data, which are not part of this markdown. See https://www.flexpa.com/docs/network for them.
