Problem
We’re running a cleanup script that removes inactive agents from the platform. The Python SDK call works fine. Historical reports break immediately after though. Analytics queries return empty sets for those user IDs. It’s breaking the downstream dashboards. We don’t see a way to remove the account but keep the call records linked.
Code
from genesyscloud.users import UsersApi
users = UsersApi(api_client)
users.delete_users_user(user_id=target_id)
Error
No 4xx or 5xx errors. The request returns 204 No Content. Rate limits don’t even trigger. The problem shows up three minutes later when we run a conversation detail query. The toUserId and fromUserId fields in the historical payload turn into null strings. The API docs mention soft delete but the endpoint documentation doesn’t list a preserve_history flag. We’ve tried passing a custom header X-Preserve-History: true but the gateway just drops it. Checked the changelog. Nothing useful. Also tried calling the raw REST endpoint directly with requests library. Same behavior.
Question
Is there a specific query parameter or a separate provisioning endpoint that handles this? We just need the user record gone from the active roster while the interaction logs stay intact. The current flow destroys the audit trail completely.