An organization administrator can create user accounts that are local to the organization. Local user accounts are stored in the vCloud Director database.

Every user exists within the context of an organization. An organization administrator can create a local user in an organization by POSTing a User element to the organization’s add URL for users, as shown in Example: Create a Local User.

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. For more information about creating new roles, see Create a Role.

Verify that you are logged in to the vCloud API as an organization administrator or system administrator.

1

Create a User element that defines the user account properties.

See the request portion of Example: Create a Local User.

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.

This example adds the user to the organization created in Example: Create an Organization. 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, whose values are inherited from the organization.

The Password element, which must not be empty when you create a User, is never returned.

The ProviderType, which was not specified in the request, defaults to INTEGRATED. See About Identity Providers.

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
      rel="edit"
      type="application/vnd.vmware.admin.user+xml"
      href="https://vcloud.example.com/api/admin/user/85" />
   <FullName>Example User Full Name</FullName>
   <EmailAddress>user@example.com</EmailAddress>
   <IsEnabled>true</IsEnabled>
   <ProviderType>INTEGRATED</ProviderType>
   <IsAlertEnabled>false</IsAlertEnabled>
   <IsDefaultCached>false</IsDefaultCached>
   <IsGroupRole>false</IsGroupRole>
   <StoredVmQuota>0</StoredVmQuota>
   <DeployedVmQuota>0</DeployedVmQuota>
   <Role
      type="application/vnd.vmware.admin.role+xml"
      name="vApp User"
      href="https://vcloud.example.com/api/admin/role/105" />
   <GroupReferences />
</User>