# Method: projects.locations.keys.list

- [HTTP request](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.request_body)
- [Response body](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.ListKeysResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys/list#try-it)

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is `global`.

### HTTP request

`GET https://apikeys.googleapis.com/v2/{parent=projects/*/locations/*}/keys`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. Lists all API keys associated with this project. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `apikeys.keys.list` |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. Specifies the maximum number of results to be returned at a time. |
| `pageToken` | `string` Optional. Requests a specific page of results. |
| `showDeleted` | `boolean` Optional. Indicate that keys deleted in the past 30 days should also be returned. |

### Request body

The request body must be empty.

### Response body

Response message for `keys.list` method.

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

| JSON representation |
|---|
| ``` { "keys": [ { object (`https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `keys[]` | ``object (`https://docs.cloud.google.com/api-keys/docs/reference/rest/v2/projects.locations.keys#Key`)`` A list of API keys. |
| `nextPageToken` | `string` The pagination token for the next page of results. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform.read-only`
- `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:

- `apikeys.keys.list`

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