# Method: organizations.protectedResources.search

- [HTTP request](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.request_body)
- [Response body](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.SearchProtectedResourcesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#body.aspect)
- [Try it!](https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#try-it)

Returns metadata about the resources protected by the given Cloud KMS `https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/projects.cryptoKeys#CryptoKey` in the given Cloud organization.

### HTTP request

`GET https://kmsinventory.googleapis.com/v1/{scope=organizations/*}/protectedResources:search`

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

### Path parameters

| Parameters ||
|---|---|
| `scope` | `string` Required. Resource name of the organization. Example: organizations/123 Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `scope`: - `cloudkms.protectedResources.search` |

### Query parameters

| Parameters ||
|---|---|
| `cryptoKey` | `string` Required. The resource name of the `https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/projects.cryptoKeys#CryptoKey`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `cryptoKey`: - `cloudkms.cryptoKeys.get` |
| `pageSize` | `integer` The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500. |
| `pageToken` | `string` A page token, received from a previous `https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources` must match the call that provided the page token. |
| `resourceTypes[]` | `string` Optional. A list of resource types that this request searches for. If empty, it will search all the [trackable resource types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types). Regular expressions are also supported. For example: - `compute.googleapis.com.*` snapshots resources whose type starts with `compute.googleapis.com`. - `.*Image` snapshots resources whose type ends with `Image`. - `.*Image.*` snapshots resources whose type contains `Image`. See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned. |

### 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/kms/docs/reference/inventory/rest/v1/organizations.protectedResources/search#google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources`.

| JSON representation |
|---|
| ``` { "protectedResources": [ { object (`https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources#ProtectedResource`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `protectedResources[]` | ``object (`https://docs.cloud.google.com/kms/docs/reference/inventory/rest/v1/organizations.protectedResources#ProtectedResource`)`` Protected resources for this page. |
| `nextPageToken` | `string` A token that can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

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