# Query grantable roles

`GET /v1/roles/grantable`, operation `roles.QueryGrantableRoles`

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.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `resource` | query | Yes | `string` | Name of a resource with an IAM policy, such as projects/prj_… or projects/prj_…/agents/ags_…. |
| `pageSize` | query | No | `integer (int32)` | Maximum number of roles to return. Defaults to 50; values above 500 are treated as 500. |
| `pageToken` | query | No | `string` | Page token from a previous response for the same resource. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextPageToken` | `string` | Yes | Token for the next page; empty on the last page. |
| `roles` | `Role[]` | Yes | Roles, the basic ones first, then by service. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.