How to programmatically generate user api key

Hi

According with the docs it may be possible to create an user api key from an admin user via the rest API
generate api key for a user from an admin user

In previous versions it worked as “admin/users/’+ user_id +’/generate_api_key”. I don’t know why in latest version it changes.

Thank you for your help