Skip to content
API Reference

List organization users in a zone

client.Zones.Members.List(ctx, zoneID, query) (*ZoneMemberListResponse, error)
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 ZoneMemberListParams
After param.Field[string]optional

Cursor for forward pagination

Before param.Field[string]optional

Cursor for backward pagination

Expand param.Field[ZoneMemberListParamsExpandUnion]optional
type ZoneMemberListParamsExpandString string
type ZoneMemberListParamsExpandArray []string
Limit param.Field[int64]optional

Maximum number of members to return

minimum1
maximum100
Role param.Field[ZoneMemberListParamsRole]optional

Filter members by role

const ZoneMemberListParamsRoleZoneManager ZoneMemberListParamsRole = "zone_manager"
const ZoneMemberListParamsRoleZoneViewer ZoneMemberListParamsRole = "zone_viewer"
ReturnsExpand Collapse
type ZoneMemberListResponse struct{…}
Items []ZoneMember
ID string

Unique identifier of the zone member

CreatedAt Time

Entity creation timestamp

formatdate-time
OrganizationID string

Organization ID that owns the zone

OrganizationUserID string

Organization user ID of the zone member

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

Accepts one of the following:
const ZoneRoleZoneManager ZoneRole = "zone_manager"
const ZoneRoleZoneViewer ZoneRole = "zone_viewer"
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone ID the organization user is a member of

Pagination information

HasNextPage bool

Whether there are more items after the current page

HasPreviousPage bool

Whether there are items before the current page

EndCursor stringoptional

Cursor pointing to the last item in the current page

StartCursor stringoptional

Cursor pointing to the first item in the current page

List organization users in a zone

package main

import (
  "context"
  "fmt"

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

func main() {
  client := keycard.NewClient(

  )
  members, err := client.Zones.Members.List(
    context.TODO(),
    "zoneId",
    keycard.ZoneMemberListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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
  }
}