# Create new user through REST API

**URL:** <https://forums.suse.com/t/create-new-user-through-rest-api/10867>\
**Category:** SUSE Rancher Prime\
**Created:** [June 22, 2018, 7:59am UTC](https://forums.suse.com/t/create-new-user-through-rest-api/10867 "2018-06-22T07:59:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gioppoluca](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gioppoluca](https://forums.suse.com/u/gioppoluca)\
**Post date:** [June 22, 2018, 7:59am UTC](https://forums.suse.com/t/create-new-user-through-rest-api/10867/1 "2018-06-22T07:59:09Z")

</div>

I’m trying to create a new user using the REST API.  
I use both the UI offered in the REST API web pages and Postman do doublecheck.  
The user get created but is unable to login even if I specify that he does not have to change the password.  
Do I need to execute some more API call to complete the user creation?  
When I try to login with the new user I get the message “e is undefined”.  
but I do not understand what is “e”.  
Thanks  
Luca

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [June 22, 2018, 3:54pm UTC](https://forums.suse.com/t/create-new-user-through-rest-api/10867/2 "2018-06-22T15:54:27Z")

</div>

Post the request you’re making and the response so we don’t have to guess what you’re doing?

---

<div class="post-metadata">

**Author:** ![gioppoluca](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gioppoluca](https://forums.suse.com/u/gioppoluca)\
**Post date:** [June 25, 2018, 7:29am UTC](https://forums.suse.com/t/create-new-user-through-rest-api/10867/3 "2018-06-25T07:29:02Z")

</div>

Sure!  
Here is the code:  
curl -u “{CATTLE\_ACCESS\_KEY}:{CATTLE\_SECRET\_KEY}”   
-X POST   
-H ‘Accept: application/json’   
-H ‘Content-Type: application/json’   
-d ‘{“description”:“testing user”, “me”:false, “mustChangePassword”:false, “name”:“test”, “password”:“testpasswd”, “principalIds”:[], “username”:“test”}’   
‘[https://tst-kubemaster.pochdp.csi.it/v3/users](https://tst-kubemaster.pochdp.csi.it/v3/users)’

HTTP/1.1 POST /v3/users  
Host: tst-kubemaster.pochdp.csi.it  
Accept: application/json  
Content-Type: application/json  
Content-Length: 142

{

```
"description": "testing user",
"me": false,
"mustChangePassword": false,
"name": "test",
"password": "testpasswd",
"principalIds": [],
"username": "test"

```

}

This is done using the form in the “/v3/users” path of the rancher portal.  
When I log out as admin and try to enter with the newly created user I get an error " e is undefined " at login.

---

<div class="post-metadata">

**Author:** ![gioppoluca](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gioppoluca](https://forums.suse.com/u/gioppoluca)\
**Post date:** [July 25, 2018, 1:21pm UTC](https://forums.suse.com/t/create-new-user-through-rest-api/10867/4 "2018-07-25T13:21:44Z")

</div>

Any feedback on this?  
I’m on 2.0.6 but is still not working.  
This is a problem for automated processes.  
Is there some other API to invoke after the one mentioned or is there a bug?  
Thanks  
Luca
