We’re running a cleanup job to remove terminated agents from our CXone instance using the REST API. The goal is to delete the user record but keep the interaction history intact for compliance reporting.
I’m using the standard delete endpoint:
DELETE /api/v2/users/{userId}
The call returns 200 OK, which confirms the user is removed. However, when I query the analytics later, the agent name on past calls shows up as ‘Unknown User’. The interaction data isn’t gone, but the link to the user profile is broken.
I checked the response headers and the request body. There’s no flag like preserveHistory=true in the docs. I tried updating the user status to inactive first, then deleting, but the result is the same. The historical data loses the user reference.
Is there a specific header or query parameter to keep the user metadata linked to past interactions? Or do I need to export the data before deleting the user?
We’ve tried archiving the user first, but that doesn’t stop the name from disappearing on old records.