# Method: testEnabled

- [HTTP request](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/TopLevel/testEnabled#body.aspect)

Tests a value against the result of merging consumer policies in the resource hierarchy. This operation is designed to be used for building policy-aware UIs and command-line tools, not for access checking.

### HTTP request

`POST https://serviceusage.googleapis.com/v2beta/{name=*/*}:testEnabled`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Resource name to check the value against hierarchically. Format: `projects/100`, `folders/101` or `organizations/102`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { // Union field `value` can be only one of the following: "serviceName": string // End of list of possible types for union field `value`. } ``` |

| Fields ||
|---|---|
| Union field `value`. Asks "Is this value enabled according to the merged consumer policies from the resource hierarchy?". For example, the value can be a service name to check if the targeted resource can use this service. Currently supports services with format: `services/{service}`. `value` can be only one of the following: ||
| `serviceName` | `string` The name of a service to test for enablement. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/service-usage/docs/reference/rest/v2beta/services#State`.

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