Skip to Content
kosemdocs
ReferenceAPIRoles

Query grantable roles

Lists the roles that can be granted on a resource, in the order that listing roles returns them. The answer follows from the resource's type alone, so the resource is not looked up, and whether it exists is not told.

GET
/v1/roles/grantable

Lists the roles that can be granted on a resource, in the order that listing roles returns them.

The answer follows from the resource's type alone, so the resource is not looked up, and whether it exists is not told.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Query Parameters

resource*string

Name of a resource with an IAM policy, such as projects/prj_… or projects/prj_…/agents/ags_….

Length1 <= length
pageSize?integer

Maximum number of roles to return. Defaults to 50; values above 500 are treated as 500.

Formatint32
Range0 <= value
pageToken?string

Page token from a previous response for the same resource.

Response Body

OK

application/json
  1. response
nextPageToken*string

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

roles*array<>

Roles, the basic ones first, then by service.

Example Request
curl -X GET 'https://api.kosem.ai/v1/roles/grantable?resource=string'
Example Response
{
  "nextPageToken": "string",
  "roles": [
    {
      "description": "string",
      "grantableOn": [
        "string"
      ],
      "includedPermissions": [
        "string"
      ],
      "name": "string",
      "title": "string"
    }
  ]
}