DELETE /api/v2/users/{userId} breaking historical interaction logs

Executing a DELETE request against /api/v2/users/{userId} removes the agent profile, but the queue analytics dashboard won’t retrieve historical conversation logs afterward. Tested the preserveHistory header and a soft disable via PATCH /api/v2/users/{userId}, yet the transcript cache still breaks. Need the exact JSON payload like {“active”: false} that drops the license while keeping the interaction data intact.

The 404 on transcripts isn’t caused by the user deletion itself. It’s a classic cache sync issue with the analytics engine. When you delete a user, the background job that aggregates historical data for that agent ID gets wiped. You don’t need a special payload. Just PATCH the user to inactive first. Wait for the index to update, then delete.

Try this sequence:

// 1. Deactivate user
await platformClient.users.patchUser(userId, {
 active: false,
 licensedFeatures: [] // revoke licenses here
});

// 2. Wait for propagation (usually 5-10 mins)
await new Promise(r => setTimeout(r, 600000));

// 3. Now delete if strictly necessary
await platformClient.users.deleteUserByUserId(userId);

If you delete immediately, the transcript service can’t resolve the user ID during the next aggregation cycle. Keeping the user record as inactive preserves the link. Check the Event Delivery logs for user:updated to confirm the cache cleared before proceeding.