# Method: projects.secrets.list

- [HTTP request](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.request_body)
- [Response body](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.ListSecretsResponse.SCHEMA_REPRESENTATION)
- [Authorization Scopes](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.aspect)
- [Try it!](https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#try-it)

Lists `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret`.

### HTTP request

`GET https://secretmanager.googleapis.com/v1beta1/{parent=projects/*}/secrets`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The resource name of the project associated with the `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret`, in the format `projects/*`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `secretmanager.secrets.list` |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. The maximum number of results to be returned in a single page. If set to 0, the server decides the number of results to return. If the number is greater than 25000, it is capped at 25000. |
| `pageToken` | `string` Optional. Pagination token, returned earlier via `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.ListSecretsResponse.FIELDS.next_page_token`. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains data with the following structure:
Response message for `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#google.cloud.secrets.v1beta1.SecretManagerService.ListSecrets`.

| JSON representation |
|---|
| ``` { "secrets": [ { object (`https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret`) } ], "nextPageToken": string, "totalSize": integer } ``` |

| Fields ||
|---|---|
| `secrets[]` | ``object (`https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret`)`` The list of `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret` sorted in reverse by createTime (newest first). |
| `nextPageToken` | `string` A token to retrieve the next page of results. Pass this value in `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets/list#body.QUERY_PARAMETERS.page_token` to retrieve the next page. |
| `totalSize` | `integer` The total number of `https://docs.cloud.google.com/secret-manager/docs/reference/rest/v1beta1/projects.secrets#Secret`. |

### Authorization Scopes

Requires the following OAuth scope:

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

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