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

****************
transfer_contact
****************



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

  

  Transfers ``TASK`` or ``EMAIL`` contacts from one agent or queue to another agent or queue at any point after a contact is created. You can transfer a contact to another queue by providing the flow which orchestrates the contact to the destination queue. This gives you more control over contact handling and helps you adhere to the service level agreement (SLA) guaranteed to your customers.

   

  Note the following requirements:

   

  
  * Transfer is only supported for ``TASK`` and ``EMAIL`` contacts.
   
  * Do not use both ``QueueId`` and ``UserId`` in the same call.
   
  * The following flow types are supported: Inbound flow, Transfer to agent flow, and Transfer to queue flow.
   
  * The ``TransferContact`` API can be called only on active contacts.
   
  * A contact cannot be transferred more than 11 times.
  

  

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


  **Request Syntax**
  ::

    response = client.transfer_contact(
        InstanceId='string',
        ContactId='string',
        QueueId='string',
        UserId='string',
        ContactFlowId='string',
        ClientToken='string'
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. 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.

    

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

    The identifier of the contact in this instance of Amazon Connect.

    

  
  :type QueueId: string
  :param QueueId: 

    The identifier for the queue.

    

  
  :type UserId: string
  :param UserId: 

    The identifier for the user. This can be the ID or the ARN of the user.

    

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

    The identifier of the flow.

    

  
  :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**

    
    ::

      {
          'ContactId': 'string',
          'ContactArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ContactId** *(string) --* 

        The identifier of the contact in this instance of Amazon Connect.

        
      

      - **ContactArn** *(string) --* 

        The Amazon Resource Name (ARN) of the contact.

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

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

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

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

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

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

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

  