> For the complete documentation index, see [llms.txt](https://openapi.logto.io/dev/llms.txt)

# Get users

> GET /api/users
> 
> Get users with filters and pagination.
> 
> Logto provides a very flexible way to query users. You can filter users by almost any fields with multiple modes. To learn more about the query syntax, please refer to [Advanced user search](https://docs.logto.io/docs/recipes/manage-users/advanced-user-search/).



## Servers
- Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.)


## Authentication methods
- O auth2


## Parameters


### Query parameters

- **page** (integer)
  Page number (starts from 1).

- **page_size** (integer)
  Entries per page.

- **search_params** (object)
  Search query parameters.

- **identityType** (string)
  The external identity type to use for an exact user lookup. Use `social` for a social connector identity or `sso` for an enterprise SSO identity. Must be provided together with `identityProvider` and `identityId`. External identity filters are combined with other user filters using AND logic.

- **identityProvider** (string)
  The connector target for a social identity (for example, `dingtalk`), or the issuer for an enterprise SSO identity. Must be provided together with `identityType` and `identityId`.

- **identityId** (string)
  The user identifier issued by the external identity provider, such as a DingTalk OpenID. Must be provided together with `identityType` and `identityProvider`.

- **customData** (array[string])
  A repeatable filter for exact user lookup by custom data. Each value must be a URL-encoded JSON object, for example `customData=%7B%22customId%22%3A114514%7D` for `{"customId":114514}`. Matching uses PostgreSQL JSONB containment (`users.custom_data @> value::jsonb`) with strict JSON types: the number `114514` does not match the string `"114514"`, strings are case-sensitive without phone/date normalization, and `null` only matches an explicit JSON `null`, not a missing key. Nested objects are matched recursively, and arrays are matched by element regardless of order or duplicates. All keys within one object are combined with AND, repeated `customData` parameters are combined with OR, and the whole custom data condition is combined with `search`, identity, `excludeRoleId`, and `excludeOrganizationId` filters using AND. Empty objects and empty arrays are rejected with 400, and at most 20 `customData` values are allowed per request. The `mode`, `joint`, and `isCaseSensitive` parameters do not apply to `customData`, and nested syntax such as `customData.customId` or `mode.customData` is not supported.



## Responses
### 200
An array of users that match the given criteria.

#### Body: application/json (array[object])
- **id** (string)

- **username** (string | null)

- **primaryEmail** (string | null)

- **primaryPhone** (string | null)

- **name** (string | null)

- **avatar** (string | null)

- **customData** (object)
  arbitrary

- **identities** (object)

- **lastSignInAt** (number | null)

- **createdAt** (number)

- **updatedAt** (number)

- **profile** (object)

- **applicationId** (string | null)

- **cimdClientId** (string | null)
  The identifier of the CIMD (client ID metadata document) client from the user's first consent. `null` unless the user's first consent was granted to a CIMD client. Mutually exclusive with `applicationId`.

- **isSuspended** (boolean)

- **hasPassword** (boolean)

- **hasSecurityVerificationMethod** (boolean)

- **hasPrimaryEmail** (boolean)

- **hasPrimaryPhone** (boolean)

- **ssoIdentities** (array[object])

- **passwordDigest** (string | null)

- **passwordAlgorithm** (string | null)


### 400
Bad Request

### 401
Unauthorized

### 403
Forbidden


[Powered by Bump.sh](https://bump.sh)
