Skip to content
Docs
Roles

List group role assignments

List group role assignments

client.Zones.Groups.Roles.List(ctx, groupID, params) (*ZoneGroupRoleListResponse, error)
GET/zones/{zoneId}/groups/{groupId}/roles

Returns the roles assigned to the group. Members inherit these roles. Returns the shared role-assignment shape with principal_type set to group. Use cursor pagination via after/before; pass expand[]=total_count to include the matching row count. Pass filter[id] (repeatable, max 100) to restrict results to a known set of role assignments, mutually exclusive with after/before (returns 400 if combined). When filter[id] is set, limit is ignored and the response contains every requested assignment that exists on the group, in a single page. IDs not on the group are silently omitted.

ParametersExpand Collapse
groupID string
params ZoneGroupRoleListParams
ZoneID param.Field[string]

Path param: Zone ID

After param.Field[string]optional

Query param: Cursor for forward pagination

minLength1
maxLength255
Before param.Field[string]optional

Query param: Cursor for backward pagination

minLength1
maxLength255
Expand param.Field[ZoneGroupRoleListParamsExpandUnion]optional

Query param

type ZoneGroupRoleListParamsExpandString string
type ZoneGroupRoleListParamsExpandArray []string
FilterID param.Field[ZoneGroupRoleListParamsFilterIDUnion]optional

Query param: Restrict results to the role assignment with this ID. Repeatable, max 100. Mutually exclusive with after/before.

string
type ZoneGroupRoleListParamsFilterIDArray []string
Limit param.Field[int64]optional

Query param: Maximum number of items to return

minimum1
maximum100
ReturnsExpand Collapse
type ZoneGroupRoleListResponse struct{…}
ID string

Unique identifier of the role assignment

CreatedAt Time

Entity creation timestamp

formatdate-time
PrincipalID string

ID of the principal the role is assigned to (a user, application, or group ID).

PrincipalType string

The kind of principal the role is assigned to: user, application, or group. A role assigned to a group is inherited by that group's members.

RoleID string

ID of the assigned role

RoleIdentifier string

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
RoleOwnerType RoleAssignmentRoleOwnerType

Owner type of the assigned role. Disambiguates roles that share an identifier across owner types.

Accepts one of the following:
const RoleAssignmentRoleOwnerTypePlatform RoleAssignmentRoleOwnerType = "platform"
const RoleAssignmentRoleOwnerTypeCustomer RoleAssignmentRoleOwnerType = "customer"
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this assignment belongs to

ScopeID stringoptional

The ID of the scoped resource. Null when the assignment is unscoped.

ScopeType stringoptional

The kind of resource this grant is scoped to (e.g. zone). Null when the assignment is unscoped (applies to the owning zone itself).

List group role assignments

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
  "github.com/keycardai/keycard-go/option"
)

func main() {
  client := keycard.NewClient(
    option.WithAPIKey("My API Key"),
  )
  roles, err := client.Zones.Groups.Roles.List(
    context.TODO(),
    "groupId",
    keycard.ZoneGroupRoleListParams{
      ZoneID: "zoneId",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", roles.Items)
}
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "principal_id": "principal_id",
      "principal_type": "principal_type",
      "role_id": "role_id",
      "role_identifier": "role_identifier",
      "role_owner_type": "platform",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "scope_id": "scope_id",
      "scope_type": "scope_type"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "principal_id": "principal_id",
      "principal_type": "principal_type",
      "role_id": "role_id",
      "role_identifier": "role_identifier",
      "role_owner_type": "platform",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "scope_id": "scope_id",
      "scope_type": "scope_type"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}