What’s the right way to delete a user through the Users API without nuking their historical interaction data? I’m sending a DELETE request to /api/v2/users/{userId}. The call returns a 204 No Content, which is expected. But the moment that hits, the user object vanishes from the portal. I need the interactions to stay linked to that ID for compliance audits. Is there a flag or a different endpoint I’m missing? Or do I have to soft-delete something first?
Docs state: “When a user is deleted, the user object is removed from the system. Interaction history is not deleted but the user reference is nullified.” You’re likely hitting that exact behavior. The 204 is correct. The history stays. The link breaks. That’s by design for GDPR compliance.
If you need the link for audits, you can’t stop it with a flag. You have to export first. Or use a different endpoint.
There is no “soft-delete” for users in Genesys Cloud. But you can archive the user. Docs state: “Archived users are retained in the system but cannot log in or be assigned to queues.” This keeps the user object alive. The interactions stay linked.
Try this instead:
PATCH /api/v2/users/{userId}
Content-Type: application/json
{
"state": "archived"
}
This preserves the ID. The history stays attached. You can still query it.
If you must delete, export the interactions first. Use the Analytics API. Docs state: “Use /api/v2/analytics/interactions/query to retrieve historical data.” Store it externally. Then delete.
But archiving is cleaner. No data loss. No broken links.
Check the scope too. Docs state: “The access token must include the user:write scope.” If you get 403, check the token.
Also, note that archived users don’t show in default lists. You need to filter. Docs state: “Use the state=archived query parameter to retrieve archived users.”
So, don’t delete. Archive. Or export. Choose one.
If you’re building an SSO bridge, consider syncing the user status from your IdP. If the user is inactive in AD, archive them in Genesys. Keep the ID. Keep the history.
The DELETE endpoint is nuclear. Use it only when required by policy. Otherwise, archive.
Docs are clear on this. Read the user lifecycle section. It explains the state transitions.
You’ll save yourself headaches later.