---
title: "List users"
method: GET
path: "/zones/{zoneId}/users"
tags: ["Users"]
---

# List users

`GET /zones/{zoneId}/users`

Returns a list of users in the specified zone.

**Rollout note:** the paginated/searchable/sortable behavior described below is gated behind the `user-pagination` feature flag and is currently disabled for most zones. While the flag is off, the response returns every user in the zone (capped at 100) in `items` and a fixed pagination envelope where `after_cursor` and `before_cursor` are `null` and `total_count` is `0`. The query parameters below are accepted but ignored. The flag is rolled out per-zone in Datadog and will become the default once Console adopts the paginated contract.

Use cursor pagination via `after`/`before`. Sort: comma-separated field list; prefix with `-` for descending. Use `expand[]=total_count` to include the matching row count, `expand[]=session_count` to include per-user session counts, `expand[]=grant_count` to include per-user delegated-grant counts, and `expand[]=role-assignments` to include each user's structured role grants. Filter by exact email via `filter[email]`; search via `query[email]` / `query[subject]` / `query[]` (substring match, OR'd across repeated values). `query[]` matches against email and federation credential subject. Pass `filter[id]` (repeatable, max 100) to restrict results to a known set of users — mutually exclusive with `after`/`before` (returns 400 if combined). When `filter[id]` is set, `limit` is ignored and the response contains every requested user that exists in the zone, in a single page. IDs not in the zone are silently omitted.

## Path parameters

- `zoneId` string, required

## Query parameters

- `after` string
- `before` string
- `limit` integer
- `expand[]` union
  - 'total_count' | 'session_count' | 'grant_count' | 'role-assignments'
  - string[]
- `filter[email]` union
  - string, email — Filter by exact email address
  - string[]
- `filter[id]` union
  - string — Restrict results to users with this publicId. Repeatable, max 100. Mutually exclusive with after/before.
  - string[]
- `query[email]` union
  - string — Search by email (substring match)
  - string[]
- `query[subject]` union
  - string — Search by federated credential subject (substring match)
  - string[]
- `query[]` union
  - string — Search across email and credential subject (substring match)
  - string[]
- `sort` string

## Response `200`

Default Response

- object
  - `items` IamUser[], required
    - `id` string, required — Unique identifier of the user
    - `organization_id` string, required — Organization that owns this user
    - `zone_id` string, required — Zone this user belongs to
    - `identifier` string, required — Zone-scoped user identifier. Defaults to the user's Keycard ID. When the provider has user_identifier_claim configured, the value is set from that claim at user creation time.
    - `subject` string — Subject identifier from the identity provider
    - `issuer` string — Issuer identifier of the identity provider
    - `email` string, email, required — Email address of the user
    - `email_verified` boolean, required — Whether the email address has been verified
    - `status` 'active' | 'disabled', required — Status of the user. Disabled users cannot authenticate.
    - `provider_id` string — Reference to the identity provider. This field is undefined when the source identity provider is deleted but the user is not deleted.
    - `created_at` string, date-time, required — Entity creation timestamp
    - `updated_at` string, date-time, required — Entity update timestamp
    - `authenticated_at` string — Date when the user was last authenticated
    - `session_count` integer — Session count for this user. Populated only when `expand[]=session_count` is set on the listing endpoint.
    - `grant_count` integer — Delegated-grant count for this user. Populated only when `expand[]=grant_count` is set on the listing endpoint.
    - `role_assignments` IamUserRoleAssignment[] — Role grants for this user within the zone. Populated only when `expand[]=role-assignments` is set on the listing endpoint.
      - `role_id` string, required — ID of the assigned role
      - `role_identifier` string, required — Opaque role identifier. Treated as an opaque identifier by the API and unique within a zone.
      - `scope` object, nullable, required — The resource this grant is scoped to, or null when the grant is unscoped (applies to the owning zone itself).
        - `type` string, required — The kind of resource this grant is scoped to (e.g. `zone`).
        - `id` string, required — The ID of the scoped resource.
  - `pagination` IamPagination, required — Cursor-based pagination metadata
    - `after_cursor` string, required — An opaque cursor used for paginating through a list of results
    - `before_cursor` string, required — An opaque cursor used for paginating through a list of results
    - `total_count` integer — Total number of items matching the query. Only included when expand[]=total_count is requested.

## Other responses

- `default` — Error response

---

[API](https://skmtc.net/keycardai/apis/untitled-api.md) · [All operations](https://skmtc.net/keycardai/apis/untitled-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keycardai/untitled-api/revisions/2f5033ed4491/schema)
