:doc:`Organizations <../../organizations>` / Client / move_account

************
move_account
************



.. py:method:: Organizations.Client.move_account(**kwargs)

  

  Moves an account from its current source parent root or organizational unit (OU) to the specified destination parent root or OU.

   

  You can only call this operation from the management account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/MoveAccount>`_  


  **Request Syntax**
  ::

    response = client.move_account(
        AccountId='string',
        SourceParentId='string',
        DestinationParentId='string'
    )
    
  :type AccountId: string
  :param AccountId: **[REQUIRED]** 

    ID for the account that you want to move.

     

    The `regex pattern <http://wikipedia.org/wiki/regex>`__ for an account ID string requires exactly 12 digits.

    

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

    ID for the root or organizational unit that you want to move the account from.

     

    The `regex pattern <http://wikipedia.org/wiki/regex>`__ for a parent ID string requires one of the following:

     

    
    * **Root** - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
     
    * **Organizational unit (OU)** - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
    

    

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

    ID for the root or organizational unit that you want to move the account to.

     

    The `regex pattern <http://wikipedia.org/wiki/regex>`__ for a parent ID string requires one of the following:

     

    
    * **Root** - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
     
    * **Organizational unit (OU)** - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
    

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`Organizations.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Organizations.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Organizations.Client.exceptions.SourceParentNotFoundException`

  
  *   :py:class:`Organizations.Client.exceptions.DestinationParentNotFoundException`

  
  *   :py:class:`Organizations.Client.exceptions.DuplicateAccountException`

  
  *   :py:class:`Organizations.Client.exceptions.AccountNotFoundException`

  
  *   :py:class:`Organizations.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Organizations.Client.exceptions.ConcurrentModificationException`

  
  *   :py:class:`Organizations.Client.exceptions.AWSOrganizationsNotInUseException`

  
  *   :py:class:`Organizations.Client.exceptions.ServiceException`

  

  **Examples**

  The following example shows how to move a member account from the root to an OU:/n/n
  ::

    response = client.move_account(
        AccountId='333333333333',
        DestinationParentId='ou-examplerootid111-exampleouid111',
        SourceParentId='r-examplerootid111',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  