

# Contact actions in the Amazon Connect Flow language
Contact actions

Contact actions are attempted only for flows that run in context of a contact. They generally result in contact data being manipulated in some way.

**Topics**
+ [CompleteOutboundCall](contact-actions-completeoutboundcall.md)
+ [

# CreateCase
](createcase.md)
+ [

# CreateTask
](createtask.md)
+ [

# CreateWisdomSession
](createwisdomsession.md)
+ [DequeueContactAndTransferToQueue](contact-actions-dequeuecontactandtransfertoqueue.md)
+ [

# EndFlowModuleExecution
](endflowmoduleexecution.md)
+ [

# GetCase
](getcase.md)
+ [

# InvokeFlowModule
](flow-language-actions-invoke-flow-module.md)
+ [StartOutboundChatContact](contact-actions-startoutboundchatcontact.md)
+ [TagContact](contact-actions-tagcontact.md)
+ [TransferContactToAgent](contact-actions-transfercontacttoagent.md)
+ [TransferContactToQueue](contact-actions-transfercontacttoqueue.md)
+ [UnTagContact](contact-actions-untagcontact.md)
+ [

# UpdateCase
](updatecase.md)
+ [UpdateContactAttributes](contact-actions-updatecontactattributes.md)
+ [UpdateContactCallbackNumber](contact-actions-updatecontactcallbacknumber.md)
+ [UpdateContactData](contact-actions-updatecontactdata.md)
+ [UpdateContactEventHooks](contact-actions-updatecontacteventhooks.md)
+ [UpdateContactMediaProcessing](contact-actions-updatecontactmediaprocessing.md)
+ [UpdateContactMediaStreamingBehavior](contact-actions-updatecontactmediastreamingbehavior.md)
+ [UpdateContactRecordingAndAnalyticsBehavior](contact-actions-updatecontactrecordingandanalyticsbehavior.md)
+ [UpdateContactRecordingBehavior](contact-actions-updatecontactrecordingbehavior.md)
+ [ResumeContact](contact-actions-updatecontactresumecontact.md)
+ [UpdateContactRoutingBehavior](contact-actions-updatecontactroutingbehavior.md)
+ [UpdateContactTargetQueue](contact-actions-updatecontacttargetqueue.md)
+ [UpdateContactTextToSpeechVoice](contact-actions-updatecontacttexttospeechvoice.md)
+ [UpdatePreviousContactParticipantState](contact-actions-updatepreviouscontactparticipantstate.md)

# CompleteOutboundCall
CompleteOutboundCall

When a flow is run before an outbound call is made as part of an outbound contact, this action calls the outbound destination. If this action is not used, the first participant action implicitly completes the outbound call. 

## Parameter object


```
""CallerId": { Optional, an override of the caller ID to present when calling. Is ignored when using VoiceConnectors
  "Number": The caller ID number to present when calling. Can either be fully static or a single valid JSONPath identifier
}
"VoiceConnector": { Optional, Configuration of the voice connector 
   "VoiceConnectorType": Only support "ChimeConnector". Must be defined statically.
   "VoiceConnectorArn": The ARN of the Voice Connector. Can be set statically or dynamically.
   "FromUser": The user who makes the call. Can be set statically or dynamically.
   "ToUser": The user who receives the call. Can be set statically or dynamically.
   "UserToUserInformation": Optional, SIP user-to-user information. Can be set statically or dynamically.
}
"ConnectionTimeLimitSeconds": Optional, Only used for Voice Connector use case. An integer between 1 and 600 
                                                         (inclusive) representing the number of seconds 
                                                        to wait for the voice connector to answer before 
                                                        canceling the call. Can be set statically or dynamically.
```

## Results and conditions


None.

## Errors


None.

## Restrictions


This action can be used only when the contact is in the process of making an outbound call, but has not yet called the outbound number. 

## Corresponding block in the UI


[Call phone number](https://docs.aws.amazon.com/connect/latest/adminguide/call-phone-number.html) 

# CreateCase


Creates a new case using an existing case template. Templates come with predefined fields, some of which are required and will appear in a side panel when you start. You can review and fill in the required fields, and optionally update any other available fields based on your needs. These fields are set up in your instance ahead of time. You can also choose to link a contact to the new case if needed.

## Parameter object


```
"Parameters": {
        "LinkContactToCase": "true" or "false", If set to true, cases will open automatically when the agent accepts the contact.
        "CaseTemplateId": A templateId aligned with the existing case templateName
        "CaseRequestFields": An optional map of case fields to be set. Keys should be fields from Cases domain. Values can be static or dynamic.
}
```

## Results and conditions


None.

## Errors

+ ContactNotLinked - If you specify to link the contact to case, then this error branch will appear. It might be that the contact was not linked after the case is retrieved (partial success/partial failure). If this happens, then the flow will follow this branch.
+ NoMatchingError - An error was encountered while trying to find the case. This may be due to a system error or how CreateCase is configured.

## Restrictions


None. This can be used in any type of flow and any channel.

## Corresponding block in the UI


[Flow block: Cases](https://docs.aws.amazon.com/connect/latest/adminguide/cases-block.html)

# CreateTask


Creates a new task to run an assigned flow.

## Parameter object


```
"Parameters": 
{
        "ContactFlowId": A flow ID or flow ARN. *Must be fully static or a single valid JSONPath identifier*,
        "Attributes": [Optional] { an Object that holds the attributes to be set. 
          "Key": "Value" Both the key and value may be defined statically or dynamically.
        },
        "Name": Name of the task that needs to be created. This is a string.,
        "Description": [Optional] Description of the task that needs to be created. This is a string.,
        "References": [Optional] { an Object that holds the references to be set. 
          "Type": "Value" Both the key and value may be defined statically or dynamically.
        },
        "DelaySeconds": [Optional] Time in seconds after which the task should be created. This is used to schedule the task by the agent. 
        The integer value between 1 and 518400 (6 days). If ScheduledTime is specified, this parameter may not be specified.
        "ScheduledTime": [Optional] The date and time at which the task should be created. If DelaySeconds is specified, this parameter may not be specified.
        "TaskTemplateId": [Optional] ID of the task template that will be used to create the task. This must be defined statically.
      }
}
```

## Results and conditions


None. No conditions are supported.

## Errors


NoMatchingError - if no other Error matches.

## Restrictions


This action is supported on all channels and in all contact flow types.

## Corresponding block in the UI


[Flow block: Create task](https://docs.aws.amazon.com/connect/latest/adminguide/create-task-block.html)

# CreateWisdomSession


Associates a Wisdom domain to a contact that is being executed in a Flow to enable real-time recommendations on the current contact.

## Parameter object


```
{
    "WisdomAssistantArn":  ARN for the Wisdom Assistant. May be specified statically or dynamically.
}
```

## Results and conditions


None. No conditions are supported.

## Errors


NoMatchingError - if no other Error matches.

## Restrictions


This action is only supported on the voice channel. This action can be used in all contact flow types.

## Corresponding block in the UI


[Flow block: Amazon Q in Connect](https://docs.aws.amazon.com/connect/latest/adminguide/wisdom.html)

# DequeueContactAndTransferToQueue
DequeueContactAndTransferToQueue

This action is a combination of a "Dequeue" action and a "TransferContactToQueue" action. This means that a contact in a queue is removed from the queue, a new contact segment is created with the existing contact as its previous contact, and the new contact is placed into the specified queue (referred to as "Queue-to-queue transfer"). If this contact has not been queued, is actively being joined to an agent, or has been routed to an agent, this action fails. 

## Parameter object


```
{
    "QueueId": [Optional] A queue ID or queue ARN. If AgentId is specified, this may not be specified. Must be either fully statically defined or a single, valid JSONPath identifier.
    "AgentId": [Optional] An agent ID or agent ARN, representing an agent queue. If QueueId is specified, this may not be specified. Must be either fully statically defined or a single, valid JSONPath identifier.
}
```

## Results and conditions


None.

## Errors

+ QueueAtCapacity - if the destination queue is at capacity and the contact cannot be queued within it.
+ NoMatchingError - if no other Error matches.

## Restrictions


This action is only supported in the customer queue flow. It is not supported in any other type of flow. 

## Corresponding block in the UI


Maps to [Transfer to queue](https://docs.aws.amazon.com/connect/latest/adminguide/transfer-to-queue.html) block but only when used in a Customer queue flow.

# EndFlowModuleExecution


Ends the current module execution without disconnecting the contact.

## Parameter object


```
{
                
}
```

## Results and conditions


None. No conditions are supported.

## Errors


None

## Restrictions


This action is available only in flow modules.

## Corresponding block in the UI


Return Block (not yet documented)

# GetCase


Searches all existing cases with the provided customer ID. Add request fields to filter by case fields. Specify the case fields to be returned in the response to persist in the context.

## Parameter object


```
{
    "LinkContactToCase": "true" or "false", If set to true, cases will open automatically when the agent accepts the contact.
   "GetLastUpdatedCase": "true" or "false", You can specify to get only the last updated case for any search criteria. 
    "CustomerId": "Customer's Id", Search all cases for this customer Id.
    "CaseRequestFields": An optional map of cases request fields. Keys should be fields from Cases domain. Values can be static or dynamic.
    "CaseResponseFields": [ ] An optional list of field names that should be persisted in the case namespace.
}
```

## Results and conditions


None.

## Errors

+ NoMatchingError - An error was encountered while trying to find the case. This may be due to a system error or how Get case is configured.
+ ContactNotLinked - If you specify to link the contact to case, then this error branch will appear. It might be that the contact was not linked after the case is retrieved (partial success/partial failure). If this happens, then the flow will follow this branch.
+ MultipleFound - Multiple cases are found with the search criteria.
+ NoneFound - No cases are found with the search criteria.

## Restrictions


None. This can be used in any type of flow and any channel.

## Corresponding block in the UI


[Flow block: Cases](https://docs.aws.amazon.com/connect/latest/adminguide/cases-block.html)

# InvokeFlowModule


Invokes a flow module. *Flow modules* are reusable sections of a flow. You use them to extract repeatable logic across your flows, and create common functions. For more information about flow modules, see [Flow modules for reusable functions](https://docs.aws.amazon.com/connect/latest/adminguide/contact-flow-modules.html), in the *Amazon Connect Administrator Guide*. 

## Parameter object


```
{
    "FlowModuleId": The flow module ID or flow module ARN to be invoked. May be defined statically or dynamically.
}
```

## Results and conditions


None.

## Errors


`NoMatchingError` if no other Error matches.

## Restrictions


This action is supported by all channels and only supports Inbound flow types.

## Corresponding block in the UI


[Flow block: Invoke module](https://docs.aws.amazon.com/connect/latest/adminguide/invoke-module-block.html).

# StartOutboundChatContact
StartOutboundChatContact

Initiate an outbound chat contact to a customer. Only SMS chats are supported. For more information, see the [StartOutboundChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html) in the *Amazon Connect API Reference*. 

## Parameter object


```
{
    "SourceEndpoint": {
        "Address": ConnectPhoneNumberArn of the SourceEndpoint,
        "Type": Type of the SourceEndpoint, currently only supports CONNECT_PHONENUMBER_ARN
    },
    "DestinationEndpoint": {
        "Address": E164 phone number of the DestinationEndpoint,
        "Type": Type of the DestinationEndpoint, currently only supports TELEPHONE_NUMBER
    },
    "ContactFlowArn": ContactFlowArn of the flow to be executed for the new outbound chat,
    "ContactSubtype": Subtype of the new chat contact, currently only supports connect:SMS,
    "InitialSystemMessage": [Optional] {
        "Content": content of the initial system message to be sent to the DestinationEndpoint
    },
    "RelatedContact": [Optional] Only supported value is CURRENT
}
```

## Results and conditions


None. No conditions are supported.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions

+ This action only supports `connect:SMS` as the **ContactSubtype** currently.
+ This action only supports `CONNECT_PHONENUMBER_ARN` as the Type of **SourceEndpoint** currently.
+ This action only supports `TELEPHONE_NUMBER` as the Type of **DestinationEndpoint** currently.

## Corresponding block in the UI


[Send message](https://docs.aws.amazon.com/connect/latest/adminguide/send-message.html.html) 

# TagContact
TagContact

Sets a collection of tag to the current contact. With this type of operation, either all tags are set or none are set. 

Each tag on a contact is a key-value pair, that is, it is composed of a key and a value. There are two types of tags: user-defined tags and system tags. You create a user-defined tag. A system tag is automatically created by AWS services. A system tag is prefixed with `aws:`. You cannot change it. 

The TagContact action parameters correspond to user-defined tags that are applied on a contact.

## Parameter object


```
{
"Tags": { an Object that holds the tags to be set.
       "Key1":"Value1" Both the key and value may be defined statically or dynamically.
        }
}
```

## Results and conditions


None.

## Errors


None.

## Restrictions


None. This can be used in any type of flow and any channel.

## Corresponding block in the UI


[Contact tags](https://docs.aws.amazon.com/connect/latest/adminguide/contact-tags-block.html) 

# TransferContactToAgent
TransferContactToAgent

Ends the current flow and transfers the customer to an agent. If the agent is already with someone else, the contact is disconnected. Transfer contact to agent works only for voice interactions. 

## Parameter object


No parameters are expected.

## Results and conditions


None.

## Errors


None.

## Restrictions


This action is supported in only transfer to agent and transfer to queue flows. 

## Corresponding block in the UI


[Transfer to agent](https://docs.aws.amazon.com/connect/latest/adminguide/transfer-to-agent-block.html) 

# TransferContactToQueue
TransferContactToQueue

This action places a contact that is not already in a queue into the contact's TargetQueue. If the contact has already been put into a queue (meaning that it is currently being routed to an agent, being joined to an agent, or is connected to an agent), the action fails. 

## Parameter object


No parameters are expected.

## Results and conditions


None.

## Errors

+ QueueAtCapacity - if the destination queue is at capacity and the contact cannot be queued within it.
+ NoMatchingError - if no other Error matches.

## Restrictions


This action is supported in inbound contact flows and transfer flows. It is not supported in whisper flows, customer queue flows, or hold flows. 

## Corresponding block in the UI


[Transfer to queue](https://docs.aws.amazon.com/connect/latest/adminguide/transfer-to-queue.html) 

# UnTagContact
UnTagContact

Removes a collection of tags on the current contact. With this type of operation, either all tags are set or none are set. 

You cannot remove system-defined tags. You can only remove already existing user-defined tags from a contact.

## Parameter object


```
{
"TagKeys": [ an Object that holds the tag-keys for the tags to be removed.
     "Key1" Key(s) can only be set statically.
      ]
}
```

## Results and conditions


None.

## Errors

+ Success - When un-tagging a contact is successful
+  NoMatchingError - if no other Error matches

## Restrictions


This action is supported across all the Amazon Connect media channels.

This action can be used in flows of all types.

## Corresponding block in the UI


[Contact tags](https://docs.aws.amazon.com/connect/latest/adminguide/contact-tags-block.html) 

# UpdateCase


Updates an existing case by providing the case’s id and the fields that should be updated.

## Parameter object


```
{
  “LinkContactToCase” : "true" or "false", If set to true, cases open automatically when the agent accepts the contact.
  “CaseId”: the unique identifier of the case
  “CaseRequestFields”: An optional map of case fields to be updated. Keys should be fields from the Cases domain. Values can be static or dynamic.
}
```

## Results and conditions


None.

## Errors

+ ContactNotLinked - If you specify to link the contact to case, then this error branch will appear. It might be that the contact was not linked after the case is retrieved (partial success/partial failure). If this happens, then the flow will follow this branch.
+ NoMatchingError - An error was encountered while trying to find the case. This may be due to a system error, or how Update case is configured.

## Restrictions


None. This can be used in any type of flow and any channel.

## Corresponding block in the UI


[Flow block: Cases](https://docs.aws.amazon.com/connect/latest/adminguide/cases-block.html)

# UpdateContactAttributes
UpdateContactAttributes

Sets a collection of contact attributes on either the current contact or the related contact. With this type of operation, either all attributes are set or none are set.

## Parameter object


```
{
    "Attributes": { an Object that holds the attributes to be set. 
        "Key": "Value" Both the key and value may be defined statically or dynamically.
    },
    "TargetContact": either "Current" or "Related". Must be defined statically.
}
```

## Results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


None. This can be used in any type of flow and any channel. 

## Corresponding block in the UI


[Set contact attributes](https://docs.aws.amazon.com/connect/latest/adminguide/set-contact-attributes.html) 

# UpdateContactCallbackNumber
UpdateContactCallbackNumber

Updates the contact callback number, which is the number used by the CreateCallbackContact action. This value defaults to the customer participant caller ID if this action is never used. 

## Parameter object


```
{
    "CallbackNumber": The callback number to set. Must be a single, valid JSONPath reference, and cannot be set statically. 
}
```

## Results and conditions


None.

## Errors

+ InvalidCallbackNumber - The callback number specified was not a valid (e.164) phone number.
+ CallbackNumberNotDialable - The callback number specified is not dialable by the instance.

## Restrictions


This is supported only in contact flows, transfer flows, and customer queue flows. This is not supported in whispers or hold flows. 

## Corresponding block in the UI


[Set callback number](https://docs.aws.amazon.com/connect/latest/adminguide/set-callback-number.html) 

# UpdateContactData
UpdateContactData

Sets a collection of connect defined attributes on specified contact. With this type of operation, either all attributes are set or none are set.

## Parameter object


```
"Parameters": 
{
        "Name": [Optional] The name of the contact. It is a string. May be set statically or dynamically.
        "Description": [Optional] The description of the contact. It is a string. 
        "LanguageCode": [Optional] The language to use for current contact.
        "CustomerId": [Optional] The customer id associated with the contact.
        "References": [Optional] { an Object that holds the references to be set. 
          "Type": "Value" Both the key and value may be defined statically or dynamically.
        },
        "IsVoiceIdStreamingEnabled": [Optional] Enable to start streaming audio from customer channel to Voice ID. It is a string. "TRUE" and "FALSE" are the only valid values.
        "IsVoiceAuthenticationEnabled": [Optional] Enable authentication by comparing voiceprint of the caller to the enrolled voiceprint of the claimed identity.It is a string. "TRUE" and "FALSE" are the only valid values.
        "IsFraudDetectionEnabled": [Optional] Enable detection for impersonation attempts and presence of known fraudsters. It is a string. "TRUE" and "FALSE" are the only valid values.
        "VoiceAuthenticationThreshold": [Optional] Threshold to validate against confidence score of a voice match. It is a string. Value must be between 0 and 100.
        "VoiceAuthenticationResponseTime": [Optional] Define required minimum caller speech seconds for voice authentication. It is a string. Value must be between 5 and 10.
        "FraudDetectionThreshold": [Optional] The threshold you set for fraud detection is used to measure risk. Scores higher than the threshold are reported as higher risk. Scores lower than the threshold are reported as lower risk. Raising the threshold lowers false positive rates (makes result more certain), but raises false negative rates. It is a string. Value must be between 0 and 100.
        "WatchlistId": [Optional] Identifier of watchlist to use when evaluating the voice session. It is a string. Value must be between 0 and 100.
        "WisdomSessionArn": [Optional] A session ARN provided by Amazon Connect Wisdom for agent assistance. It is a string.
        "TargetContact": [Required] Target contact on which given attributes should be set. It is a string. "Current" or "Related" are the only valid values.    
}
```

## Results and conditions


None. No conditions are supported.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This action is supported on all channels and in all flow types.

## Corresponding blocks in the UI

+  [Set contact attributes](https://docs.aws.amazon.com/connect/latest/adminguide/set-contact-attributes.html) 

# UpdateContactEventHooks
UpdateContactEventHooks

Sets one or more contact event hooks, which are flows associated with contact events, such as customer whisper or agent hold. For more information, see [Contact records data model](https://docs.aws.amazon.com/connect/latest/adminguide/ctr-data-model.html). The following event hooks are valid: 
+ AgentHold
+ AgentWhisper
+ CustomerHold
+ CustomerQueue
+ CustomerRemaining
+ CustomerWhisper
+ DefaultAgentUI
+ DisconnectAgentUI
+ PauseContact
+ ResumeContact

## Parameter object


```
{
    "EventHooks": { an Object that holds the event hooks to be set. Only one entry may be present in this map.
        "Key": "Value" - the event hook to be set where the key is the event type and the value is the flow ID or ARN to run when that event occurs. Keys must be defined statically. 
    }
}
```

## Results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This is supported in all types of flows. 

## Corresponding blocks in the UI

+  [Set customer queue flow](https://docs.aws.amazon.com/connect/latest/adminguide/set-customer-queue-flow.html) 
+ [Set event flow](https://docs.aws.amazon.com/connect/latest/adminguide/set-event-flow.html) 
+ [Set hold flow](https://docs.aws.amazon.com/connect/latest/adminguide/set-hold-flow.html) 
+ [Set whisper flow](https://docs.aws.amazon.com/connect/latest/adminguide/set-whisper-flow.html) 

# UpdateContactMediaProcessing
UpdateContactMediaProcessing

Allows customers to configure their own Lambda processor, which will be applied to in-flight messages.

## Parameter object


```
{
    "ChatProcessor": { // Configuration for bring-your-own-processor for chat channel.
        "ProcessingEnabled": either "True" or "False". Must be set statically. Determines whether to enable custom Lambda processing for chat messages.
        "LambdaProcessorARN": The ARN of the Lambda function to process chat messages. Must be set statically. Format: arn:aws:lambda:region:account-id:function:function-name
        "ChatProcessorSettings": { // An object that holds chat processor behavior settings
            "DeliverUnprocessedMessages": either "True" or "False". Must be set statically. Determines whether to deliver messages that fail Lambda processing.
        }
    }
}
```

## Results and conditions


None.

## Errors

+ **NoMatchingError** - if no other Error matches. Must always be defined.
+ **ChannelMismatch** - if the media channel that initiated the contact is not the same as the one defined in the action. As of now, only chat is supported in this action.

## Corresponding block in the UI


[Set recording, analytics and processing behavior](https://docs.aws.amazon.com/connect/latest/adminguide/set-recording-analytics-processing-behavior.html)

# UpdateContactMediaStreamingBehavior
UpdateContactMediaStreamingBehavior

Enables or disables contact media streaming for a set of participants. 

## Parameter object


```
{
    "MediaStreamingState": One of "Enabled" or "Disabled". Must be specified statically.
    "Participants": [  A list of participants to include in the stream if enabling the stream, or disable if disabling the stream
        {
            "ParticipantType": The type of participant to stream. Currently, only "Customer" is supported. Must be defined statically.
            "MediaDirections": [ ] A list of the directions of media to include in the stream - "From" and "To".  Must be defined statically.
        }
    ],
    "MediaStreamType": The type of media to enable or disable from the stream. Currently, only "Audio" is supported. Must be defined statically.
}
```

## Results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This is supported in contact flows, customer queue flows, transfer flows, and whisper flows. It is not supported in hold flows. 

This is supported only by the voice channel.

## Corresponding block in the UI


[Start media streaming](https://docs.aws.amazon.com/connect/latest/adminguide/start-media-streaming.html) and [Stop media streaming](https://docs.aws.amazon.com/connect/latest/adminguide/stop-media-streaming.html) 

# UpdateContactRecordingAndAnalyticsBehavior
UpdateContactRecordingAndAnalyticsBehavior

Sets contact recording behavior, including analysis behavior and which participants of the contact to record.

## Parameter object


```
{
    // Only ONE of the following channel behavior objects can be defined per configuration
    
    "ChatBehavior": { // Configuration for chat channel interactions
        "ChatAnalyticsBehavior": {
            "Enabled": either "True" or "False". Must be set statically.
            "AnalyticsLanguage": Must be one of languages supported by Contact Lens analysis. Can be set dynamically. Use the format xx-XX, for example, en-US for US English.
            "ConversationalAnalyticsRedactionConfiguration": { 
                "Enabled": either "True" or "False". Must be set statically. Determines whether to redact sensitive data in Contact Lens output.
                "RedactionResults": either "RedactedAndOriginal" or "RedactedOnly". Can be set dynamically. Determines whether to provide both versions or only redacted output.
                "RedactionMaskMode": either "EntityType" or "PII". Must be set statically.
                "RedactionEntities": [ ] a list of entity types to redact from the analytics output. Must be set statically.
            },
            "InFlightChatRedactionConfiguration": { // In-flight redaction for chat messages as they are sent. Only available for chat channel.
                "Enabled": either "True" or "False". Must be set statically. Determines whether to redact sensitive data in real-time chat messages.
                "RedactionMaskMode": either "EntityType" or "PII". Must be set statically.
                "RedactionEntities": [ ] a list of entity types to redact from chat messages in-flight. Must be set statically.
                "DeliverUnprocessedMessages": either "True" or "False". Must be set statically. Determines whether to deliver messages that fail redaction.
            },
            "AnalyticsModes": ["ContactLens"]. Can only be set to ContactLens for chat channel.
            "SentimentConfiguration": { // Optional parameter to enable sentiment analysis
                "Enabled": either "True" or "False". Must be set statically.
            },
            "SummaryConfiguration": { // Optional parameter to enable post-contact summary
                "SummaryModes": ["PostContact", "AutomatedInteraction"]. Can be set to "PostContact" or "AutomatedInteraction", or both for chat channel.
            }
        }
    },
    
    "VoiceBehavior": { // Configuration for voice channel interactions
        "VoiceRecordingBehavior": {
            "RecordedParticipants": [ ] a list of participants to record, chosen from "Agent" and "Customer". An empty list disables recording. Must be set statically.
            "IVRRecordingBehavior": Can be either "Enabled" or "Disabled". Must be set statically.
        },
        "VoiceAnalyticsBehavior": { // An object that holds voice analytics settings. Can only be set if RecordedParticipants contains both Agent and Customer.
            "Enabled": either "True" or "False". Must be set statically.
            "AnalyticsLanguage": Must be one of languages supported by Contact Lens analysis. Must be set statically. Use the format xx-XX, for example, en-US for US English.
            "ConversationalAnalyticsRedactionConfiguration": { // Redaction settings for analytics output (transcripts, audio files)
                "Enabled": either "True" or "False". Must be set statically. Determines whether to redact sensitive data in Contact Lens output.
                "RedactionResults": either "RedactedAndOriginal" or "RedactedOnly". Can be set dynamically. Determines whether to provide both versions or only redacted output.
                "RedactionMaskMode": either "EntityType" or "PII". Must be set statically.
                "RedactionEntities": [ ] a list of entity types to redact from the analytics output. Must be set statically.
            },
            "AnalyticsModes": ["RealTime", "AutomatedInteraction"]. Can be set to one of "RealTime" or "PostContact" and also can include "AutomatedInteraction" for voice channel.
            "SentimentConfiguration": { // Optional parameter to enable sentiment analysis
                "Enabled": either "True" or "False". Must be set statically.
            },
            "SummaryConfiguration": { // Optional parameter to enable post-contact summary
                "SummaryModes": ["PostContact", "AutomatedInteraction"]. Can be set to "PostContact" or "AutomatedInteraction", or both for voice channel. Must be set statically.
            }
        }
    },
    
    "ScreenRecordingBehavior": { // Optional configuration for agent screen recording. Can be defined independently or alongside any channel behavior.
        "ScreenRecordedParticipants": [ ] a list of participants for which to record their screen, can only include "Agent". An empty list disables screen recording. Must be set statically.
    }
}
```

**Notes**
+ `AnalyticsRedactionMaskMode`: Optional, String. Allowed values:
  + `PII`: All PII data is replaced with `[PII]`. For example, Jane Doe is replaced with `[PII]`
  + `EntityType`: Each PII entity is replaced with its type. For example, Jane Doe is replaced with `[NAME]`.
  + If no value is provided, the default `PII` is used.
+ `AnalyticsRedactionEntities`: Optional, Array of strings.
  + Valid values include: "BANK\$1ACCOUNT\$1NUMBER", "BANK\$1ROUTING", "CREDIT\$1DEBIT\$1NUMBER", "CREDIT\$1DEBIT\$1CVV", "CREDIT\$1DEBIT\$1EXPIRY", "INTERNATIONAL\$1BANK\$1ACCOUNT\$1NUMBER", "PIN", "SWIFT\$1CODE", "CA\$1HEALTH\$1NUMBER", "UK\$1NATIONAL\$1HEALTH\$1SERVICE\$1NUMBER", "CA\$1SOCIAL\$1INSURANCE\$1NUMBER", "SSN", "UK\$1NATIONAL\$1INSURANCE\$1NUMBER", "PASSPORT\$1NUMBER", "DRIVER\$1ID", "IN\$1AADHAAR", "NAME", "AGE", "EMAIL", "PHONE", "ADDRESS", "US\$1INDIVIDUAL\$1TAX\$1IDENTIFICATION\$1NUMBER", "UK\$1UNIQUE\$1TAXPAYER\$1REFERENCE\$1NUMBER", "IN\$1PERMANENT\$1ACCOUNT\$1NUMBER", "IN\$1NREGA", "AWS\$1ACCESS\$1KEY", "AWS\$1SECRET\$1KEY", "IP\$1ADDRESS", "MAC\$1ADDRESS", "PASSWORD", "URL", "USERNAME", "LICENSE\$1PLATE", "VEHICLE\$1IDENTIFICATION\$1NUMBER", "IN\$1VOTER\$1NUMBER", "DATE\$1TIME", "AGENT\$1DISPLAY\$1NAME", "CUSTOMER\$1DISPLAY\$1NAME", "ATTACHMENT\$1NAME".
  + An empty array is not allowed.
  + If `AnalyticsRedactionEntities` is not present, the default "redact all PII data" is used.
  + The following redaction entities are not supported for chat in-flight redaction:
    + IN\$1PERMANENT\$1ACCOUNT\$1NUMBER
    + IN\$1NREGA
    + IN\$1VOTER\$1NUMBER
    + IN\$1AADHAAR
    + DATE\$1TIME
    + CUSTOMER\$1DISPLAY\$1NAME
    + AGENT\$1DISPLAY\$1NAME
    + ATTACHMENT\$1NAME

For more information on sensitive data redaction, see [Enable redaction of sensitive data](https://docs.aws.amazon.com/connect/latest/adminguide/enable-analytics.html#enable-redaction) in the *Amazon Connect Administrator's Guide*.

For more information on in-flight chat redaction, see [Enable in-flight sensitive data redaction and message processing](https://docs.aws.amazon.com/connect/latest/adminguide/redaction-message-processing.html).

For a list of languages supported by Contact Lens post-call analysis, see [Contact Lens supported languages](https://docs.aws.amazon.com/connect/latest/adminguide/supported-languages.html). For the 4-character language code to use, see [Supported languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) in the *Amazon Transcribe Developer Guide*.

## Results and conditions


None.

## Errors

+ **NoMatchingError** - if no other Error matches. Must always be defined.
+ **ChannelMismatch** - if the media channel that initiated the contact is not the same as the one defined in the action. For screen recording, any channel other than voice, chat or tasks would result in this branch being taken. Must always be defined.
+ **InFlightRedactionConfigurationFailed** - if starting/stopping in-flight chat redaction fails. Must be defined if chat behavior is defined in action.

## Corresponding block in the UI


[Set recording, analytics and processing behavior](https://docs.aws.amazon.com/connect/latest/adminguide/set-recording-analytics-processing-behavior.html)

# UpdateContactRecordingBehavior
UpdateContactRecordingBehavior

Sets contact recording behavior, including analysis behavior and which participants of the contact to record. 

## Parameter object


```
{
    "RecordingBehavior": { an object that holds the recording behavior
        "RecordedParticipants": [ ] a list of participants to record, chosen from "Agent" and "Customer". An empty list disables recording. Must be set statically.
        "ScreenRecordedParticipants": [ ] a list of participants for which to record their screen, can only include "Agent". Must be set statically.
        "IVRRecordingBehavior": Can be either "Enabled" or "Disabled". Must be set statically.
    },    
    "AnalyticsBehavior": { an object that holds the analytics behavior. Can only be set if the RecordedParticipants contains both Agent and Customer
        "Enabled": either "True" or "False". Must be set statically.
        "AnalyticsLanguage": Must be one of languages supported by Contact Lens post-call analysis. Must be set statically. Use the format xx-XX, for example, en-US for US English.
        "AnalyticsRedactionBehavior": either Enabled or Disabled. Defaults to Disabled if not set. Determines whether to redact sensitive data, such as personal information, in the Contact Lens output file and audio recording.
        "AnalyticsRedactionResults": either "RedactedAndOriginal" or "RedactedOnly". Can be set dynamically. Determines whether the customer gets both the redacted and the original transcripts and audio files, or just the redacted transcripts and audio files.
        "AnalyticsRedactionMaskMode": either "EntityType" or "PII".  Must be set statically.
        "AnalyticsRedactionEntities": ["BANK_ACCOUNT_NUMBER", "BANK_ROUTING", "CREDIT_DEBIT_NUMBER", "CREDIT_DEBIT_CVV", "CREDIT_DEBIT_EXPIRY", "INTERNATIONAL_BANK_ACCOUNT_NUMBER", "PIN", "SWIFT_CODE", "CA_HEALTH_NUMBER", "UK_NATIONAL_HEALTH_SERVICE_NUMBER", "CA_SOCIAL_INSURANCE_NUMBER", "SSN", "UK_NATIONAL_INSURANCE_NUMBER", "PASSPORT_NUMBER", "DRIVER_ID", "IN_AADHAAR", "NAME", "AGE", "EMAIL", "PHONE", "ADDRESS", "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", "IN_PERMANENT_ACCOUNT_NUMBER", "IN_NREGA", "AWS_ACCESS_KEY", "AWS_SECRET_KEY", "IP_ADDRESS", "MAC_ADDRESS", "PASSWORD", "URL", "USERNAME", "LICENSE_PLATE", "VEHICLE_IDENTIFICATION_NUMBER", "IN_VOTER_NUMBER", "DATE_TIME", "AGENT_DISPLAY_NAME", "CUSTOMER_DISPLAY_NAME", "ATTACHMENT_NAME"],
        "ChannelConfiguration": {
          "Chat": {
            "AnalyticsModes": ["ContactLens"]  Can only be set to ContactLens
          },
         "Voice": {
            "AnalyticsModes": ["RealTime"]  Can be set to RealTime and PostContact
          } 
       },
        "SummaryConfiguration": {
            "SummaryModes": ["PostContact"] Optional parameter to enable post-contact summary. At present we only support "PostContact".
        },
         "SentimentConfiguration": {
            "Enabled": either "True" or "False". Must be set statically.
        }
    }
}
```

**Notes**
+ `AnalyticsRedactionMaskMode`: Optional, String. Allowed values:
  + `PII`: All PII data is replaced with `[PII]`. For example, Jane Doe is replaced with `[PII]`
  + `EntityType`: Each PII entity is replaced with its type. For example, Jane Doe is replaced with `[NAME]`.
  + If no value is provided, the default `PII` is used.
+ `AnalyticsRedactionEntities`: Optional, Array of strings. 
  + Valid values include: "BANK\$1ACCOUNT\$1NUMBER", "BANK\$1ROUTING", "CREDIT\$1DEBIT\$1NUMBER", "CREDIT\$1DEBIT\$1CVV", "CREDIT\$1DEBIT\$1EXPIRY", "INTERNATIONAL\$1BANK\$1ACCOUNT\$1NUMBER", "PIN", "SWIFT\$1CODE", "CA\$1HEALTH\$1NUMBER", "UK\$1NATIONAL\$1HEALTH\$1SERVICE\$1NUMBER", "CA\$1SOCIAL\$1INSURANCE\$1NUMBER", "SSN", "UK\$1NATIONAL\$1INSURANCE\$1NUMBER", "PASSPORT\$1NUMBER", "DRIVER\$1ID", "IN\$1AADHAAR", "NAME", "AGE", "EMAIL", "PHONE", "ADDRESS", "US\$1INDIVIDUAL\$1TAX\$1IDENTIFICATION\$1NUMBER", "UK\$1UNIQUE\$1TAXPAYER\$1REFERENCE\$1NUMBER", "IN\$1PERMANENT\$1ACCOUNT\$1NUMBER", "IN\$1NREGA", "AWS\$1ACCESS\$1KEY", "AWS\$1SECRET\$1KEY", "IP\$1ADDRESS", "MAC\$1ADDRESS", "PASSWORD", "URL", "USERNAME", "LICENSE\$1PLATE", "VEHICLE\$1IDENTIFICATION\$1NUMBER", "IN\$1VOTER\$1NUMBER", "DATE\$1TIME", "AGENT\$1DISPLAY\$1NAME", "CUSTOMER\$1DISPLAY\$1NAME", "ATTACHMENT\$1NAME".
  + An empty array is not allowed. 
  + If `AnalyticsRedactionEntities` is not present, the default "redact all PII data" is used.

For more information on sensitive data redaction, see [Enable redaction of sensitive data](https://docs.aws.amazon.com/connect/latest/adminguide/enable-redaction.html) in the *Amazon Connect Administrator's Guide*.

For a list of languages supported by Contact Lens post-call analysis, see [Contact Lens supported languages](https://docs.aws.amazon.com/connect/latest/adminguide/supported-languages-contact-lens.html). For the 4-character language code to use, see [Supported languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) in the *Amazon Transcribe Developer Guide*.

## Results and conditions


None.

## Errors


None.

## Restrictions


This is supported only in contact flows, transfer flows, outbound whispers, and customer queue flows. This is not supported in agent/customer whispers or hold flows. 

Analytics is only supported by the voice channel.

## Corresponding block in the UI


[Set recording and analytics behavior](https://docs.aws.amazon.com/connect/latest/adminguide/set-recording-behavior.html) 

# ResumeContact
ResumeContact

Resumes a contact from a paused state.

## Parameter object


No parameters are expected.

## Results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


None. This action can be used everywhere.

# UpdateContactRoutingBehavior
UpdateContactRoutingBehavior

Updates the contact's routing details. This can move the contact forward or backward in queue, or specify a queue priority. 

## Parameter object


```
{
  "QueuePriority": An integer that represents the queue priority to be applied to the contact (lower priorities are routed preferentially). Cannot be specified if QueueTimeAdjustmentSeconds is specified. Must be statically defined, must be larger than zero, and a valid integer value.
  "QueueTimeAdjustmentSeconds": An integer that represents the queue time adjust to be applied to the contact, in seconds (longer / larger queue times are routed preferentially). Cannot be specified if QueuePriority is specified. Must be statically defined and a valid integer value.
}
```

## Results and conditions


None.

## Errors


None.

## Restrictions


This is supported only in inbound contact flows. It is not supported in transfer flows, whisper flows, customer queue flows, or hold flows. 

## Corresponding block in the UI


[Change routing priority / age](https://docs.aws.amazon.com/connect/latest/adminguide/change-routing-priority.html) 

# UpdateContactTargetQueue
UpdateContactTargetQueue

Sets the contact's TargetQueue. This is the queue is used by all other instructions that check a queue implicitly, and for TransferContactToQueue. 

## Parameter object


```
{
  "QueueId": [Optional] A queue ID or queue ARN. If AgentId is specified, this may not be specified. This must be either defined fully statically or as a single valid JSONPath identifier.
  "AgentId": [Optional] An agent ID or agent ARN, representing an agent queue. If QueueId is specified, this may not be specified. This must be either defined fully statically or as a single valid JSONPath identifier.
}
```

## Results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This action is supported only in inbound contact flows and transfer flows. It is not supported in whisper flows, hold flows, or customer queue flows. 

## Corresponding block in the UI


[Set working queue](https://docs.aws.amazon.com/connect/latest/adminguide/set-working-queue.html) 

# UpdateContactTextToSpeechVoice
UpdateContactTextToSpeechVoice

Updates the Amazon Polly voice used by text-to-speech for voice contacts (message with text-to-speech, or Amazon Lex bots). This defaults to Joanna if this action is never run. 

## Parameter object


```
{
  "TextToSpeechVoice": A string holding the name of an Amazon Polly voice. May be defined statically or dynamically. If this is an invalid text to speech voice, text to speech is no longer function for this contact.
  "TextToSpeechEngine": The engine associated with the Amazon Polly voice. May be defined statically or dynamically.
  "TextToSpeechStyle" : The speech style associated with the Amazon Polly Voice. It could be None, Coversational, or Newscaster. May be defined statically or dynamically.
}
```

## Results and conditions


Results in error if voice or engine are invalid, or if the selected voice does not support the selected engine.

## Errors

+ NoMatchingError - if no other Error matches. Must always be defined.

## Restrictions


None. This action is supported in all flow types, and across all channels. 

## Corresponding block in the UI


[Set voice](https://docs.aws.amazon.com/connect/latest/adminguide/set-voice.html) 

# UpdatePreviousContactParticipantState
UpdatePreviousContactParticipantState

This action is primarily used to prevent previous participants on the contact from observing the contact. Common use cases are disconnecting the agent that initiates a transfer when they transfer a contact to a secure destination, or putting the agent on hold when transferring to a quick connect that securely gathers customer input such as credit card numbers. 

## Parameter object


```
{
    "PreviousContactParticipantState": One of ["AgentOnHold", "CustomerOnHold", "OffHold"], which are only supported for voice contacts. 
}
```

## Execution results and conditions


None.

## Errors

+ NoMatchingError - if no other Error matches.

## Restrictions


This action is supported only in inbound contact flows and transfer flows. 

## Corresponding block in the UI


[Hold customer or agent](https://docs.aws.amazon.com/connect/latest/adminguide/hold-customer-agent.html) 