# Method: matters.holds.addHeldAccounts

- [HTTP request](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.response_body)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.AddHeldAccountsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#body.aspect)
- [AddHeldAccountResult](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#AddHeldAccountResult)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#AddHeldAccountResult.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#try-it)

Adds accounts to a hold. Returns a list of accounts that have been successfully added. Accounts can be added only to an existing account-based hold.

### HTTP request

`POST https://vault.googleapis.com/v1/matters/{matterId}/holds/{holdId}:addHeldAccounts`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `matterId` | `string` The matter ID. |
| `holdId` | `string` The hold ID. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "emails": [ string ], "accountIds": [ string ] } ``` |

| Fields ||
|---|---|
| `emails[]` | `string` A comma-separated list of the emails of the accounts to add to the hold. Specify either **emails** or **accountIds**, but not both. |
| `accountIds[]` | `string` A comma-separated list of the account IDs of the accounts to add to the hold. Specify either **emails** or **accountIds**, but not both. |

### Response body

Response for batch create held accounts.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "responses": [ { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#AddHeldAccountResult`) } ] } ``` |

| Fields ||
|---|---|
| `responses[]` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts#AddHeldAccountResult`)`` The list of responses, in the same order as the batch request. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/ediscovery`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).

## AddHeldAccountResult

The status of each account creation, and the **HeldAccount**, if successful.

| JSON representation |
|---|
| ``` { "account": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds.accounts#HeldAccount`) }, "status": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/operations#Status`) } } ``` |

| Fields ||
|---|---|
| `account` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds.accounts#HeldAccount`)`` Returned when the account was successfully created. |
| `status` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/operations#Status`)`` Reports the request status. If it failed, returns an error message. |