CreateRelatedItem
Creates a related item (comments, tasks, and contacts) and associates it with a case.
There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.
Use cases
Following are examples of related items that you may want to associate with a case:
- 
         Related contacts, such as calls, chats, emails tasks 
- 
         Comments, for agent notes 
- 
         SLAs, to capture target resolution goals 
- 
         Cases, to capture related Amazon Connect Cases 
- 
         Files, such as policy documentation or customer-provided attachments 
- 
         Custom related items, which provide flexibility for you to define related items that such as bookings, orders, products, notices, and more 
Important things to know
- 
         If you are associating a contact to a case by passing in Contactfor atype, you must have DescribeContact permission on the ARN of the contact that you provide incontent.contact.contactArn.
- 
         A Related Item is a resource that is associated with a case. It may or may not have an external identifier linking it to an external resource (for example, a contactArn). All Related Items have their own internal identifier, therelatedItemArn. Examples of related items includecommentsandcontacts.
- 
         If you provide a value for performedBy.userArnyou must also have DescribeUser permission on the ARN of the user that you provide.
- 
         The typefield is reserved for internal use only.
Endpoints: See Amazon Connect endpoints and quotas.
Request Syntax
POST /domains/domainId/cases/caseId/related-items/ HTTP/1.1
Content-type: application/json
{
   "content": { ... },
   "performedBy": { ... },
   "type": "string"
}URI Request Parameters
The request uses the following URI parameters.
Request Body
The request accepts the following data in JSON format.
- content
- 
               The content of a related item to be created. Type: RelatedItemInputContent object Note: This object is a Union. Only one member of this object can be specified or returned. Required: Yes 
- performedBy
- 
               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. Required: No 
- type
- 
               The type of a related item. Type: String Valid Values: Contact | Comment | File | Sla | ConnectCase | CustomRequired: Yes 
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
   "relatedItemArn": "string",
   "relatedItemId": "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.
- 
               The Amazon Resource Name (ARN) of the related item. Type: String Length Constraints: Minimum length of 1. Maximum length of 500. 
- 
               The unique identifier of the related item. Type: String Length Constraints: Minimum length of 1. Maximum length of 500. 
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 
- ServiceQuotaExceededException
- 
               The service quota has been exceeded. For a list of service quotas, see Amazon Connect Service Quotas in the Amazon Connect Administrator Guide. HTTP Status Code: 402 
- 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 supported related item types.
Type: Comment
Request:
{ "content": { "comment": { "body": "Hello World!", "contentType": "Text/Plain" } }, "type": "Comment" }
Type: Sla
Request:
- 
               nameis the descriptive name for the SLA
- 
               targetSlaMinutesis the time in minutes within which the SLA must be met
- 
               typeonly supports "CaseField"
- 
               fieldIdonly supports "status" field
- 
               targetFieldValuesis the value that the field must reach for the SLA to be met and only supports one value.
{ "content": { "sla": { "slaInputConfiguration": { "name": "Resolution SLA", "targetSlaMinutes": 10, "type": "CaseField", "fieldId": "status", "targetFieldValues": [ { "stringValue": "closed" } ] } } }, "type": "Sla" }
Type: File
Request:
{ "content": { "file": { "fileArn": "[fileArn]" } }, "type": "File" }
Type: Contact
Request to associate a customer contact with a case:
{ "content": { "contact": { "contactArn": "[contactArn]" } }, "type": "Contact" }
Type: Custom
Request to associate a custom defined related item with a case:
Note
System case fields cannot be used in a custom related item.
{ "content": { "custom": { "fields": [ { "id": "[field_id_1]", "value": { "stringValue": "Billing" }, { "id": "[field_id_2]", "value": { "stringValue": "Incorrect Shipping Address" } } ], } }, "type": "Custom" }
Type: ConnectCase
Request to associate another Amazon Connect case with a case:
{ "content": { "connectCase": { "caseId": "[caseId]" } }, "type": "ConnectCase" }
CreateRelatedItem Response example
All successful CreateRelatedItem requests return the same response structure:
{ "relatedItemArn": "arn:aws:cases:us-west-2:[account_id]:domain/[domain_id]/case/[case_id]/related-item/[related_item_id]", "relatedItemId": "[related_item_id]" }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: