User Account Deletion

Application APIs

This workflow demonstrates how to process user-initiated account deletion requests. The workflow uses GraphQL mutations to manage account deletion status and remove associated user data.


Prerequisites

Environment URL:

  • Client-Sandbox: https://api.client-sandbox.icanbwell.com/v1/graphql


Workflow Steps

Step 1: Initiate Account Deletion Request

Use the updateUserAccountStatus mutation to send a user account deletion request. The mutation supports different operation types depending on your deletion requirements.

Available Operations:

OperationDescription
REQUEST_DELETEInitiates account deletion request with configured waiting period
CANCEL_DELETECancels pending deletion request and restores account
IMMEDIATE_EXECUTIONExecutes immediate account deletion without waiting period

GraphQL Mutation:

mutation delete($operation: Operation!) {
  updateUserAccountStatus(operation: $operation) {
    resourceType
    issue {
      code
      severity
      details {
        text
      }
    }
  }
}

Example Variables (Request Deletion):

{
  "operation": "REQUEST_DELETE"
}

Example Variables (Cancel Deletion):

{
  "operation": "CANCEL_DELETE"
}

Example Variables (Immediate Deletion):

{
  "operation": "IMMEDIATE_EXECUTION"
}

Step 2: Account and Data Deletion

Once the deletion request is processed (either after the waiting period for REQUEST_DELETE or immediately for IMMEDIATE_EXECUTION), the user's account and all associated data are permanently removed from b.well.

Deleted data includes:

  • User profile and demographics
  • Consent records
  • Established data connections
  • Retrieved health records
  • Task and notification data