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

***********************
start_contact_recording
***********************



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

  

  Starts recording the contact:

   

  
  * If the API is called *before* the agent joins the call, recording starts when the agent joins the call.
   
  * If the API is called *after* the agent joins the call, recording starts at the time of the API call.
  

   

  StartContactRecording is a one-time action. For example, if you use StopContactRecording to stop recording an ongoing call, you can't use StartContactRecording to restart it. For scenarios where the recording has started and you want to suspend and resume it, such as when collecting sensitive information (for example, a credit card number), use SuspendContactRecording and ResumeContactRecording.

   

  You can use this API to override the recording behavior configured in the `Set recording behavior <https://docs.aws.amazon.com/connect/latest/adminguide/set-recording-behavior.html>`__ block.

   

  Only voice recordings are supported at this time.

  

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


  **Request Syntax**
  ::

    response = client.start_contact_recording(
        InstanceId='string',
        ContactId='string',
        InitialContactId='string',
        VoiceRecordingConfiguration={
            'VoiceRecordingTrack': 'FROM_AGENT'|'TO_AGENT'|'ALL',
            'IvrRecordingTrack': 'ALL'
        }
    )
    
  :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.

    

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

    The identifier of the contact. This is the identifier of the contact associated with the first interaction with the contact center.

    

  
  :type VoiceRecordingConfiguration: dict
  :param VoiceRecordingConfiguration: **[REQUIRED]** 

    The person being recorded.

    

  
    - **VoiceRecordingTrack** *(string) --* 

      Identifies which track is being recorded.

      

    
    - **IvrRecordingTrack** *(string) --* 

      Identifies which IVR track is being recorded.

       

      One and only one of the track configurations should be presented in the request.

      

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

    
    ::

      {}
      
    **Response Structure**

    

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

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

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

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

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

  