Running into a data integrity issue when cleaning up test users via the JS SDK. The standard deleteUsersUser endpoint works fine for removing the identity, but it seems to orphan or break references in the analytics dataset. We’re seeing null IDs in the agent dimension for historical interactions after the deletion hits.
The goal is to remove the active user record without corrupting the historical reporting data. Is there a specific flag or alternative endpoint like /api/v2/users/{userId}?removeHistory=false that I’m missing? The docs are sparse on the soft-delete behavior for users specifically.
Here’s the current call structure:
const { UsersApiClient } = require('@genesyscloud/platform-client');
const client = new UsersApiClient();
async function cleanupUser(userId) {
try {
const response = await client.deleteUsersUser(userId);
console.log('User deleted:', response.status);
} catch (error) {
console.error('Delete failed:', error.message);
}
}
The deletion succeeds with a 204 No Content. But when I query the analytics API for interactions involving that user ID from last week, the agent field is empty. I need to keep the user record active but disable it, or delete it in a way that preserves the historical link. What’s the correct approach here?