Skip to content
Product Docs

List Roles

client.Organizations.Roles.List(ctx, organizationID) (*[]Role, error)
GET/api/v1/organizations/{organization_id}/roles

List all roles in an organization.

ParametersExpand Collapse
organizationID string
ReturnsExpand Collapse
type OrganizationRoleListResponse []Role
ID string

Unique identifier

formatuuid
Name string

A name for the role.

maxLength3000
minLength1
Permissions []RolePermission

The actual permissions of the role.

ID string

Unique identifier

formatuuid
Access bool

Whether the permission is granted or not.

Description string

A description for the permission.

Name string

A name for the permission.

maxLength3000
minLength1
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time
CreatedAt TimeOptional

Creation datetime

formatdate-time
UpdatedAt TimeOptional

Update datetime

formatdate-time

List Roles

package main

import (
  "context"
  "fmt"

  "github.com/run-llama/llamacloud-admin-go"
  "github.com/run-llama/llamacloud-admin-go/option"
)

func main() {
  client := llamacloudadmin.NewClient(
    option.WithAPIKey("My API Key"),
  )
  roles, err := client.Organizations.Roles.List(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", roles)
}
[
  {
    "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"
  }
]
Returns Examples
[
  {
    "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"
  }
]