Skip to content
Docs
Groups

Get group

Get group

GET/zones/{zoneId}/groups/{groupId}

Returns a group by ID. Pass expand[]=member_count for its member count and expand[]=roles for the identifiers of its assigned roles.

Path ParametersExpand Collapse
zoneId: string
groupId: string
Query ParametersExpand Collapse
"expand[]": optional "member_count" or "roles" or array of "member_count" or "roles"
Accepts one of the following:
UnionMember0 = "member_count" or "roles"
Accepts one of the following:
"member_count"
"roles"
UnionMember1 = array of "member_count" or "roles"
Accepts one of the following:
"member_count"
"roles"
ReturnsExpand Collapse
Group = object { id, created_at, external, 7 more }

A zone-scoped group of users, assignable to roles and usable in policies. Roles assigned to a group are inherited by its members. external is false for groups managed in Keycard and true for groups synced from an external directory.

id: string

Unique identifier of the group

created_at: string

Entity creation timestamp

formatdate-time
external: boolean

Whether the group is synced from an external directory. When true the group is directory-owned and its membership is read-only; when false it is managed in Keycard. Read-only: set by external sync, never by the caller.

identifier: string

User-specified identifier, unique within the zone. Automatically assigned for groups from an external directory.

name: string

Human-readable group name

organization_id: string

Organization this group belongs to

updated_at: string

Entity update timestamp

formatdate-time
zone_id: string

Zone this group belongs to

member_count: optional number

Number of users in the group. Included only when requested via expand[]=member_count (group get or list).

roles: optional array of string

Identifiers of the roles assigned to the group; members inherit them. Deduped across scopes. Included only when requested via expand[]=roles (group get or list).

Get group

curl https://api.keycard.ai/zones/$ZONE_ID/groups/$GROUP_ID \
    -H "Authorization: Bearer $KEYCARD_API_API_KEY"
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "external": true,
  "identifier": "identifier",
  "name": "name",
  "organization_id": "organization_id",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "member_count": 0,
  "roles": [
    "string"
  ]
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "external": true,
  "identifier": "identifier",
  "name": "name",
  "organization_id": "organization_id",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "member_count": 0,
  "roles": [
    "string"
  ]
}