Skip to Content
IAM
Module Integration
IAM: User Search

IAM: User Search

POST /api/user/search returns a paginated list of users visible to the caller. Available from IAM 1.7.0.

The request body filters users by permissions, group membership, or user IDs, and can add a text search. Each item contains the user. Groups and permissions are included only when the request asks for them.

New integrations should use this endpoint. POST /api/user/filterByPermissions remains available for existing callers.

POST /api/user/searchPOST /api/user/filterByPermissions
Users returnedUsers inside the caller’s users:view scope, same as GET /api/userEvery permission match, not limited to the caller’s users:view scope
Pagingskip and takeNone. The response lists every match
FilterTree of and, or, permission, group, and user nodesOne module, a flat role list, entities, and entity groups
Default itemuser onlyuser, matched permission IDs, and every effective permission

Both endpoints require users:view.

Quick examples

The IDs in all examples are placeholders.

Members of a group or its subgroups whose username, first name, last name, or email starts with nowak:

POST /api/user/search?take=50 Authorization: Bearer <access-token> Content-Type: application/json
{ "filter": { "type": "group", "groupIds": ["6f1c0a20-0000-4000-8000-000000000010"] }, "search": "nowak" }

The response has total and a data array of up to 50 items, each with a user object.

Users who can view reports for entity-01, or who are super admins of the reporting module:

{ "filter": { "type": "or", "conditions": [ { "type": "permission", "moduleName": "reporting", "roleSets": [{ "action": ["view"], "resource": ["reports"] }], "entities": ["entity-01"] }, { "type": "permission", "moduleName": "reporting", "roleSets": [{ "action": ["super_admin"] }] } ] } }

The super_admin leaf has no entities, so it matches regardless of entity.

Users who hold a reporting permission with action=view and are members of a group or its subgroups, with the permissions that caused the match:

{ "filter": { "type": "and", "conditions": [ { "type": "permission", "moduleName": "reporting", "roleSets": [{ "action": ["view"] }] }, { "type": "group", "groupIds": ["6f1c0a20-0000-4000-8000-000000000010"] } ] }, "include": ["matchedPermissions"] }

matchedPermissions requires permissions:view.

More examples, including complete responses, are at the end of this page.

Access

The caller must be authenticated. A missing or invalid token returns 401.

AccessRequired when
users:viewEvery call. Without it the response is 403 and the body is empty
groups:viewinclude contains groups. Without it the response is 403 and the body is You do not have view access to groups.
permissions:viewinclude contains matchedPermissions or permissions. Without it the response is 403 and the body is You do not have view access to permissions.

Results are limited to the caller’s users:view scope. A caller whose users:view covers only some entities, entity groups, or unscoped users receives only users in that scope. A caller with unrestricted users:view receives every eligible user.

Eligible users are enabled users that are not service accounts. Disabled users and service accounts are never returned, including when their IDs are listed in a user node.

Query parameters

NameTypeDefaultConstraints
skipinteger0Number of matching users to skip. A value below 0 is treated as 0
takeinteger100Page size, from 1 to 500. Any other value returns 400: take must be between 1 and 500.

total in the response is the number of matches before skip and take are applied. Users are ordered by user ID as text, ascending, and the order is applied before paging. There is no sort parameter.

skip and take are offsets, not a cursor. The same request returns the same page while the set of matching users stays the same. Users added or removed between calls shift later pages.

Request body

All body fields are optional. {} returns the first page of every eligible user in the caller’s scope. Property names are camel case. Unknown properties, including properties on filter nodes, return 400.

NameTypeDescription
filterobjectFilter tree. When omitted, every eligible user in the caller’s scope matches
searchstringText search, combined with filter so that a user must satisfy both. Omitted or blank does not narrow the result
includestring arraygroups, matchedPermissions, permissions. When omitted, each item contains only user

search uses the same text search as GET /api/user. The string is matched against username, first name, last name, and email. Matching is case-insensitive and prefix-based: nowak matches the last name Nowak, but not the email ada.nowak@example.com. * enables infix matching (*nowak*), and a value in double quotes ("nowak") requires an exact match. When the value has several words, each word must match at least one of the fields.

include values are case sensitive. An unknown or blank value returns 400, for example include contains unknown value 'roles'.

Filter nodes

Every node has a type, which can appear anywhere in the node. The allowed types are and, or, permission, group, and user. Any other type returns 400.

typeFieldsMatch
andconditions: array of nodes, at least oneThe user matches every condition
orconditions: array of nodes, at least oneThe user matches at least one condition
permissionSee permissionThe user holds a permission that satisfies the leaf, directly or through a group
groupgroupIds: string array, required. includeSubgroups: booleanThe user is a member of one of the groups
useruserIds: string array, requiredThe user ID is in the list

and and or nodes contain other nodes. permission, group, and user nodes are leaves. There is no not node, so a tree cannot exclude a permission, a group, or a user.

permission

FieldRequiredBehavior
moduleNameyesCompared case-insensitively. Blank returns 400
roleSetsnoNo role constraint when omitted or empty
entitiesnoEntity IDs. See the entity rule below
entityGroupsnoEntity group IDs. See the entity rule below
rolesExactnoWhen true, the permission’s roles must equal one of the sets. Requires roleSets, otherwise 400

roleSets is a list of role sets. The sets are alternatives: a permission matches when one set matches. Inside one set, every listed role type must match, and one listed value for that type is enough. A role type that the set does not mention is not constrained. There is no wildcard type. Role type names and role values are compared as exact strings.

"roleSets": [ { "action": ["view"], "resource": ["users"] }, { "action": ["super_admin"] } ]

This leaf matches a permission that has action=view and resource=users, or a permission that has action=super_admin. The first permission may also carry other role types. With rolesExact: true, the permission’s role types and values must be exactly one of those sets: the same type names and the same values, with no extra type and no extra value. Order inside a value list does not matter.

Permissions stored with a flat role list use the role type legacy. A leaf that should match those permissions names that type:

{ "type": "permission", "moduleName": "reporting", "roleSets": [{ "legacy": ["editor"] }] }

When both entities and entityGroups are omitted or empty, entity scope is not constrained. When either list is set, the permission matches if it contains any listed entity or any listed entity group. The two lists are alternatives. These fields constrain the whole leaf, including every role set: alternatives that need different entity scopes belong in separate leaves under an or. A permission assigned to a group also matches members of that group’s subgroups.

group

groupIds must contain at least one ID. includeSubgroups defaults to true when omitted: members of the listed groups and of their subgroups match. false keeps only direct members of the listed groups. Unknown group IDs match no users, and the other IDs in the same leaf still apply.

user

userIds must contain at least one ID. An ID is skipped, without an error, when the user does not exist, is disabled, is a service account, or is outside the caller’s users:view scope. The response does not say which IDs were skipped, and total counts only the remaining users.

Response

200 with this body:

FieldTypeDescription
totalnumberMatching users, before paging
dataarrayThe current page, ordered by user ID

Each item always has user. groups, matchedPermissions, and permissions are absent unless include asked for them. When requested, an empty result is [].

user has the same fields as a user returned by the user API:

FieldNotes
id, username, emailPresent. username and email may be empty strings
firstName, lastName, phoneNumber, localeString or null
enabledtrue for every returned user
emailVerifiedBoolean
entityIds, entityGroupIdsArrays. Empty when the user has none
createdDate, modifiedDateUTC timestamps, or null
modifiedOperationLast recorded change operation, or null

groups lists the groups the user is a direct member of, ordered by group ID. Parent groups are not listed, and a subgroup is listed only when the user is a direct member of that subgroup. A permission inherited from a parent group can therefore appear in permissions while that parent is absent from groups. Each group has:

FieldNotes
id, name, path, parentIdGroup identity. parentId is null for a top-level group
scopeEntityId, scopeEntityGroupIdScope label, or null when the group is unscoped
entityIds, entityGroupIdsEntity scope stored on the group. Empty arrays when unset

matchedPermissions lists the permissions that satisfied a permission leaf for that user, ordered by permission ID. It is empty when the user matched only through a group or user leaf. Under and and or, the permission IDs of all matching branches are combined.

permissions lists every effective permission of the user: permissions assigned to the user and permissions inherited from groups, including ancestor groups. The list is not limited to the filter.

A permission object has id, module, roles, context, isReadonly, modifiedDate, and modifiedOperation. roles is a map of role type to role values. context has entities and entityGroups. isReadonly is true for a mirrored permission. The permission shape is described in IAM roles and permissions.

groups, matchedPermissions, and permissions are then reduced to what the caller can view. The user stays in data even when every group or permission was removed, and total does not change.

The response is gzip or Brotli compressed when the request sends Accept-Encoding: gzip or Accept-Encoding: br.

Limits and errors

Filter limits

LimitValueWhat happens past it
Filter depth3400. The root node is depth 1, and each entry in conditions is one level deeper. An and of an or of leaves is accepted. One more and or or around those leaves is rejected: filter.conditions[0].conditions[0].conditions[0] is nested deeper than 3.
Leaves in one filter20400: filter has more than 20 leaves.
Values on one permission leaf100Role values, entity IDs, and entity group IDs are counted together. 400: <path> has more than 100 values. A blank value returns 400: <path> contains a blank value.
groupIds on one group leaf100Same 100-value error. A blank ID returns 400
userIds on one user leaf500400: <path> has more than 500 values.

<path> is the position of the leaf in the filter: filter for a leaf at the root, filter.conditions[1] for the second condition of the root and or or. The same path is the key in errors.

Empty conditions, empty groupIds, and empty userIds return 400. A roleSets entry must contain at least one role type, and every role type in it must have at least one value.

Values that search does not match

A permission whose module name is longer than 255 characters is not returned by a permission leaf. Until IAM finishes indexing existing permissions after an upgrade, such a permission can still be returned. A role, entity, or entity group value longer than 1024 UTF-8 bytes is not matched: a leaf that lists such a value does not match that permission, while a leaf that omits it can still match the permission on its other fields.

Performance

There is no cap on the set of users that search or an empty filter matches. The full set of matching users is evaluated before paging, so the response time depends on the number of matches rather than on take.

Errors

StatusWhenBody
401The caller is not authenticatedEmpty
403The caller has no users:view accessEmpty
403include asks for groups or permissions the caller cannot viewYou do not have view access to groups. or You do not have view access to permissions.
400take is outside 1 to 500, the filter breaks a limit above, include has an unknown or blank value, or the JSON has an unknown property or an unknown typeValidation problem. errors maps the field (or the JSON path, such as $.filter.bar) to the messages

A validation failure looks like this:

{ "status": 400, "title": "One or more validation errors occurred.", "errors": { "take": ["take must be between 1 and 500."] } }

More examples

Paging through users in the caller’s scope

POST /api/user/search?take=1

{}
{ "total": 40, "data": [ { "user": { "id": "0b1c2d3e-0000-4000-8000-000000000001", "username": "ada", "firstName": "Ada", "lastName": "Nowak", "email": "ada.nowak@example.com", "enabled": true, "emailVerified": true, "phoneNumber": null, "locale": "en", "entityIds": ["entity-01"], "entityGroupIds": [], "createdDate": "2026-01-15T09:00:00Z", "modifiedDate": "2026-11-02T14:10:00Z", "modifiedOperation": null } } ] }

total is 40, so the next page is skip=1&take=1.

Direct group members with groups and permissions

Direct members only, with their groups and effective permissions:

{ "filter": { "type": "group", "groupIds": ["6f1c0a20-0000-4000-8000-000000000010"], "includeSubgroups": false }, "include": ["groups", "matchedPermissions", "permissions"] }

matchedPermissions is [] for every user, because the filter has no permission leaf. permissions lists the effective permissions the caller can view, and groups lists the direct memberships the caller can view:

{ "total": 1, "data": [ { "user": { "id": "0b1c2d3e-0000-4000-8000-000000000001", "username": "ada", "firstName": "Ada", "lastName": "Nowak", "email": "ada.nowak@example.com", "enabled": true, "emailVerified": true, "phoneNumber": null, "locale": null, "entityIds": ["entity-01"], "entityGroupIds": [], "createdDate": "2026-01-15T09:00:00Z", "modifiedDate": null, "modifiedOperation": null }, "groups": [ { "id": "6f1c0a20-0000-4000-8000-000000000010", "name": "Supervisors", "path": "/Supervisors", "parentId": null, "scopeEntityId": "entity-01", "scopeEntityGroupId": null, "entityIds": ["entity-01"], "entityGroupIds": [] } ], "matchedPermissions": [], "permissions": [ { "id": "perm-01", "module": "reporting", "roles": { "action": ["view"], "resource": ["reports"] }, "context": { "entities": ["entity-01"], "entityGroups": [] }, "isReadonly": false, "modifiedDate": "2026-10-01T08:00:00Z", "modifiedOperation": null } ] } ] }

Exact role set

The permission must have action=view and nothing else in roles:

{ "filter": { "type": "permission", "moduleName": "reporting", "rolesExact": true, "roleSets": [{ "action": ["view"] }] } }

A permission with action=view and resource=reports does not match.

Both conditions apply. Unknown and out-of-scope IDs are skipped.

{ "filter": { "type": "user", "userIds": [ "0b1c2d3e-0000-4000-8000-000000000001", "0b1c2d3e-0000-4000-8000-000000000099" ] }, "search": "ada" }
  • GET /api/user returns users in the same users:view scope with the same text search. It does not accept the filter tree.
  • POST /api/user/filterByPermissions is the previous permission search. See the comparison at the top of this page.
  • IAM roles and permissions describes roles, context, and mirrored permissions.