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/search |
POST /api/user/filterByPermissions |
|
|---|---|---|
| Users returned | Users inside the caller's users:view scope, same as GET /api/user |
Every permission match, not limited to the caller's users:view scope |
| Paging | skip and take |
None. The response lists every match |
| Filter | Tree of and, or, permission, group, and user nodes |
One module, a flat role list, entities, and entity groups |
| Default item | user only |
user, 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.
| Access | Required when |
|---|---|
users:view |
Every call. Without it the response is 403 and the body is empty |
groups:view |
include contains groups. Without it the response is 403 and the body is You do not have view access to groups. |
permissions:view |
include 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
| Name | Type | Default | Constraints |
|---|---|---|---|
skip |
integer | 0 |
Number of matching users to skip. A value below 0 is treated as 0 |
take |
integer | 100 |
Page 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.
| Name | Type | Description |
|---|---|---|
filter |
object | Filter tree. When omitted, every eligible user in the caller's scope matches |
search |
string | Text search, combined with filter so that a user must satisfy both. Omitted or blank does not narrow the result |
include |
string array | groups, 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.
type |
Fields | Match |
|---|---|---|
and |
conditions: array of nodes, at least one |
The user matches every condition |
or |
conditions: array of nodes, at least one |
The user matches at least one condition |
permission |
See permission | The user holds a permission that satisfies the leaf, directly or through a group |
group |
groupIds: string array, required. includeSubgroups: boolean |
The user is a member of one of the groups |
user |
userIds: string array, required |
The 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
| Field | Required | Behavior |
|---|---|---|
moduleName |
yes | Compared case-insensitively. Blank returns 400 |
roleSets |
no | No role constraint when omitted or empty |
entities |
no | Entity IDs. See the entity rule below |
entityGroups |
no | Entity group IDs. See the entity rule below |
rolesExact |
no | When 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:
| Field | Type | Description |
|---|---|---|
total |
number | Matching users, before paging |
data |
array | The 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:
| Field | Notes |
|---|---|
id, username, email |
Present. username and email may be empty strings |
firstName, lastName, phoneNumber, locale |
String or null |
enabled |
true for every returned user |
emailVerified |
Boolean |
entityIds, entityGroupIds |
Arrays. Empty when the user has none |
createdDate, modifiedDate |
UTC timestamps, or null |
modifiedOperation |
Last 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:
| Field | Notes |
|---|---|
id, name, path, parentId |
Group identity. parentId is null for a top-level group |
scopeEntityId, scopeEntityGroupId |
Scope label, or null when the group is unscoped |
entityIds, entityGroupIds |
Entity 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
| Limit | Value | What happens past it |
|---|---|---|
| Filter depth | 3 | 400. 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 filter | 20 | 400: filter has more than 20 leaves. |
Values on one permission leaf |
100 | Role 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 leaf |
100 | Same 100-value error. A blank ID returns 400 |
userIds on one user leaf |
500 | 400: <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
| Status | When | Body |
|---|---|---|
| 401 | The caller is not authenticated | Empty |
| 403 | The caller has no users:view access |
Empty |
| 403 | include asks for groups or permissions the caller cannot view |
You do not have view access to groups. or You do not have view access to permissions. |
| 400 | take 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 type |
Validation 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.
Lookup by user ID plus a text search
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"
}
Related endpoints
GET /api/userreturns users in the sameusers:viewscope with the same text search. It does not accept the filter tree.POST /api/user/filterByPermissionsis the previous permission search. See the comparison at the top of this page.- IAM roles and permissions describes
roles,context, and mirrored permissions.