AssociateContactWithUser
Associates a queued contact with an agent.
Use cases
Following are common uses cases for this API:
-
Programmatically assign queued contacts to available users.
-
Leverage the IAM context key
connect:PreferredUserArn
to restrict contact association to specific preferred user.
Important things to know
-
Use this API with chat, email, and task contacts. It does not support voice contacts.
-
Use it to associate contacts with users regardless of their current state, including custom states. Ensure your application logic accounts for user availability before making associations.
-
It honors the IAM context key
connect:PreferredUserArn
to prevent unauthorized contact associations. -
It respects the IAM context key
connect:PreferredUserArn
to enforce authorization controls and prevent unauthorized contact associations. Verify that your IAM policies are properly configured to support your intended use cases. -
The service quota Queues per routing profile per instance applies to manually assigned queues, too. For more information about this quota, see Amazon Connect quotas in the Amazon Connect Administrator Guide.
Endpoints: See Amazon Connect endpoints and quotas.
Request Syntax
POST /contacts/InstanceId
/ContactId
/associate-user HTTP/1.1
Content-type: application/json
{
"UserId": "string
"
}
URI Request Parameters
The request uses the following URI parameters.
- ContactId
-
The identifier of the contact in this instance of Amazon Connect.
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
- InstanceId
-
The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
Request Body
The request accepts the following data in JSON format.
- UserId
-
The identifier for the user. This can be the ID or the ARN of the user.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Required: Yes
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
- 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
- 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
Examples
Example request to associate a queued contact with a user
Following is an example of associating a queued contact with a user.
POST https://connect.us-west-2.amazonaws.com/contacts/{InstanceId}/{ContactId}/associate-user HTTP/1.1 Content-type: application/json { "UserId": "string" }
Example response if the association succeeds
If the association succeeds an HTTP 200 OK response is returned.
HTTP/1.1 200
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: