1.5

Table Of Contents
When you create a user, you must include the Role and Password elements in the request body. The role can
be a predefined role or one created by the organization administrator. For more information about retrieving
a list of predefined roles, see “Retrieve an Administrative View of a Cloud,” on page 47. For more information
about creating new roles, see “Create a Role,” on page 156.
Prerequisites
Verify that you are logged in as an organization administrator or system administrator.
Procedure
1 Create a User element that defines the user account properties.
See the request portion of “Example: Create a Local User,” on page 149.
2 POST the User element to the organization's add URL for users.
The server creates a user account in the vCloud Director database and returns an updated User element to the
client.
Example: Create a Local User
This example adds the user to the organization created in “Example: Create an Organization,” on page 113.
The request includes an optional IsEnabled element that enables the user. If not present in the request,
IsEnabled defaults to false.
The response is a User element, most of which does not appear in the example. The response includes a link
that an administrator can use to edit user properties, and additional elements, such as IsDefaultCached and
StoredVmQuota, inherited from the organization. The Password element, which must not be empty when you
create a User, is never returned.
Request:
POST https://vcloud.example.com/api/admin/org/26/users
Content-Type: application/vnd.vmware.admin.user+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<User
xmlns="http://www.vmware.com/vcloud/v1.5"
name="ExampleUser" >
<FullName>Example User Full Name</FullName>
<EmailAddress>user@example.com</EmailAddress>
<IsEnabled>true</IsEnabled>
<Role
href="https://vcloud.example.com/api/admin/role/105" />
<Password>Pa55w0rd</Password>
<GroupReferences />
</User>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.user+xml
...
<User
xmlns="http://www.vmware.com/vcloud/v1.5"
name="ExampleUser"
id="urn:vcloud:user:85"
type="application/vnd.vmware.admin.user+xml"
href="https://vcloud.example.com/api/admin/user/85" ... >
<Link
Chapter 6 Creating, Provisioning, and Managing Organizations
VMware, Inc. 149