UpdateRelatedItem
Updates the content of a related item associated with a case. The following related item types are supported:
-
Comment - Update the text content of an existing comment
-
Custom - Update the fields of a custom related item. You can add, modify, and remove fields from a custom related item. There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.
Important things to know
-
When updating a Custom related item, all existing and new fields, and their associated values should be included in the request. Fields not included as part of this request will be removed.
-
If you provide a value for
performedBy.userArnyou must also have DescribeUser permission on the ARN of the user that you provide. -
System case fields cannot be used in a custom related item.
Endpoints: See Amazon Connect endpoints and quotas.
Request Syntax
PUT /domains/domainId/cases/caseId/related-items/relatedItemId HTTP/1.1
Content-type: application/json
{
"content": { ... },
"performedBy": { ... }
}
URI Request Parameters
The request uses the following URI parameters.
- caseId
-
A unique identifier of the case.
Length Constraints: Minimum length of 1. Maximum length of 500.
Required: Yes
- domainId
-
The unique identifier of the Cases domain.
Length Constraints: Minimum length of 1. Maximum length of 500.
Required: Yes
-
Unique identifier of a related item.
Length Constraints: Minimum length of 1. Maximum length of 500.
Required: Yes
Request Body
The request accepts the following data in JSON format.
- content
-
The content of a related item to be updated.
Type: RelatedItemUpdateContent object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: Yes
- performedBy
-
Represents the user who performed the update of the related item.
Type: UserUnion object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"associationTime": "string",
"content": { ... },
"createdBy": { ... },
"lastUpdatedUser": { ... },
"relatedItemArn": "string",
"relatedItemId": "string",
"tags": {
"string" : "string"
},
"type": "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.
- associationTime
-
Time at which the related item was associated with the case.
Type: Timestamp
- content
-
Represents the content of the updated related item.
Type: RelatedItemContent object
Note: This object is a Union. Only one member of this object can be specified or returned.
- createdBy
-
Represents the creator of the related item.
Type: UserUnion object
Note: This object is a Union. Only one member of this object can be specified or returned.
- lastUpdatedUser
-
Represents the last user that updated the related item.
Type: UserUnion object
Note: This object is a Union. Only one member of this object can be specified or returned.
-
The Amazon Resource Name (ARN) of the updated related item.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 500.
-
The unique identifier of the updated related item.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 500.
-
A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.
Type: String to string map
- type
-
Type of the updated related item.
Type: String
Valid Values:
Contact | Comment | File | Sla | ConnectCase | Custom
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- InternalServerException
-
We couldn't process your request because of an issue with the server. Try again later.
- retryAfterSeconds
-
Advice to clients on when the call can be safely retried.
HTTP Status Code: 500
- ResourceNotFoundException
-
We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.
- resourceId
-
Unique identifier of the resource affected.
- resourceType
-
Type of the resource affected.
HTTP Status Code: 404
- ThrottlingException
-
The rate has been exceeded for this API. Please try again after a few minutes.
HTTP Status Code: 429
- ValidationException
-
The request isn't valid. Check the syntax and try again.
HTTP Status Code: 400
Examples
This section provides examples for updating supported related item types.
Update Comment related item
Request to update a comment's text and content type:
{ "domainId": "[domain_id]", "caseId": "[case_id]", "relatedItemId": "[related_item_id]", "content": { "comment": { "body": "Updated comment text with additional details", "contentType": "Text/Plain" } } }
Update Custom related item
Request to update field values in a custom related item:
Note
System case fields cannot be used in a custom related item.
{ "domainId": "[domain_id]", "caseId": "[case_id]", "relatedItemId": "[related_item_id]", "content": { "custom": { "fields": [ { "id": "[field_id_1]", "value": { "stringValue": "Updated value for first field" } }, { "id": "[field_id_2]", "value": { "stringValue": "Updated value for second field" } }, { "id": "[field_id_3]", "value": { "stringValue": "Existing value that remains unchanged" } } ] } } }
Update with performedBy parameter
Request to update a comment and specify who performed the update:
{ "domainId": "[domain_id]", "caseId": "[case_id]", "relatedItemId": "[related_item_id]", "content": { "comment": { "body": "Updated comment text with additional details", "contentType": "Text/Plain" } }, "performedBy": { "userArn": "arn:aws:connect:us-west-2:[account_id]:instance/[instance_id]/agent/[agent_id]" } }
UpdateRelatedItem Response example
All successful UpdateRelatedItem requests return the updated related item:
{ "relatedItemArn": "arn:aws:cases:us-west-2:[account_id]:domain/[domain_id]/case/[case_id]/related-item/[related_item_id]", "relatedItemId": "[related_item_id]", "type": "Comment", "content": { "comment": { "body": "Updated comment text with additional details", "contentType": "Text/Plain" } }, "associationTime": "2024-11-22T01:35:46.329Z", "lastUpdatedUser": { "userArn": "arn:aws:connect:us-west-2:[account_id]:instance/[instance_id]/agent/[agent_id]" }, "createdBy": { "userArn": "arn:aws:connect:us-west-2:[account_id]:instance/[instance_id]/agent/[agent_id]" } }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: