Running into a tricky situation with user provisioning cleanup. We’ve got a batch script that needs to remove terminated agents from Genesys Cloud, but simply calling the DELETE endpoint on /api/v2/users/{userId} seems to strip out the user details from past interactions. The goal is to keep the historical data intact for reporting purposes while removing the active license.
Here is the current flow:
import requests
headers = {
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json'
}
# Attempting to delete the user
response = requests.delete(
f'https://api.mypurecloud.com/api/v2/users/{user_id}',
headers=headers
)
if response.status_code == 204:
print('User deleted successfully')
else:
print(f'Failed with status {response.status_code}: {response.text}')
After this runs, querying the interactions API shows null for the to or from user objects on old calls. The documentation mentions soft deletes, but it’s unclear if there’s a specific flag or a different endpoint to just deactivate the user without triggering a data purge on their historical records.
Have I missed a parameter in the delete request or is there a separate archival step required before deletion? The standard DELETE feels too aggressive for this use case.