BatchUpdateCase
Updates fields on multiple cases in a single request. All cases must belong to the same
domain. Set the title, status, and customer ID through the top-level title,
status, and customerId parameters, and set other fields through the
fields array.
Each case is processed independently. If some cases fail, the remaining cases are still
updated. To determine whether individual cases failed, inspect the failedCases
array in the response.
The entire request fails, and no cases are updated, in the following cases:
-
The specified domain doesn't exist.
-
A reference ID doesn't match any case in the domain.
-
The request contains duplicate case IDs.
-
The request doesn't specify any update. Provide at least one entry in
fields, or atitle,status, orcustomerId. -
A field identifier in
fieldsdoesn't resolve to a field in the domain, for example, an unknown field name. -
A field name contains a pipe (
|) or comma (,) character. -
fieldsincludestitle,status, orcustomerId.
Note
This operation uses the same IAM action as UpdateCase
(cases:UpdateCase). You can use the cases:IsBatchAction condition
key in IAM policies to allow or deny batch operations independently from single-case
operations.
Note
If you provide a value for performedBy.userArn, you must also have DescribeUser permission on the ARN of the user that you provide.
Endpoints: See Connect Customer endpoints and quotas.
Request Syntax
PUT /cases:batchUpdateCase HTTP/1.1
Content-type: application/json
{
"cases": [
{
"caseIdentifier": { ... }
}
],
"clientToken": "string",
"customerId": "string",
"domainId": "string",
"fields": [
{
"fieldIdentifier": { ... },
"value": { ... }
}
],
"performedBy": { ... },
"status": "string",
"title": "string"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- cases
-
The list of cases to update. All cases must belong to the same domain.
Type: Array of BatchUpdateCaseIdentifier objects
Array Members: Minimum number of 1 item. Maximum number of 100 items.
Required: Yes
- 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
. If you retry a request with the same client token, the service returns the original response instead of processing the request again. If you reuse a client token with different request parameters, the request fails with a
ConflictException.Type: String
Length Constraints: Minimum length of 0. Maximum length of 64.
Required: No
- customerId
-
The ARN of the customer profile to associate with all cases in the request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 500.
Pattern:
[a-zA-Z0-9/_\-:.]+Required: No
- domainId
-
The unique identifier of the Cases domain.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 500.
Required: Yes
- fields
-
An array of objects, each with a
fieldIdentifierand avalue. You can identify each field by its ID or by its name; identifying a field by name is supported only inBatchUpdateCase. The same field values are applied to every case in the request. This field must be present, but can be an empty list when you provide the top-leveltitle,status, orcustomerIdparameters. Do not includetitle,status, orcustomerIdin this list; set those values only through their top-level parameters. Duplicating them infieldsresults in a validation error.Type: Array of FieldValueInput objects
Array Members: Minimum number of 0 items. Maximum number of 220 items.
Required: Yes
- performedBy
-
The entity that performed the action.
Type: UserUnion object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: No
- status
-
The status to apply to all cases in the request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern:
[a-zA-Z0-9_\-\s]+Required: No
- title
-
The title to apply to all cases in the request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 500.
Pattern:
[\s\S]*Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"failedCases": [
{
"caseIdentifier": {
"caseId": "string",
"referenceId": "string",
"referenceNumber": "string"
},
"errorCode": "string",
"errorMessage": "string"
}
],
"successfulCases": [
{
"caseIdentifier": {
"caseId": "string",
"referenceId": "string",
"referenceNumber": "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.
- failedCases
-
The list of cases that were not updated. Each entry includes an error code and message. Possible error codes include:
-
CASE_NOT_FOUND- No case exists with the specified case ID. -
VALIDATION_ERROR- The request contains invalid input. -
CONFLICT- Another operation is in progress on the case, such as a concurrent update or a merge of the case into another case. -
THROTTLED- The request rate exceeded the allowed limit. -
ACCESS_DENIED- The caller lacks permission to perform the operation. -
SERVICE_QUOTA_EXCEEDED- The request exceeded a service quota. -
DOMAIN_NOT_FOUND- The case domain was deleted while the request was being processed. -
INTERNAL_ERROR- An unexpected error occurred on the server.
Type: Array of BatchUpdateCaseErrorEntry objects
-
- successfulCases
-
The list of cases that were successfully updated.
Type: Array of BatchUpdateCaseSuccessEntry objects
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- ConflictException
-
The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.
HTTP Status Code: 409
- 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
Request and Response example
This example illustrates one usage of BatchUpdateCase.
{ "domainId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "cases": [ { "caseIdentifier": { "caseId": "11111111-2222-3333-4444-EXAMPLE11111" } }, { "caseIdentifier": { "referenceId": "8G3KX7Q2M" } } ], "fields": [ { "fieldIdentifier": { "name": "Priority" }, "value": { "stringValue": "High" } } ], "status": "closed" }
{ "successfulCases": [ { "caseIdentifier": { "caseId": "11111111-2222-3333-4444-EXAMPLE11111" } } ], "failedCases": [ { "caseIdentifier": { "caseId": "11111111-2222-3333-4444-EXAMPLE22222", "referenceId": "8G3KX7Q2M" }, "errorCode": "CONFLICT", "errorMessage": "The case has a conflicting operation in progress" } ] }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: