:doc:`WorkMail <../../workmail>` / Client / create_user

***********
create_user
***********



.. py:method:: WorkMail.Client.create_user(**kwargs)

  

  Creates a user who can be used in WorkMail by calling the  RegisterToWorkMail operation.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateUser>`_  


  **Request Syntax**
  ::

    response = client.create_user(
        OrganizationId='string',
        Name='string',
        DisplayName='string',
        Password='string',
        Role='USER'|'RESOURCE'|'SYSTEM_USER'|'REMOTE_USER',
        FirstName='string',
        LastName='string',
        HiddenFromGlobalAddressList=True|False,
        IdentityProviderUserId='string'
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The identifier of the organization for which the user is created.

    

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.

    

  
  :type DisplayName: string
  :param DisplayName: **[REQUIRED]** 

    The display name for the new user.

    

  
  :type Password: string
  :param Password: 

    The password for the new user.

    

  
  :type Role: string
  :param Role: 

    The role of the new user.

     

    You cannot pass *SYSTEM_USER* or *RESOURCE* role in a single request. When a user role is not selected, the default role of *USER* is selected.

    

  
  :type FirstName: string
  :param FirstName: 

    The first name of the new user.

    

  
  :type LastName: string
  :param LastName: 

    The last name of the new user.

    

  
  :type HiddenFromGlobalAddressList: boolean
  :param HiddenFromGlobalAddressList: 

    If this parameter is enabled, the user will be hidden from the address book.

    

  
  :type IdentityProviderUserId: string
  :param IdentityProviderUserId: 

    User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'UserId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **UserId** *(string) --* 

        The identifier for the new user.

        
  
  **Exceptions**
  
  *   :py:class:`WorkMail.Client.exceptions.DirectoryServiceAuthenticationFailedException`

  
  *   :py:class:`WorkMail.Client.exceptions.DirectoryUnavailableException`

  
  *   :py:class:`WorkMail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`WorkMail.Client.exceptions.InvalidPasswordException`

  
  *   :py:class:`WorkMail.Client.exceptions.NameAvailabilityException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  
  *   :py:class:`WorkMail.Client.exceptions.ReservedNameException`

  
  *   :py:class:`WorkMail.Client.exceptions.UnsupportedOperationException`

  