Title: Creating users using API doesn&#8217;t work
Last modified: October 11, 2023

---

# Creating users using API doesn’t work

 *  Resolved [lennydz](https://wordpress.org/support/users/lennydz/)
 * (@lennydz)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/creating-users-using-api-doesnt-work/)
 * Hi, I’m trying to register new users through the default WP API. However it fails
   due to some authentication issues. I’m using application password, this used 
   to work few months ago, is there an update somewhere that disabled this?
 * Here’s the response I get :
 * `{"code": "invalid_username","message": "<strong>Erreur :</strong> identifiant
   inconnu. Vérifiez à nouveau ou essayez avec votre adresse e-mail.","data": {"
   status": 401}}`
 * (the message is in french, but it basically says “Error: unknown user. Verify
   again or try with your email adress)
 * my request :
 * `https://sandbox.lynxws.ch/wp-json/wp/v2/users?username=lennydz&email=test@anydomain.
   ch&password=12345`
 * And I deactivated all the plugin for test purpose. And I added the basic auth
   with username:pwd as it should be. And the I use an admin user.
 * Any idea on what’s wrong?
    -  This topic was modified 2 years, 8 months ago by [lennydz](https://wordpress.org/support/users/lennydz/).
      Reason: add some precision on user role
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcreating-users-using-api-doesnt-work%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/creating-users-using-api-doesnt-work/#post-17117353)
 * How did you send your request? To create a new user you must use POST method.
   What username did you use for basic auth? It should be the WP user name you used
   when you set up the application password, not the application name with which
   it was created.
 * The user field data is normally sent as part of the POST payload data, not as
   URL query string. I think a query string will still work with POST, but I’ve 
   never tried it that way.
 * More information on [using application passwords](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/).
   Scroll down to the Using Credentials / REST API section.
 *  Thread Starter [lennydz](https://wordpress.org/support/users/lennydz/)
 * (@lennydz)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/creating-users-using-api-doesnt-work/#post-17121040)
 * Ok, I was using the application password’s name as username. Thanks for the answer.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating users using API doesn’t work’ is closed to new replies.

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [lennydz](https://wordpress.org/support/users/lennydz/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/creating-users-using-api-doesnt-work/#post-17121040)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
