:doc:`Connect <../../connect>` / Client / update_phone_number

*******************
update_phone_number
*******************



.. py:method:: Connect.Client.update_phone_number(**kwargs)

  

  Updates your claimed phone number from its current Amazon Connect instance or traffic distribution group to another Amazon Connect instance or traffic distribution group in the same Amazon Web Services Region.

   

  .. warning::

     

    After using this API, you must verify that the phone number is attached to the correct flow in the target instance or traffic distribution group. You need to do this because the API switches only the phone number to a new instance or traffic distribution group. It doesn't migrate the flow configuration of the phone number, too.

     

    You can call `DescribePhoneNumber <https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html>`__ API to verify the status of a previous `UpdatePhoneNumber <https://docs.aws.amazon.com/connect/latest/APIReference/API_UpdatePhoneNumber.html>`__ operation.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/UpdatePhoneNumber>`_  


  **Request Syntax**
  ::

    response = client.update_phone_number(
        PhoneNumberId='string',
        TargetArn='string',
        InstanceId='string',
        ClientToken='string'
    )
    
  :type PhoneNumberId: string
  :param PhoneNumberId: **[REQUIRED]** 

    A unique identifier for the phone number.

    

  
  :type TargetArn: string
  :param TargetArn: 

    The Amazon Resource Name (ARN) for Amazon Connect instances or traffic distribution groups that phone number inbound traffic is routed through. You must enter ``InstanceId`` or ``TargetArn``.

    

  
  :type InstanceId: string
  :param InstanceId: 

    The identifier of the Amazon Connect instance that phone numbers are claimed to. You can `find the instance ID <https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html>`__ in the Amazon Resource Name (ARN) of the instance. You must enter ``InstanceId`` or ``TargetArn``.

    

  
  :type ClientToken: string
  :param ClientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see `Making retries safe with idempotent APIs <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/>`__.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'PhoneNumberId': 'string',
          'PhoneNumberArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PhoneNumberId** *(string) --* 

        A unique identifier for the phone number.

        
      

      - **PhoneNumberArn** *(string) --* 

        The Amazon Resource Name (ARN) of the phone number.

        
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`Connect.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Connect.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Connect.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Connect.Client.exceptions.ResourceInUseException`

  
  *   :py:class:`Connect.Client.exceptions.IdempotencyException`

  
  *   :py:class:`Connect.Client.exceptions.AccessDeniedException`

  