Skip to content
Docs
Members

List organization users in a zone

List organization users in a zone

client.zones.members.list(stringzoneID, MemberListParams { after, before, expand, 2 more } query?, RequestOptionsoptions?): MemberListResponse { items, page_info, pagination }
GET/zones/{zoneId}/members

Lists all organization users in a zone with their roles and metadata. Supports cursor-based pagination.

ParametersExpand Collapse
zoneID: string
query: MemberListParams { after, before, expand, 2 more }
after?: string

Cursor for forward pagination

before?: string

Cursor for backward pagination

expand?: "total_count" | Array<"total_count">
Accepts one of the following:
"total_count"
"total_count"
Array<"total_count">
"total_count"
limit?: number

Maximum number of members to return

minimum1
maximum100
role?: "zone_manager" | "zone_viewer"

Filter members by role

Accepts one of the following:
"zone_manager"
"zone_viewer"
ReturnsExpand Collapse
MemberListResponse { items, page_info, pagination }
items: Array<ZoneMember { id, _links, created_at, 5 more } >
id: string

Unique identifier of the zone member

created_at: string

Entity creation timestamp

formatdate-time
organization_id: string

Organization ID that owns the zone

organization_user_id: string

Organization user ID of the zone member

role: ZoneRole

Zone role type. zone_manager has full management access, zone_viewer has read-only access.

Accepts one of the following:
"zone_manager"
"zone_viewer"
updated_at: string

Entity update timestamp

formatdate-time
zone_id: string

Zone ID the organization user is a member of

page_info: PageInfoPagination { has_next_page, has_previous_page, end_cursor, start_cursor }

Pagination information

has_next_page: boolean

Whether there are more items after the current page

has_previous_page: boolean

Whether there are items before the current page

end_cursor?: string | null

Cursor pointing to the last item in the current page

start_cursor?: string | null

Cursor pointing to the first item in the current page

List organization users in a zone

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const members = await client.zones.members.list('zoneId');

console.log(members.items);
{
  "items": [
    {
      "id": "id",
      "_links": {
        "organization_user": {
          "href": "href"
        },
        "self": {
          "href": "href"
        }
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "organization_id": "organization_id",
      "organization_user_id": "organization_user_id",
      "role": "zone_manager",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id"
    }
  ],
  "page_info": {
    "has_next_page": true,
    "has_previous_page": true,
    "end_cursor": "end_cursor",
    "start_cursor": "start_cursor"
  },
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "_links": {
        "organization_user": {
          "href": "href"
        },
        "self": {
          "href": "href"
        }
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "organization_id": "organization_id",
      "organization_user_id": "organization_user_id",
      "role": "zone_manager",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id"
    }
  ],
  "page_info": {
    "has_next_page": true,
    "has_previous_page": true,
    "end_cursor": "end_cursor",
    "start_cursor": "start_cursor"
  },
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}