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

************
stop_contact
************



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

  

  Ends the specified contact. Use this API to stop queued callbacks. It does not work for voice contacts that use the following initiation methods:

   

  
  * DISCONNECT
   
  * TRANSFER
   
  * QUEUE_TRANSFER
   
  * EXTERNAL_OUTBOUND
   
  * MONITOR
  

   

  Chat and task contacts can be terminated in any state, regardless of initiation method.

  

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


  **Request Syntax**
  ::

    response = client.stop_contact(
        ContactId='string',
        InstanceId='string',
        DisconnectReason={
            'Code': 'string'
        }
    )
    
  :type ContactId: string
  :param ContactId: **[REQUIRED]** 

    The ID of the contact.

    

  
  :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 DisconnectReason: dict
  :param DisconnectReason: 

    The reason a contact can be disconnected. Only Amazon Connect outbound campaigns can provide this field. For a list and description of all the possible disconnect reasons by channel (including outbound campaign voice contacts) see DisconnectReason under `ContactTraceRecord <https://docs.aws.amazon.com/connect/latest/adminguide/ctr-data-model.html#ctr-ContactTraceRecord>`__ in the *Amazon Connect Administrator Guide*.

    

  
    - **Code** *(string) --* 

      A code that indicates how the contact was terminated.

      

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidRequestException`

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

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

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

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

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

  