:doc:`WickrAdminAPI <../../wickr>` / Client / update_user

***********
update_user
***********



.. py:method:: WickrAdminAPI.Client.update_user(**kwargs)

  

  Updates the properties of an existing user in a Wickr network. This operation allows you to modify the user's name, password, security group membership, and invite code settings.

   

  .. note::

    

    ``codeValidation``, ``inviteCode``, and ``inviteCodeTtl`` are restricted to networks under preview only.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/wickr-2024-02-01/UpdateUser>`_  


  **Request Syntax**
  ::

    response = client.update_user(
        networkId='string',
        userId='string',
        userDetails={
            'firstName': 'string',
            'lastName': 'string',
            'username': 'string',
            'securityGroupIds': [
                'string',
            ],
            'inviteCode': 'string',
            'inviteCodeTtl': 123,
            'codeValidation': True|False
        }
    )
    
  :type networkId: string
  :param networkId: **[REQUIRED]** 

    The ID of the Wickr network containing the user to update.

    

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

    The unique identifier of the user to update.

    

  
  :type userDetails: dict
  :param userDetails: 

    An object containing the user details to be updated, such as name, password, security groups, and invite code settings.

    

  
    - **firstName** *(string) --* 

      The new first name for the user.

      

    
    - **lastName** *(string) --* 

      The new last name for the user.

      

    
    - **username** *(string) --* 

      The new username or email address for the user.

      

    
    - **securityGroupIds** *(list) --* 

      The updated list of security group IDs to which the user should belong.

      

    
      - *(string) --* 

      
  
    - **inviteCode** *(string) --* 

      A new custom invite code for the user.

      

    
    - **inviteCodeTtl** *(integer) --* 

      The new time-to-live for the invite code in days.

      

    
    - **codeValidation** *(boolean) --* 

      Indicates whether the user can be verified through a custom invite code.

      

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

    
    ::

      {
          'userId': 'string',
          'networkId': 'string',
          'securityGroupIds': [
              'string',
          ],
          'firstName': 'string',
          'lastName': 'string',
          'middleName': 'string',
          'suspended': True|False,
          'modified': 123,
          'status': 123,
          'inviteCode': 'string',
          'inviteExpiration': 123,
          'codeValidation': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **userId** *(string) --* 

        The unique identifier of the updated user.

        
      

      - **networkId** *(string) --* 

        The ID of the network where the user was updated.

        
      

      - **securityGroupIds** *(list) --* 

        The list of security group IDs to which the user now belongs after the update.

        
        

        - *(string) --* 
    
      

      - **firstName** *(string) --* 

        The updated first name of the user.

        
      

      - **lastName** *(string) --* 

        The updated last name of the user.

        
      

      - **middleName** *(string) --* 

        The middle name of the user (currently not used).

        
      

      - **suspended** *(boolean) --* 

        Indicates whether the user is suspended after the update.

        
      

      - **modified** *(integer) --* 

        The timestamp when the user was last modified, specified in epoch seconds.

        
      

      - **status** *(integer) --* 

        The user's status after the update.

        
      

      - **inviteCode** *(string) --* 

        The updated invite code for the user, if applicable.

        
      

      - **inviteExpiration** *(integer) --* 

        The expiration time of the user's invite code, specified in epoch seconds.

        
      

      - **codeValidation** *(boolean) --* 

        Indicates whether the user can be verified through a custom invite code.

        
  
  **Exceptions**
  
  *   :py:class:`WickrAdminAPI.Client.exceptions.ValidationError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.BadRequestError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.ResourceNotFoundError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.ForbiddenError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.UnauthorizedError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.InternalServerError`

  
  *   :py:class:`WickrAdminAPI.Client.exceptions.RateLimitError`

  