# Roles

## List Roles

`client.organizations.roles.list(stringorganizationID, RequestOptionsoptions?): RoleListResponse`

**get** `/api/v1/organizations/{organization_id}/roles`

List all roles in an organization.

### Parameters

- `organizationID: string`

### Returns

- `RoleListResponse = Array<Role>`

  - `id: string`

    Unique identifier

  - `name: string`

    A name for the role.

  - `permissions: Array<Permission>`

    The actual permissions of the role.

    - `id: string`

      Unique identifier

    - `access: boolean`

      Whether the permission is granted or not.

    - `description: string | null`

      A description for the permission.

    - `name: string`

      A name for the permission.

    - `created_at?: string | null`

      Creation datetime

    - `updated_at?: string | null`

      Update datetime

  - `created_at?: string | null`

    Creation datetime

  - `updated_at?: string | null`

    Update datetime

### Example

```typescript
import LlamaCloudAdmin from '@llamaindex/llama-cloud-admin';

const client = new LlamaCloudAdmin({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const roles = await client.organizations.roles.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(roles);
```

#### Response

```json
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "name": "x",
    "permissions": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "access": true,
        "description": "description",
        "name": "x",
        "created_at": "2019-12-27T18:11:19.117Z",
        "updated_at": "2019-12-27T18:11:19.117Z"
      }
    ],
    "created_at": "2019-12-27T18:11:19.117Z",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
```

## Domain Types

### Role List Response

- `RoleListResponse = Array<Role>`

  - `id: string`

    Unique identifier

  - `name: string`

    A name for the role.

  - `permissions: Array<Permission>`

    The actual permissions of the role.

    - `id: string`

      Unique identifier

    - `access: boolean`

      Whether the permission is granted or not.

    - `description: string | null`

      A description for the permission.

    - `name: string`

      A name for the permission.

    - `created_at?: string | null`

      Creation datetime

    - `updated_at?: string | null`

      Update datetime

  - `created_at?: string | null`

    Creation datetime

  - `updated_at?: string | null`

    Update datetime
