I'd like to call WP REST API to update a user. I have only username, so I suppose I should retrieve user ID first of all, as the endpoint for updating a user is:
GET /wp/v2/users/<id>
How to retrieve the ID with username (that is unique as well)?
I tried:
GET /wp/v2/users/?username=USERNAME
but it's not working.
I also tried:
GET /wp/v2/users/?slug=USERNAME
and it works, but I'm not sure it would not return duplicates.
The best would be update directly the user with a single call, with the username as key, but if this is not possible, I would like to be sure 100% the retrieved ID is the one of the unique username I provided.