Managing Data Connections
Application APIs
This workflow demonstrates how to manage existing healthcare data connections, including viewing connection status, disconnecting or deleting connections, and re-establishing connections that have expired or been removed. These operations allow users to maintain control over which healthcare providers can access and sync their health data through b.well.
Prerequisites
- health.network - This workflow requires health.network to be enabled for access to b.well's Patient Access API connections.
- End-User Authentication - User must be authenticated [1]
- Account Creation and Consent - User account and consent must be completed
- Search for & Establish Connections - At least one connection must be established
Environment URL:
- Client-Sandbox:
https://api.client-sandbox.icanbwell.com/v1/graphql
Available Operations
1. View Established Connections
Use the getMemberConnections GraphQL query to retrieve all connection records associated with a user. This query returns connection status, sync status, authentication type, and error details for each established data source.
GraphQL Query:
query getMemberConnections() {
getMemberConnections {
id
name
category
integrationType
type
status
syncStatus
syncErrors {
coding {
display
code
}
}
statusUpdated
lastSynced
created
}
}Example Response:
{
"data": {
"getMemberConnections": [
{
"id": "epic_on_fhir_sandbox",
"name": "Epic on FHIR Sandbox",
"category": "OAUTH",
"integrationType": "PROA",
"type": "PRACTITIONER",
"status": "EXPIRED",
"syncStatus": "RETRIEVED",
"syncErrors": null,
"statusUpdated": "2025-08-20T20:51:12.513000",
"lastSynced": "2025-08-17T11:09:12.987000",
"created": "2025-08-13T16:55:21.601000"
},
{
"id": "proa_demo",
"name": "BWell PROA Demo",
"category": "OAUTH",
"integrationType": "PROA",
"type": "PRACTITIONER",
"status": "DELETED",
"syncStatus": "DATA_DELETED",
"syncErrors": null,
"statusUpdated": "2025-11-21T17:01:10.925000",
"lastSynced": "2025-10-22T18:23:28.377000",
"created": "2025-09-23T14:12:56.158000"
}
]
}
}Response Properties:
| Property | Description | Possible Values |
|---|---|---|
id | Connection identifier | Unique connection ID |
name | Human-readable connection name | "BWell PROA Demo", "Epic on FHIR Sandbox" |
category | Authentication method | BASIC, OAUTH |
integrationType | Connection type | PROA |
type | Healthcare provider type | CLINICAL, INSURANCE, LAB, PHARMACY, PRACTITIONER |
status | Connection lifecycle state | CONNECTED, DELETED, DISCONNECTED, ERROR, EXPIRED |
syncStatus | Data synchronization state | ERROR, PENDING, RETRIEVED, RETRIEVING, DATA_DELETED |
syncErrors | Data sync pipeline errors | See sync errors table below |
statusUpdated | Last status update timestamp | ISO 8601 format |
lastSynced | Last data sync timestamp | ISO 8601 format |
created | Connection creation timestamp | ISO 8601 format |
Optional Filters:
The getMemberConnections query can be filtered by integrationType and/or status. By default, connections with a status of DELETED and syncStatus of DATA_DELETED are excluded.
Sync Errors:
| Code | Display | Description |
|---|---|---|
PERSON_MATCHING_ERROR | Failure to match to a b.well person | All health data from the connection is unavailable |
CONNECTION_ERROR | Failure in connecting to source or internal servers | Some or all health data may be unavailable |
MAPPING_ERROR | Failure to map source data to R4 FHIR | Some or all health data may be unavailable |
ENRICHMENT_ERROR | Failure to run intelligence layer | Some or all health data may be unavailable |
PATIENT_RETRIEVAL_ERROR | Failure to retrieve patient record from source | All health data from the connection is unavailable |
2. Disconnect Connection
Use the disconnectConnection mutation to temporarily disconnect a data connection. Existing data remains in b.well, but future data syncs from this source are prevented until the connection is re-established.
GraphQL Mutation:
mutation disconnectConnection($connectionId: String!) {
disconnectConnection(connectionId: $connectionId) {
status
statusUpdated
}
}Example Variables:
{
"connectionId": "epic_on_fhir_sandbox"
}Example Response:
{
"data": {
"disconnectConnection": {
"status": "DISCONNECTED",
"statusUpdated": "2025-08-20T20:51:12.513000"
}
}
}3. Delete Connection
Use the deleteConnection mutation to permanently delete a data connection. All existing data from this connection is removed, and future data syncs are prevented.
GraphQL Mutation:
mutation deleteConnection($connectionId: String!) {
deleteConnection(connectionId: $connectionId) {
status
statusUpdated
}
}Example Variables:
{
"connectionId": "proa_demo"
}Example Response:
{
"data": {
"deleteConnection": {
"status": "DELETED",
"statusUpdated": "2025-08-20T21:00:07.067000"
}
}
}4. Re-Connect a Disconnected or Deleted Connection
Connections with a status of EXPIRED, DISCONNECTED, or DELETED can be re-established by generating a new OAuth authorization URL.
For connections with integrationType of PROA, use the connection id as the connectionId in the getOauthUrl query to generate a new OAuth authorization URL. Direct the user to this URL to re-authenticate and re-establish the connection.
See Steps 3 & 4 in the Search for & Establish Connections workflow guide for complete OAuth re-authentication details.
Updated 8 days ago
