I’m trying to script a cleanup job in Kotlin to remove terminated agents from our Genesys Cloud org. The goal is to delete the user entity via /api/v2/users/{userId} so they don’t clutter the admin UI, but I’m worried about what happens to the conversation history.
From what I’ve read, deleting a user doesn’t delete the conversations, but it does replace the user ID with Deleted User or something similar in the transcript. I need to keep the userId reference intact for our reporting pipeline.
Here’s what I’ve tried so far:
- Called
DELETE /api/v2/users/123456with a valid OAuth token. It returns204 No Content. - Checked the conversation details for a call handled by that user immediately after deletion.
- The
participantIdin the conversation JSON is still there, but thenamefield is now “Deleted User”.
Is there a flag or a different endpoint to “archive” or “deactivate” a user instead of fully deleting them? I want the user to be invisible in the active directory but keep their identity linked to past interactions.
My current Kotlin code looks like this:
val request = HttpRequest.DELETE("https://mycompany.genesyscloud.com/api/v2/users/$userId")
.header("Authorization", "Bearer $token")
response = client.execute(request)
If I get a 204, is the data gone forever? I don’t want to break our analytics.