Deleting users via SDK breaks historical analytics data

Just hit a nasty edge case while running a cleanup script for inactive agents. The goal is straightforward: remove users who haven’t logged in for 180 days. Using the standard deleteUser method from the genesys-cloud-node SDK, the request returns a 204 No Content, which implies success. The user is gone from the directory.

The problem shows up immediately after. When querying the analytics API for conversation data tied to that user ID, the records still exist, but the participantId and participantName fields are now null or point to a deleted entity state. This breaks our custom reporting dashboard because the join key is missing. We need the user removed from active provisioning but want the historical interaction data to remain linked to the user’s display name or a static identifier.

Here’s the snippet I’m using:

const purview = new PlatformClient.PurviewApi();
const user = await purview.getUsersUserbyId(userId);
await purview.deleteUser(userId);

I’ve checked the API docs for PATCH /api/v2/users/{id}. There’s no obvious flag like softDelete or preserveHistory. The only workaround I can think of is updating the user’s name to ‘Deleted - [Original Name]’ and disabling them, but that leaves stale records in the user table. Is there a specific header or body parameter I’m missing in the delete call that tells the platform to keep the historical linkage? Or is this a known limitation where we have to maintain our own mapping table for deleted users? The SDK type definitions don’t show any optional params for the delete endpoint beyond the ID.