Python SDK DELETE /api/v2/users/{id} failing with 409 and wiping analytics history?

Problem

Need to clean up old contractor accounts through the provisioning scripts. The main goal is to remove active status without destroying past conversation records. Documentation says a standard delete should just deactivate, but the analytics reports show gaps after the call runs. Trying to run this at 3am and it keeps bombing out. The 409 response is annoying.

Code

from purecloudplatform.client import PureCloudPlatformClient
import os

client = PureCloudPlatformClient(os.getenv("GENESYS_ENVIRONMENT"), "client_id", "client_secret")
api_instance = client.users
user_id = "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8"

try:
 api_instance.delete_user(user_id=user_id)
 print("User removed successfully.")
except Exception as e:
 print(f"Request failed: {e}")

Error

Getting a 409 Conflict back on the first run. Retrying after a few minutes returns a 204 No Content, but the historical interaction data inside Analytics disappears. It’s weird how the endpoint feels like it’s hard wiping instead of soft deactivating.

Question

How do we actually handle this without losing the historical data? Shouldn’t I be hitting the PUT /api/v2/users/{userId}/status endpoint instead. Or maybe there’s a specific flag in the SDK call to preserve the audit trail. The docs don’t really cover this. Just staring at the SDK methods right now.