Get users
Changed onGet 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.
Request
- Base URL: https://[tenant_id].logto.app
- URL: https://[tenant_id].logto.app/api/users
- Auth: OAuth 2 (client credentials, token URL /oidc/token, scopes: all)
Query parameters
Page number (starts from 1).
Entries per page.
Search query parameters.
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.
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.
The user identifier issued by the external identity provider, such as a DingTalk OpenID. Must be provided together with identityType and identityProvider.
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.
Response
An array of users that match the given criteria.
Changes
- info
added the new optional
queryrequest parametercustomData
- info
- breaking
the
/response property's maxLength was increased from12to128for the response status - breaking
the
///response property's maxLength was increased from12to128for the response status - info
added the new optional
queryrequest parameteridentityId - info
added the new optional
queryrequest parameteridentityProvider - info
added the new optional
queryrequest parameteridentityType
- breaking