Hi KPay SOC,
I was testing the API request and it worked fine with both wazuh-wui and wazuh users. You do not need to make any changes to any configuration file for this. Check the screenshot for reference.
I would suggest you undo the changes and try again with the correct password of the API users.
Ref:https://documentation.wazuh.com/current/user-manual/api/reference.html#section/Authentication
Let me know the update on the issue.