<a id="cli-aws-connectcases-batch-update-case"></a>

# batch-update-case

## Description

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 a `title` , `status` , or `customerId` .
* A field identifier in `fields` doesn’t resolve to a field in the domain, for example, an unknown field name.
* A field name contains a pipe (`|` ) or comma (`,` ) character.
* `fields` includes `title` , `status` , or `customerId` .

#### NOTE
This operation uses the same IAM action as [UpdateCase](https://docs.aws.amazon.com/cases/latest/APIReference/API_UpdateCase.html) (`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](https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html) permission on the ARN of the user that you provide.

**Endpoints** : See [Connect Customer endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/connect_region.html) .

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/BatchUpdateCase)

## Synopsis

```
  batch-update-case
--domain-id <value>
--cases <value>
--fields <value>
[--performed-by <value>]
[--title <value>]
[--status <value>]
[--customer-id <value>]
[--client-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--domain-id` (string) [required]

> The unique identifier of the Cases domain.

> Constraints:

> * min: `1`
> * max: `500`

`--cases` (list) [required]

> The list of cases to update. All cases must belong to the same domain.

> Constraints:

> * min: `1`
> * max: `100`

> (structure)

> > Identifies a case to update in a `BatchUpdateCase` request.

> > caseIdentifier -> (tagged union structure) [required]

> > > The identifier of the case to update. Specify either the case ID or the reference ID.

> > > #### NOTE
> > > This is a Tagged Union structure. Only one of the following top level keys can be set: `caseId`, `referenceId`.

> > > caseId -> (string)

> > > > The unique identifier of the case.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `500`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > > referenceId -> (string)

> > > > The reference ID of the case. Reference IDs are unique within a domain, and uniqueness isn’t case sensitive.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `50`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

Shorthand Syntax:

```
caseIdentifier={caseId=string,referenceId=string} ...
```

JSON Syntax:

```json
[
  {
    "caseIdentifier": {
      "caseId": "string",
      "referenceId": "string"
    }
  }
  ...
]
```

`--fields` (list) [required]

> An array of objects, each with a `fieldIdentifier` and a `value` . You can identify each field by its ID or by its name; identifying a field by name is supported only in `BatchUpdateCase` . 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-level `title` , `status` , or `customerId` parameters. Do not include `title` , `status` , or `customerId` in this list; set those values only through their top-level parameters. Duplicating them in `fields` results in a validation error.

> Constraints:

> * min: `0`
> * max: `220`

> (structure)

> > A field and the value to set for it.

> > fieldIdentifier -> (tagged union structure) [required]

> > > The field to update, identified by field ID or field name.

> > > #### NOTE
> > > This is a Tagged Union structure. Only one of the following top level keys can be set: `id`, `name`.

> > > id -> (string)

> > > > The unique identifier of the field.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `500`

> > > name -> (string)

> > > > The name of the field.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `100`
> > > > * pattern: `.*[\S]`

> > value -> (tagged union structure) [required]

> > > The value to set for the field.

> > > #### NOTE
> > > This is a Tagged Union structure. Only one of the following top level keys can be set: `stringValue`, `doubleValue`, `booleanValue`, `emptyValue`, `userArnValue`.

> > > stringValue -> (string)

> > > > String value type.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `4100`

> > > doubleValue -> (double)

> > > > Can be either null, or have a Double number value type. Only one value can be provided.

> > > booleanValue -> (boolean)

> > > > Can be either null, or have a Boolean value type. Only one value can be provided.

> > > emptyValue -> (structure)

> > > > An empty value.

> > > userArnValue -> (string)

> > > > Represents the user that performed the audit.

Shorthand Syntax:

```
fieldIdentifier={id=string,name=string},value={stringValue=string,doubleValue=double,booleanValue=boolean,emptyValue={},userArnValue=string} ...
```

JSON Syntax:

```json
[
  {
    "fieldIdentifier": {
      "id": "string",
      "name": "string"
    },
    "value": {
      "stringValue": "string",
      "doubleValue": double,
      "booleanValue": true|false,
      "emptyValue": {

      },
      "userArnValue": "string"
    }
  }
  ...
]
```

`--performed-by` (tagged union structure)

> The entity that performed the action.

> #### NOTE
> This is a Tagged Union structure. Only one of the following top level keys can be set: `userArn`, `customEntity`.

> userArn -> (string)

> > Represents the Connect Customer ARN of the user.

> > Constraints:

> > * min: `1`
> > * max: `500`

> customEntity -> (string)

> > Any provided entity.

> > Constraints:

> > * min: `1`
> > * max: `500`
> > * pattern: `[a-zA-Z0-9_\-\.@:/ ]*[a-zA-Z0-9_\-\.@:/]`

Shorthand Syntax:

```
userArn=string,customEntity=string
```

JSON Syntax:

```json
{
  "userArn": "string",
  "customEntity": "string"
}
```

`--title` (string)

> The title to apply to all cases in the request.

> Constraints:

> * min: `1`
> * max: `500`
> * pattern: `[\s\S]*`

`--status` (string)

> The status to apply to all cases in the request.

> Constraints:

> * min: `1`
> * max: `100`
> * pattern: `[a-zA-Z0-9_\-\s]+`

`--customer-id` (string)

> The ARN of the customer profile to associate with all cases in the request.

> Constraints:

> * min: `1`
> * max: `500`
> * pattern: `[a-zA-Z0-9/_\-:.]+`

`--client-token` (string)

> A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/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` .

> Constraints:

> * min: `0`
> * max: `64`

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Output

successfulCases -> (list)

> The list of cases that were successfully updated.

> (structure)

> > Information about a case that was updated.

> > caseIdentifier -> (structure) [required]

> > > The identifiers of the updated case.

> > > caseId -> (string)

> > > > The unique identifier of the case.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `500`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > > referenceNumber -> (string)

> > > > The reference number of the case. Reference numbers aren’t guaranteed to be unique. `BatchUpdateCase` and `BatchCreateRelatedItem` don’t return this value.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `50`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > > referenceId -> (string)

> > > > The reference ID of the case. Cases created before reference IDs were available don’t have one.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `50`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

failedCases -> (list)

> 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.

> (structure)

> > Information about a case that wasn’t updated.

> > caseIdentifier -> (structure) [required]

> > > The identifiers of the case that wasn’t updated.

> > > caseId -> (string)

> > > > The unique identifier of the case.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `500`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > > referenceNumber -> (string)

> > > > The reference number of the case. Reference numbers aren’t guaranteed to be unique. `BatchUpdateCase` and `BatchCreateRelatedItem` don’t return this value.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `50`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > > referenceId -> (string)

> > > > The reference ID of the case. Cases created before reference IDs were available don’t have one.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `50`
> > > > * pattern: `[A-Za-z0-9\-._/:#=+-]*`

> > errorCode -> (string) [required]

> > > The error code. For possible values, see `failedCases` .

> > errorMessage -> (string) [required]

> > > A message that describes the error.
