# Method: effectiveIamPolicies.batchGet

- [HTTP request](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.request_body)
- [Response body](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.BatchGetEffectiveIamPoliciesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.aspect)
- [EffectiveIamPolicy](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy)
  - [JSON representation](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.SCHEMA_REPRESENTATION)
- [PolicyInfo](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo)
  - [JSON representation](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#try-it)

Gets effective IAM policies for a batch of resources.

### HTTP request

`GET https://cloudasset.googleapis.com/v1/{scope=*/*}/effectiveIamPolicies:batchGet`

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

### Path parameters

| Parameters ||
|---|---|
| `scope` | `string` Required. Only IAM policies on or below the scope will be returned. This can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). To know how to get organization ID, visit [here](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). To know how to get folder or project ID, visit [here](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). Authorization requires one or more of the following [IAM](https://cloud.google.com/iam/docs/) permissions on the specified resource `scope`: - `cloudasset.assets.analyzeIamPolicy` - `cloudasset.assets.searchAllResources` - `cloudasset.assets.searchAllIamPolicies` |

### Query parameters

| Parameters ||
|---|---|
| `names[]` | `string` Required. The names refer to the [full_resource_names](https://cloud.google.com/asset-inventory/docs/resource-name-format) of the asset types [supported by search APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). A maximum of 20 resources' effective policies can be retrieved in a batch. |

### Request body

The request body must be empty.

### Response body

A response message for `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies`.

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

| JSON representation |
|---|
| ``` { "policyResults": [ { object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy`) } ] } ``` |

| Fields ||
|---|---|
| `policyResults[]` | ``object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy`)`` The effective policies for a batch of resources. Note that the results order is the same as the order of `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.QUERY_PARAMETERS.names`. When a resource does not have any effective IAM policies, its corresponding policy_result will contain empty `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.policies`. |

### Authorization scopes

Requires the following OAuth scope:

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

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

## EffectiveIamPolicy

The effective IAM policies on one resource.

| JSON representation |
|---|
| ``` { "fullResourceName": string, "policies": [ { object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo`) } ] } ``` |

| Fields ||
|---|---|
| `fullResourceName` | `string` The [fullResourceName](https://cloud.google.com/asset-inventory/docs/resource-name-format) for which the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.policies` are computed. This is one of the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.QUERY_PARAMETERS.names` the caller provides in the request. |
| `policies[]` | ``object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo`)`` The effective policies for the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.full_resource_name`. These policies include the policy set on the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.full_resource_name` and those set on its parents and ancestors up to the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#body.PATH_PARAMETERS.scope`. Note that these policies are not filtered according to the resource type of the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.full_resource_name`. These policies are hierarchically ordered by `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.FIELDS.attached_resource` starting from `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#EffectiveIamPolicy.FIELDS.full_resource_name` itself to its parents and ancestors, such that policies\[i\]'s `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.FIELDS.attached_resource` is the child of policies\[i+1\]'s `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.FIELDS.attached_resource`, if policies\[i+1\] exists. |

## PolicyInfo

The IAM policy and its attached resource.

| JSON representation |
|---|
| ``` { "attachedResource": string, "policy": { object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/Shared.Types/Policy`) } } ``` |

| Fields ||
|---|---|
| `attachedResource` | `string` The full resource name the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.FIELDS.policy` is directly attached to. |
| `policy` | ``object (`https://docs.cloud.google.com/asset-inventory/docs/reference/rest/Shared.Types/Policy`)`` The IAM policy that's directly attached to the `https://docs.cloud.google.com/asset-inventory/docs/reference/rest/v1/effectiveIamPolicies/batchGet#PolicyInfo.FIELDS.attached_resource`. |