CreateUser

Adds or Updates a User object.

Syntax

The following syntax includes all required properties. You can set any other properties for the Company and User objects.

            <CreateUser> 
   <Company> 
      <nickname>Example</nickname> 
   </Company> 
   <User> 
      <nickname>mcollins</nickname> 
      <password>openair_password</password> 
      <addr> 
         <Address> 
            <email>mcollins@example.com</email> 
         </Address> 
      </addr> 
   </User>
</CreateUser> 

          

Usage

Use the CreateUser command to add a new user or update an existing user. The maximum number of objects you can add or update with one XML API call is 1,000.

To add objects of types other than User, use the Add command instead.

You can set custom field values as well as standard field values when adding User objects. See Reading or Setting Custom Field Values Inline.

You can set the employee work schedules when adding User objects. See User.

Important:

Review the following guidelines:

  • You must be authenticated as an account administrator to use the CreateUser command.

  • You must set a password when using the CreateUser command to create a new user record except for generic user records (generic set to 1). This is also true when using the CreateUser command with a foreign key lookup that results in inserting a new user record.

  • If you are using SAML for authentication in to your OpenAir account:

    • You can set a password and enable SAML authentication for the user (setting the Boolean custom field saml_auth__c to true) when using the CreateUser command to create a new user record.

    • You cannot set a password if SAML authentication is enabled for the user (saml_auth__c set to true) when using the CreateUser command with a foreign key lookup to update an existing user record. The API will return the following error: “System.Exception: Not enabled to edit password: Edit of passwords is not allowed”.

  • Limits are enforced to prevent you from creating or activating users if doing so would exceed the number of user licenses purchased for your account. If no user licenses of the appropriate type are available, the CreateUser command creates a new user record, but sets it as inactive (clears the Active box on the employee record), or to activate a user record (to check the Active box on the employee record). For more information about OpenAir licensing and compliance, see Licenses.

Attributes

Attribute

Usage

enable_custom

XML API Only — Set the enable_custom attribute to 1 to include custom field values in the argument object properties along with standard object properties.

exclude_flags

XML API Only — Set the exclude_flags attribute to 1 to exclude user settings from the response.

lookup

Use the lookup to upsert an object and designate the lookup field. The lookup field determines whether it adds or updates an object:

  • If the lookup field is not matched in any existing objects, a new object is added.

  • If the lookup field is matched one time, the existing object is updated.

Arguments

Name

Type

Description

Company

Object

A Company object

User

Object

A User object

Response

A User object.