# Method: matters.count

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

Counts the accounts processed by the specified query.

### HTTP request

`POST https://vault.googleapis.com/v1/matters/{matterId}:count`

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

### Path parameters

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

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "query": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query`) }, "view": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/matters/count#CountResultView`) } ``` |

| Fields ||
|---|---|
| `query` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query`)`` The search query. |
| `view` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/matters/count#CountResultView`)`` Sets the granularity of the count results. |

### Response body

If successful, the response body contains an instance of `https://developers.google.com/workspace/vault/reference/rest/v1/operations#Operation`.

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

## CountResultView

The possible granularity level of a count result.

| Enums ||
|---|---|
| `COUNT_RESULT_VIEW_UNSPECIFIED` | Default. Same as **TOTAL_COUNT**. |
| `TOTAL_COUNT` | Response includes counts of the total accounts, queried accounts, matching accounts, non-queryable accounts, and queried account errors. |
| `ALL` | Response includes the same details as **TOTAL_COUNT**, plus additional account breakdown. |