# List users in the tenant

GET

/v1/identity/users

```sh
curl --request GET \
  --url 'https://example.com/v1/identity/users?limit=25&include=grants' \
  --header 'Authorization: Bearer <token>'
```

Cursor-paginated list of tenant users (sort order is binding-defined), for tenant admins only. Optional `?query=` is a prefix match on `displayName` — the natural filter shape for a “search users” surface. `primaryEmail` may be redacted per tenant policy. Anyone else adds a person to a project by their email or id (`POST /v1/projects/{projectId}/memberships`).

## Authorizations

- **[bearerAuth](https://docs.kindgi.com/v0.1.9/reference/api.md#bearerauth)**

## Parameters

### Query Parameters

**limit**

integer

default: 25 >= 1 <= 100

1..100. Default 25.

**cursor**

string

Where the previous page ended: its `nextCursor`, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise `400 bad-input`, and the list starts again without it. Absent → first page.

**query**

string

Prefix match on `displayName`.

**includeUnregistered**

boolean

With `true`, people who were removed (`unregisteredAt`) too.

**pending**

boolean

With `true`, only people with an open invitation (`invite`: pending or expired), who haven’t signed in yet. An older runtime ignores it and lists everyone (from 0.1.9).

**include**

string

Allowed values: grants

Extra fields, comma-separated. `grants`: each person’s grants, as `GET /v1/identity/users/{userId}/grants` answers them, in this one read. A runtime that doesn’t read grants (no authorization store) leaves `grants` out, as an older one does.

## Responses

### 200

Page of users.

application/json

object

**data**

required

Array\<object>

Tenant-scoped user record (admin plane). `primaryEmail` may be redacted on the wire based on tenant policy (the routes treat it as opaque). `metadata` is free-form JSON — deployments carry IdP claims / provisioning source / roles here.

object

**userId**

required

string

**tenantId**

required

string format: uuid

**primaryEmail**

string

**displayName**

string

**createdAt**

required

string format: date-time

**lastActiveAt**

string format: date-time

**unregisteredAt**

When they were removed from the tenant (`POST /v1/identity/users/{userId}/unregister`); absent while they are here.

string format: date-time

**invite**

Their invitation, while they haven’t signed in: absent once they have, for people added without an email, and for people added before invitations (from 0.1.9).

object

**state**

required

string

Allowed values: pending expired

**expiresAt**

required

string format: date-time

**sentAt**

When it was last emailed; absent when it never was.

string format: date-time

**firstSignedInAt**

Their first sign-in that made a session. Absent before it, and for people who last signed in before it was kept (from 0.1.9).

string format: date-time

**metadata**

object

**_key_**

additional properties

any

**grants**

The person’s grants: only on `GET /v1/identity/users?include=grants`, and only from a runtime that reads grants.

object

**userId**

required

string

**tenantAdmin**

Whether the person is a tenant admin. Absent when the runtime has no authorization store: nothing grants it then.

boolean

**tenantMember**

Whether the person is a tenant member: they read the tenant’s settings (providers, policies, adapters, signing keys, deployments), not its projects. A person is one from being added. Absent when the runtime has no authorization store, or doesn’t report it.

boolean

**projects**

required

Direct project memberships.

Array\<object>

A person’s direct role on a project.

object

**projectId**

required

string

**role**

required

Role on a project, as read. `member` is only read, on a role given before it was retired: it grants what `viewer` does, and writes refuse it.

string

Allowed values: viewer editor owner admin member

**teams**

required

Team memberships.

Array\<object>

A person’s role in a team.

object

**teamId**

required

string

**role**

required

Role on a team membership.

string

Allowed values: member admin

**reviewer**

A person’s active entry on the reviewer roster.

object

**role**

required

Reviewer role class. Hierarchy: standard < senior < admin.

string

Allowed values: standard senior admin

**hasMore**

required

boolean

**nextCursor**

string

##### Example

```json
{
  "data": [
    {
      "invite": {
        "state": "pending"
      },
      "grants": {
        "projects": [
          {
            "role": "viewer"
          }
        ],
        "teams": [
          {
            "role": "member"
          }
        ],
        "reviewer": {
          "role": "standard"
        }
      }
    }
  ]
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 403

Not a tenant admin.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

## See also

- [`POST /v1/identity/users`: Add a person](https://docs.kindgi.com/v0.1.9/reference/api/operations/identityuserscreate.md)
- [`GET /v1/identity/users/{userId}`: Get a user by id](https://docs.kindgi.com/v0.1.9/reference/api/operations/identityusersget.md)
- [`GET /v1/identity/users/{userId}/sessions`: List active sessions for a user](https://docs.kindgi.com/v0.1.9/reference/api/operations/identityuserslistsessions.md)
- [`POST /v1/identity/users/{userId}/unregister`: Remove a person](https://docs.kindgi.com/v0.1.9/reference/api/operations/identityusersunregister.md)
- [Operate a self-hosted runtime](https://docs.kindgi.com/v0.1.9/deploy/self-hosted/operate.md)
- [Every error code](https://docs.kindgi.com/v0.1.9/reference/errors.md)
