Genesys Cloud API: Deleting user via SDK without breaking historical conversation links

I’m running into a bit of a headache with the user provisioning side of things using the Python SDK. We have a script that cleans up temporary users after a shift, and I’m trying to delete a specific user using users_api.delete_user(user_id).

The call returns a 204 No Content, which is fine. The user is gone from the admin view. But when I query the conversations API for that user’s past interactions, the participants object in the JSON payload has a null name and an empty string for the user_id. It’s not just hiding the data, it feels like the link is severed or the reference is wiped out completely.

I need the historical data to stay intact for audit reasons. The name should still show up, or at least a reference to the deleted user. Is there a flag I’m missing in the delete request? Or is there a different API endpoint I should be hitting instead of the standard delete?

Here is the snippet I’m using:

from genesyscloud.users import UsersApi
from genesyscloud.auth import AuthApi

auth = AuthApi()
api_client = auth.get_default_api_client()
users_api = UsersApi(api_client)

try:
 response = users_api.delete_user(user_id=existing_user_id)
 print(f"Deleted user {existing_user_id}")
except Exception as e:
 print(f"Error deleting user: {e}")

If I look at the conversation details afterwards, the participant object looks like this:

{
 "id": "some-uuid",
 "name": null,
 "user_id": "",
 "routing_status": "offline"
}

I was expecting the name to remain “John Doe” or similar. Anyone know how to handle this properly?