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.
Query parameters
-
Page number (starts from 1).
Minimum value is
1. Default value is1. -
Entries per page.
Minimum value is
1. Default value is20. -
Search query parameters.
-
The external identity type to use for an exact user lookup. Use
socialfor a social connector identity orssofor an enterprise SSO identity. Must be provided together withidentityProviderandidentityId. External identity filters are combined with other user filters using AND logic.Values are
socialorsso. -
The connector target for a social identity (for example,
dingtalk), or the issuer for an enterprise SSO identity. Must be provided together withidentityTypeandidentityId. -
The user identifier issued by the external identity provider, such as a DingTalk OpenID. Must be provided together with
identityTypeandidentityProvider. -
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%7Dfor{"customId":114514}. Matching uses PostgreSQL JSONB containment (users.custom_data @> value::jsonb) with strict JSON types: the number114514does not match the string"114514", strings are case-sensitive without phone/date normalization, andnullonly matches an explicit JSONnull, 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, repeatedcustomDataparameters are combined with OR, and the whole custom data condition is combined withsearch, identity,excludeRoleId, andexcludeOrganizationIdfilters using AND. Empty objects and empty arrays are rejected with 400, and at most 20customDatavalues are allowed per request. Themode,joint, andisCaseSensitiveparameters do not apply tocustomData, and nested syntax such ascustomData.customIdormode.customDatais not supported.
curl \
--request GET 'https://[tenant_id].logto.app/api/users' \
--header "Authorization: Bearer $ACCESS_TOKEN"
[
{
"id": "string",
"username": "string",
"primaryEmail": "string",
"primaryPhone": "string",
"name": "string",
"avatar": "string",
"customData": {},
"identities": {
"additionalProperty1": {
"userId": "string",
"details": {}
},
"additionalProperty2": {
"userId": "string",
"details": {}
}
},
"lastSignInAt": 42.0,
"createdAt": 42.0,
"updatedAt": 42.0,
"profile": {
"familyName": "string",
"givenName": "string",
"middleName": "string",
"nickname": "string",
"preferredUsername": "string",
"profile": "string",
"website": "string",
"gender": "string",
"birthdate": "string",
"zoneinfo": "string",
"locale": "string",
"address": {
"formatted": "string",
"streetAddress": "string",
"locality": "string",
"region": "string",
"postalCode": "string",
"country": "string"
}
},
"applicationId": "string",
"cimdClientId": "string",
"isSuspended": true,
"hasPassword": true,
"hasSecurityVerificationMethod": true,
"ssoIdentities": [
{
"tenantId": "string",
"id": "string",
"userId": "string",
"issuer": "string",
"identityId": "string",
"detail": {},
"createdAt": 42.0,
"updatedAt": 42.0,
"ssoConnectorId": "string"
}
],
"passwordDigest": "string",
"passwordAlgorithm": "Argon2i"
}
]