Atom feed of this document
 

 4.1.4. Add User

VerbURIDescription
POSTv2.0/usersAdd a user.

Normal Response Code(s): 201

Error Response Code(s): identityFault (400, 500, ), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404), badMediaType (415)

[Note]Note

This call is available only to users who hold the admin role (identity:user-admin). Using the admin role, you can create a user who holds the user role (identity:default).

[Warning]Warning

If you use this POST /users call to create a user, that user will have access to APIs but will not have access to the Cloud Control Panel. Cloud Control Panel access is provided to the account's admin user; the admin user is the user who initiated the account by completing the Sign-Up process.

To add a user, specify the user's email and username values, as well as whether the user's initial status is enabled. A successful response echoes the requested values and adds a value for id.

To add a user and specify an initial password for that user, include the password in a request resembling the "Add User with Password Request" examples shown below.

If you do not specify a password for the new user, one will be generated.

If an initial password is generated, it is included in a successful response to this request. After the user is created, the password cannot be retrieved by any means. Make note of the password in the response and supply that password to the user.

Within an account, a maximum of 100 sub-users (sub-accounts) can be added.

Table 4.4. Add User Request Parameters
NameStyleTypeDescription
X-Auth-TokenHeader​String

You need a valid admin token for access.

The X-Auth-Token header should always be supplied.

 

Example 4.7. Add User Request: XML

<?xml version="1.0" encoding="UTF-8"?>
<user xmlns="http://docs.openstack.org/identity/api/v2.0"
      enabled="true" email="john.smith@example.org"
      username="jqsmith"/>

 

Example 4.8. Add User Request: JSON

{
  "user": {
    "username": "jqsmith",
    "email": "john.smith@example.org",
    "enabled": true
	}
}

 

Example 4.9. Add User with Password Request: XML

<user username="cmarin1subX2" 
    email="cmarin1-sub@example.com" 
    enabled="true" 
    ns1:password="Password48" 
    xmlns:ns1="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0" 
    xmlns:ns2="http://docs.openstack.org/identity/api/v2.0" />

 

Example 4.10. Add User with Password Request: JSON

{
    "user": {
            "username": "cmarin1subX2", 
            "email": "cmarin1-sub@example.com", 
            "enabled": true, 
            "OS-KSADM:password":"Password48"
        }
}

This operation does not require a request body.

 

Example 4.11. Add User Response: XML

<?xml version="1.0" encoding="UTF-8"?>
<user xmlns="http://docs.openstack.org/identity/api/v2.0" 
      xmlns:ns2="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0" 
      xmlns:rax-auth="http://docs.rackspace.com/identity/api/ext/RAX-AUTH/v1.0" 
      id="123456" username="jqsmith" 
      enabled="true" 
      email="john.smith@example.org"
      rax-auth:defaultRegion="DFW">
</user>

 

Example 4.12. Add User Response: JSON

{
  "user": {
    "RAX-AUTH:defaultRegion": "DFW"
    "id": "123456",
    "username": "jqsmith",
    "email": "john.smith@example.org",
    "enabled": true
  }
}