Deleting user via /api/v2/users/{id} without losing interaction history

I’m using the Genesys Cloud Users API to offboard agents in our Kotlin service. Calling DELETE /api/v2/users/{id} works, but I’m worried about historical data integrity. The docs mention soft deletes, but our reporting queries against /analytics/conversations seem to break or return nulls for the agent field after deletion. Is there a specific header or body param I need to include to preserve the link to past interactions? Or should I just disable them with PATCH /users/{id} and set enabled to false instead?

The DELETE endpoint is a hard delete. It removes the user record entirely. That’s why your analytics queries break. The agent reference in the conversation history points to a user ID that no longer exists. You can’t preserve the link because the target is gone.

If you want to keep the history intact, you shouldn’t delete the user. You should disable them. The docs for User Management state: “Disabling a user prevents them from logging in but retains their account and associated data.” This is the standard offboarding pattern.

Here’s how you do it in C# using the .NET SDK. You need to update the status to inactive.

var usersApi = platformClient.Users;
var updateUserRequest = new UpdateUserRequest
{
 Status = "inactive"
};

try
{
 var result = await usersApi.UsersUserPutAsync(userId, updateUserRequest);
 Console.WriteLine($"User {userId} is now inactive.");
}
catch (ApiException ex)
{
 Console.WriteLine($"Error: {ex.Message}");
}

This keeps the user in the system. Their ID remains valid. Your /analytics/conversations reports will still resolve the agent name correctly because the user object still exists. You might also want to clear their phone number or email if they are leaving the company, but keep the status inactive.

Another option is to move them to a different division or remove their permissions, but disabling is the cleanest way to stop access while keeping data references valid. Don’t use DELETE unless you are sure you want to lose that historical context. It’s a common mistake. People think “delete” means “remove access” but in Genesys Cloud it means “remove record”.

Also check your OAuth scopes. You need admin:users:write to update the status. If you’re getting 403 errors, that’s likely why. Make sure your integration user has the right role assigned in Admin.