Deleting user via API without orphaning historical interaction data

Quick query on the correct approach to remove a user without breaking our trace correlation for historical data.

We’re building an automated cleanup job using the Genesys Cloud Python SDK. The goal is to deprovision users who haven’t logged in for 90 days. The tricky part is that we have a distributed tracing pipeline that links interaction_id to user_id in our OTel spans. If we hard delete the user, those historical spans become orphaned references in our Jaeger backend because the user entity no longer exists to resolve the context.

I’ve been testing with the standard delete endpoint:

client.users_api.delete_user(user_id=user_id)

This returns a 204 No Content. It works for the user object. But when I query the analytics API for interactions associated with that user_id post-deletion, the user field in the interaction object is null or points to a ghost reference. This breaks our span aggregation logic which expects a valid user profile to attach metadata.

Is there a soft delete mechanism or a specific flag in the DELETE /api/v2/users/{userId} payload that preserves the user entity in read-only mode? I didn’t see any parameters for keep_history in the docs.

Alternatively, should I be archiving the user to a specific group before deletion to maintain the reference? We need the user object to persist in the API response for historical lookups even if the account is disabled. Current approach feels like it’s creating data gaps in our tracing dashboard.