StartAssistantContact
Starts a chat contact with an AI agent.
Use the returned ParticipantToken with the CreateParticipantConnection operation.
For more information about chat, see the following topics in the Connect Customer Administrator Guide:
Request Syntax
PUT /contact/assistant HTTP/1.1
Content-type: application/json
{
"AiAgent": {
"AiAgentId": "string"
},
"Attributes": {
"string" : "string"
},
"ClientToken": "string",
"InitialMessage": {
"Content": "string",
"ContentType": "string"
},
"InstanceId": "string",
"ParticipantDetails": {
"DisplayName": "string"
},
"PersistentChat": {
"RehydrationType": "string",
"SourceContactId": "string"
},
"RelatedContactId": "string"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- AiAgent
-
The AI agent configuration for this contact.
Type: AiAgentInput object
Required: Yes
- Attributes
-
A map of key-value pairs to associate with the contact. We make these attributes available to flows as standard contact attributes.
You can provide up to 32,768 UTF-8 bytes across all key-value pairs for each contact.
Type: String to string map
Key Length Constraints: Minimum length of 1. Maximum length of 32767.
Value Length Constraints: Minimum length of 0. Maximum length of 32767.
Required: No
- ClientToken
-
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs
. Type: String
Length Constraints: Maximum length of 500.
Required: No
- InitialMessage
-
The initial message to send to the newly created chat.
Type: ChatMessage object
Required: No
- InstanceId
-
The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
- ParticipantDetails
-
The display name and other details that identify the chat participant.
Type: ParticipantDetails object
Required: Yes
- PersistentChat
-
The configuration that enables persistent chat. For more information about persistent chat and its use cases, see Enable persistent chat.
Type: PersistentChat object
Required: No
- RelatedContactId
-
The identifier of an Connect Customer contact related to the new assistant contact.
Note
You cannot provide both
RelatedContactIdandPersistentChat.Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"ContactId": "string",
"ContinuedFromContactId": "string",
"ParticipantId": "string",
"ParticipantToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ContactId
-
The identifier of the contact within the Connect Customer instance.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
- ContinuedFromContactId
-
The identifier of the contact from which the chat continues, returned only for persistent chats.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
- ParticipantId
-
The identifier of the chat participant. The participant identifier remains the same throughout the chat lifecycle.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
- ParticipantToken
-
The token that the chat participant uses with the CreateParticipantConnection operation. The token remains valid for the lifetime of the chat participant.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1000.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
- Message
-
The message.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
- Message
-
The message about the parameters.
HTTP Status Code: 400
- InvalidRequestException
-
The request is not valid.
- Message
-
The message about the request.
- Reason
-
Reason why the request was invalid.
HTTP Status Code: 400
- LimitExceededException
-
The allowed limit for the resource has been exceeded.
- Message
-
The message about the limit.
HTTP Status Code: 429
- ResourceNotFoundException
-
The specified resource was not found.
- Message
-
The message about the resource.
HTTP Status Code: 404
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: