# List End User Roles

`GET /end-user-role-grants` · Core · Members & End Users

Returns all active role grants for project end-users, cursor-paginated. Each entry is a `eur_`-prefixed grant record including `end_user_id`, `role`, `granted_by`, and `granted_at`. Requires `PROJECT_ADMIN` authority.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The project's active end-user role grants. |
| `data.grants` | array of object | yes | The active grants, oldest first: every end user's, or one end user's when `endUserId` is given. Revoked grants are not listed. |
| `data.grants.[]id` | string | yes | The grant's id (`eurg_...`). Use it to revoke the grant. |
| `data.grants.[]endUserId` | string | yes | The end user who holds the role (`eu_...`). |
| `data.grants.[]role` | string | yes | The role name. |
| `data.grants.[]grantedAt` | string (date-time) | yes | When the role was granted. |
| `data.grants.[]grantedBy` | string | yes | Who granted it: the subject id of the caller that made the grant (an operator's user id, `usr_...`), or `invitation` when the end user received it by redeeming an invitation. |
| `meta` | object | yes | Request metadata: cost, timing and the request and trace ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | Your session has expired; sign in again to continue. |
| 403 | `K9O_ACCESS_DENIED` | You do not hold the required role to list end-user role grants. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/end-user-role-grants' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/end-user-role-grants', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### k9o CLI

```bash
k9o end-user role-grant list
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.endUsers.roleGrants.list()
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.end_users.role_grants.list()
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.EndUsers.RoleGrants.List(ctx)
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.end_users.role_grants.list().await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.endUsers().roleGrants().list()
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.EndUsers.RoleGrants.ListAsync()
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.end_users.role_grants.list()
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->end_users->role_grants->list()
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/list-end-user-roles
