Skip to content
API Reference

List users

zones.users.list(strzone_id, UserListParams**kwargs) -> UserListResponse
GET/zones/{zoneId}/users

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

ParametersExpand Collapse
zone_id: str
after: Optional[str]

Cursor for forward pagination

minLength1
maxLength255
before: Optional[str]

Cursor for backward pagination

minLength1
maxLength255
expand: Optional[Union[Literal["total_count"], List[Literal["total_count"]]]]
Accepts one of the following:
Literal["total_count"]
List[Literal["total_count"]]
limit: Optional[int]

Maximum number of items to return

minimum1
maximum100
ReturnsExpand Collapse
class UserListResponse:
items: List[User]
id: str

Unique identifier of the user

created_at: datetime

Entity creation timestamp

formatdate-time
email: str

Email address of the user

formatemail
email_verified: bool

Whether the email address has been verified

organization_id: str

Organization that owns this user

updated_at: datetime

Entity update timestamp

formatdate-time
zone_id: str

Zone this user belongs to

authenticated_at: Optional[str]

Date when the user was last authenticated

issuer: Optional[str]

Issuer identifier of the identity provider

provider_id: Optional[str]

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

subject: Optional[str]

Subject identifier from the identity provider

List users

from keycardai_api import KeycardAPI

client = KeycardAPI()
users = client.zones.users.list(
    zone_id="zoneId",
)
print(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
  }
}