- [HTTP request](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.request_body)
- [Response body](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.ListGroupsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#body.aspect)
- [Try it!](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups/list#try-it)

Lists the existing groups.

### HTTP request

`GET https://monitoring.googleapis.com/v3/{name}/groups`

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) whose groups are to be listed. The format is: projects/[PROJECT_ID_OR_NUMBER] |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` A positive number that is the maximum number of results to return. |
| `pageToken` | `string` If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. |
| An optional filter consisting of a single group name. The filters limit the groups returned based on their parent-child relationship with the specified group. If no filter is specified, all groups are returned. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `childrenOfGroup` | `string` A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns groups whose `parentName` field contains the group name. If no groups have this parent, the results are empty. |
| `ancestorsOfGroup` | `string` A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. |
| `descendantsOfGroup` | `string` A group name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns the descendants of the specified group. This is a superset of the results returned by the `childrenOfGroup` filter, and includes children-of-children, and so forth. |
| End of mutually exclusive fields. ||

### Request body

The request body must be empty.

### Response body

The `groups.list` response.

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

| JSON representation |
|---|
| ``` { "group": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups#Group`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `group[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups#Group`)`` The groups that match the specified filters. |
| `nextPageToken` | `string` If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `pageToken` in the next call to this method. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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