Hey everyone,
We’re running a cleanup script to remove offboarded agents from our Genesys Cloud org using the Python SDK. The goal is to keep the tenant tidy, but I’m hitting a snag with the data retention side of things.
When I call users_api.delete_user(user_id), the user gets soft-deleted. That part works fine. The issue is downstream. We have a reporting dashboard that pulls conversation data via the Analytics API. It seems like once that user is deleted, the to_participant or from_participant fields in the interaction records start returning null or a generic “Deleted User” string instead of the actual name or ID.
I’ve been looking at the /api/v2/users/{userId} endpoint docs, but they don’t really specify if there’s a way to “archive” the user identity without fully deleting the account object, or if I should be using a different approach entirely.
Here’s the basic flow I’m using right now:
user_id = "12345-abcde"
users_api.delete_user(user_id)
After this runs, if I query the analytics for that time period, the participant data is basically gone. I need the user to be inaccessible for login, obviously, but I want the historical interactions to still resolve to the correct user name for our compliance reports.
Is the standard practice here to just not delete users via API? Or is there a flag I’m missing in the request body? I tried setting the user to inactive first with a PATCH request, but that doesn’t remove the license, which is what we’re trying to save on.
Any thoughts on how other folks handle this cleanup without nuking the historical data integrity? I’m guessing I might need to export the user mapping to a local DB and join it against the analytics results, but that feels like a workaround for something the API should handle.
Just want to make sure I’m not accidentally breaking our audit trail before I run this on the production list.