# Method: projects.alerts.enumerateFacets

- [HTTP request](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.request_body)
- [Response body](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.EnumerateAlertFacetsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#body.aspect_1)
- [Facet](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#Facet)
  - [JSON representation](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#Facet.SCHEMA_REPRESENTATION)
- [FacetCount](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#FacetCount)
  - [JSON representation](https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#FacetCount.SCHEMA_REPRESENTATION)

alerts.enumerateFacets returns the facets and the number of alerts that meet the filter criteria and have that value for each facet.

### HTTP request

`GET https://threatintelligence.googleapis.com/v1beta/{parent=projects/*}/alerts:enumerateFacets`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Parent of the alerts. |

### Query parameters

| Parameters ||
|---|---|
| `filter` | `string` Optional. Filter on what alerts will be enumerated. |

### Request body

The request body must be empty.

### Response body

Response message for alerts.enumerateFacets.

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

| JSON representation |
|---|
| ``` { "facets": [ { object (`https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#Facet`) } ] } ``` |

| Fields ||
|---|---|
| `facets[]` | ``object (`https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#Facet`)`` List of facets and the counts. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `threatintelligence.alerts.list`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## Facet

Facet represents a sub element of a resource for filtering. The results from this method are used to populate the filterable facets in the UI.

| JSON representation |
|---|
| ``` { "facet": string, "facetCounts": [ { object (`https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#FacetCount`) } ], "facetType": string, "minValue": string, "maxValue": string, "totalCount": string } ``` |

| Fields ||
|---|---|
| `facet` | `string` Name of the facet. This is also the string that needs to be used in the filtering expression. |
| `facetCounts[]` | ``object (`https://docs.cloud.google.com/threat-intelligence/reference/rest/v1beta/projects.alerts/enumerateFacets#FacetCount`)`` List of counts for the facet (if categorical). |
| `facetType` | `string` The type of the facet. Options include "string", "int", "float", "bool", "enum", "timestamp", "user" and are useful to show the right sort of UI controls when building a AIP-160 style filtering string. |
| `minValue` | `string` Min value of the facet stringified based on type. This is only populated for facets that have a clear ordering, for types like enum it will be left empty. Timestamps will be formatted using RFC3339. |
| `maxValue` | `string` Max value of the facet stringified based on type. Will be populated and formatted the same as minValue. |
| `totalCount` | `string (https://developers.google.com/discovery/v1/type-format format)` Total number of records that contain this facet with ANY value. |

## FacetCount

FacetCount represents a count of records with each facet value.

| JSON representation |
|---|
| ``` { "value": string, "count": integer } ``` |

| Fields ||
|---|---|
| `value` | `string` Value of the facet stringified. Timestamps will be formatted using RFC3339. |
| `count` | `integer` Count of records with the value. |