Skip to content
API Reference

List users

client.Zones.Users.List(ctx, zoneID, query) (*ZoneUserListResponse, error)
GET/zones/{zoneId}/users

Returns a list of users in the specified zone. Can be filtered by email address.

ParametersExpand Collapse
zoneID string
query ZoneUserListParams
After param.Field[string]optional

Cursor for forward pagination

minLength1
maxLength255
Before param.Field[string]optional

Cursor for backward pagination

minLength1
maxLength255
Expand param.Field[ZoneUserListParamsExpandUnion]optional
type ZoneUserListParamsExpandString string
type ZoneUserListParamsExpandArray []string
Limit param.Field[int64]optional

Maximum number of items to return

minimum1
maximum100
ReturnsExpand Collapse
type ZoneUserListResponse struct{…}
Items []User
ID string

Unique identifier of the user

CreatedAt Time

Entity creation timestamp

formatdate-time
Email string

Email address of the user

formatemail
EmailVerified bool

Whether the email address has been verified

OrganizationID string

Organization that owns this user

UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this user belongs to

AuthenticatedAt stringoptional

Date when the user was last authenticated

Issuer stringoptional

Issuer identifier of the identity provider

ProviderID stringoptional

Reference to the identity provider. This field is undefined when the source identity provider is deleted but the user is not deleted.

Subject stringoptional

Subject identifier from the identity provider

List users

package main

import (
  "context"
  "fmt"

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

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

  )
  users, err := client.Zones.Users.List(
    context.TODO(),
    "zoneId",
    keycard.ZoneUserListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", users.Items)
}
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "email": "dev@stainless.com",
      "email_verified": true,
      "organization_id": "organization_id",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "authenticated_at": "authenticated_at",
      "issuer": "issuer",
      "provider_id": "provider_id",
      "subject": "subject"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}
Returns Examples
{
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "email": "dev@stainless.com",
      "email_verified": true,
      "organization_id": "organization_id",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "zone_id": "zone_id",
      "authenticated_at": "authenticated_at",
      "issuer": "issuer",
      "provider_id": "provider_id",
      "subject": "subject"
    }
  ],
  "pagination": {
    "after_cursor": "x",
    "before_cursor": "x",
    "total_count": 0
  }
}