Skip to Content
kosemdocs
ReferenceAPIIam policies

Search IAM policies

Searches the IAM policies of an organization and of the resources in it. A policy is returned only to callers who may read it, by its resource's getIamPolicy permission; others are neither named nor counted.

GET
/v1/iam-policies/search

Searches the IAM policies of an organization and of the resources in it.

A policy is returned only to callers who may read it, by its resource's getIamPolicy permission; others are neither named nor counted.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Query Parameters

scope*string

The organization whose policies are searched, organizations/{organization_id}, with those of everything in it.

Match^organizations/org_[0-7][0-9a-hjkmnp-tv-z]{25}$
member?string

A principal, by ID: user:{user_id}, group:{group_id} or serviceAccount:{service_account_id}. Only the bindings that grant it a role are returned: to it, or to a group it is in, at any depth, among the groups whose members the caller may list. Unset, every binding is. Email addresses are refused, and other groups left out, since the answer would tell those who cannot list the organization's people or a group's members who is in them.

pageSize?integer

Maximum number of resources to return. Defaults to 50; values above 500 are treated as 500. A page may hold fewer, or none, before the last: it leaves out the policies the caller may not read, and reads at most 1,000 in all. Search on while nextPageToken is set.

Formatint32
Range0 <= value
pageToken?string

Page token from a previous response with the same scope and member. Tokens are sealed, and tell nothing of the policies they skip.

Response Body

OK

application/json
  1. response
nextPageToken*string

Token for the next page; empty on the last page.

results*array<>

The policies found, by resource name.

Example Request
curl -X GET 'https://api.kosem.ai/v1/iam-policies/search?scope=string'
Example Response
{
  "nextPageToken": "string",
  "results": [
    {
      "bindings": [
        {
          "members": [
            "string"
          ],
          "role": "string"
        }
      ],
      "displayName": "string",
      "project": "string",
      "resource": "string",
      "resourceType": "string"
    }
  ]
}