Magidoc

searchPeople
Query

Search for people the calling user can see, returning a list of matching Users. Powers Pie's people-picker UI for assigning Todos, sharing Projects and Recipes, and inviting collaborators.

The search argument is matched against the user's firstName, lastName, primary email, secondary emails (the UserEmail table), and the concatenation "firstName lastName email". Matching is prefix on the individual fields and substring on the concatenated form (the latter only when query length > 1). All comparisons are lowercased and trimmed.

By default the search pool is the caller's organization network: the members of every workspace belonging to an organization the caller is in, plus those organizations' organization-level admins. Workspaces that belong to no organization are not searched. workspaceId does not narrow the results — it ranks that workspace's members first and returns each member's workspace-preferred email address (the id must be a workspace the caller can view, otherwise it is ignored). organizationId narrows the pool to members of that organization's workspaces that contain a project where the caller holds the "admin" or "admin+autoassign" role. existingIds excludes users whose ids are in the list — used by the UI to hide people already added to the current selection.

The prefix/substring search returns at most 10 users. In addition, when search exactly equals one of an account's email addresses (primary or secondary), that single user is also returned — this exact-email match is global, not limited to the caller's network, and ignores existingIds.

Returned Users include isInvite: true (people invited but not yet activated) and accountDeactivated: true (deactivated accounts) by default; clients must filter if they want only active members.

Arguments

#

existingIds

[Int ]

organizationId

search

Non-null

workspaceId

Response

#

Returns [User ].

Example

#