Skip to main content
Team.findMember searches the organization that owns the agent for members whose name, email address, or user id matches, and returns the WhatsApp, SMS, and email handles each of them chose to share. Pair it with Channels.send to message a colleague without hard-coding a number. Available in tools, jobs, webhooks, triggers, processors, and workflow code steps. Verified against lua-cli 3.33.0.

Quick example

A search returns a list; disambiguate when more than one member matches.

Methods

findMember(name)

Returns the organization members matching a name, email address, or user id, with their shared handles.
string
required
The text to match: a case-insensitive substring of a member’s full name or of any of their email addresses, or an exact user id. Whitespace only returns no matches.
A member is a person with an active membership in the agent’s organization, as managed in the admin dashboard; deactivated members are never returned. A handle appears in targets only when the member marked it shareable in their profile, so targets can be empty. The organization is derived from the agent; you can’t resolve members of another organization. Returns
DirectoryResolveResult
interface
Example
Errors — the call throws. In a deployed agent the error is a DirectoryResolveError with code and statusCode; in lua test it is a plain Error carrying the server’s message, or Directory resolve failed.
  • name is required when name is empty.
  • Agent is not linked to an organization.
  • A 403 when the agent isn’t yours.

Types

DirectoryResolveResult, DirectoryMatch, and DirectoryTarget are exported from lua-cli with the shapes listed under findMember(name).

See also

  • Channels — send to the handle you resolved
  • User — the end user’s own profile, as opposed to organization members
  • Send proactive messages — cold-start rules per channel