# Roles

## List Roles

`organizations.roles.list(strorganization_id)  -> RoleListResponse`

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

List all roles in an organization.

### Parameters

- `organization_id: str`

### Returns

- `List[Role]`

  - `id: str`

    Unique identifier

  - `name: str`

    A name for the role.

  - `permissions: List[Permission]`

    The actual permissions of the role.

    - `id: str`

      Unique identifier

    - `access: bool`

      Whether the permission is granted or not.

    - `description: Optional[str]`

      A description for the permission.

    - `name: str`

      A name for the permission.

    - `created_at: Optional[datetime]`

      Creation datetime

    - `updated_at: Optional[datetime]`

      Update datetime

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

### Example

```python
import os
from llama_cloud_admin import LlamaCloudAdmin

client = LlamaCloudAdmin(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
roles = client.organizations.roles.list(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(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

- `List[Role]`

  - `id: str`

    Unique identifier

  - `name: str`

    A name for the role.

  - `permissions: List[Permission]`

    The actual permissions of the role.

    - `id: str`

      Unique identifier

    - `access: bool`

      Whether the permission is granted or not.

    - `description: Optional[str]`

      A description for the permission.

    - `name: str`

      A name for the permission.

    - `created_at: Optional[datetime]`

      Creation datetime

    - `updated_at: Optional[datetime]`

      Update datetime

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime
