StartContactRecordingCommand

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  block.

Only voice recordings are supported at this time.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ConnectClient, StartContactRecordingCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, StartContactRecordingCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // StartContactRecordingRequest
  InstanceId: "STRING_VALUE", // required
  ContactId: "STRING_VALUE", // required
  InitialContactId: "STRING_VALUE", // required
  VoiceRecordingConfiguration: { // VoiceRecordingConfiguration
    VoiceRecordingTrack: "FROM_AGENT" || "TO_AGENT" || "ALL",
    IvrRecordingTrack: "ALL",
  },
};
const command = new StartContactRecordingCommand(input);
const response = await client.send(command);
// {};

StartContactRecordingCommand Input

Parameter
Type
Description
ContactId
Required
string | undefined

The identifier of the contact.

InitialContactId
Required
string | undefined

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

InstanceId
Required
string | undefined

The identifier of the Amazon Connect instance. You can find the instance ID  in the Amazon Resource Name (ARN) of the instance.

VoiceRecordingConfiguration
Required
VoiceRecordingConfiguration | undefined

The person being recorded.

StartContactRecordingCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

InvalidRequestException
client

The request is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ConnectServiceException
Base exception class for all service exceptions from Connect service.