To clear a user affinity profile, you can use the delete endpoint of the Personalization API. This deletes the profile and its associated affinity data.
The API response will include a date and time indicating when the user profile can safely be considered deleted.
For full details on how to structure the request, check out the Personalization API documentation here.