Member Search - Huddle/huddle-apis GitHub Wiki

Summary

The Member Search API returns members matching a text query. It is intended for lookup across the workspaces the authenticated user can access, with an optional filter to a single workspace.

The endpoint lives on the members API path (same service as Member autocomplete). Use the exact URL from API responses where possible.

Operations

Method Path Purpose Details
GET /members/search?q=dom&hits=10 Search members Jump

Search members

GET /members/search

Results match the start of first name, last name, or email (see Member autocomplete for a similar member payload). The caller can appear in results.

All workspaces the user can access

Results are limited to members in workspaces the authenticated user belongs to (and to companies associated with that user in the search index).

Request

GET /members/search?q=dom&hits=10 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
  "links": [
    { "rel": "self", "href": "/members/search?q=dom&hits=10" }
  ],
  "members": [
    {
      "links": [
        { "rel": "avatar", "href": "/members/users/456/avatar?h=...", "type": "image/jpg" },
        { "rel": "profile", "href": "/user/456" }
      ],
      "name": "Dominic Green",
      "email": "[email protected]",
      "rel": "member",
      "identity": {
        "email": "[email protected]"
      }
    }
  ]
}

The same payload is available as XML with Accept: application/vnd.huddle.data+xml (root element memberAutocomplete).

Single workspace

Optional query parameter workspaceId restricts results to that workspace. The caller must be a member of that workspace.

Request

GET /members/search?q=dom&hits=10&workspaceId=123 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

Same JSON (or XML) shape as above; the self link includes the same query string (including workspaceId when it was applied).

If single-workspace search is not enabled for the environment, workspaceId is ignored and the API behaves like the all-workspaces search.

Parameters

Name Description Methods Optional Default
q Search text. Must not be empty or whitespace-only. Unlike company autocomplete, a single character is allowed. GET No
hits Maximum number of results. GET Yes 10 (valid range 1–50)
workspaceId Workspace to restrict the search to. GET Yes — (omitted = all caller workspaces)

Link relations

Name Description Methods
self The URI of this search result (includes q, hits, and workspaceId when used). GET

Member entries include avatar and profile links; they do not include self or alternate on the member itself.

Other responses

Case Response
q is missing, empty, or whitespace only 400 Bad Request
hits is not an integer, or is outside 1–50 400 Bad Request (may include an error body for invalid hit count)
workspaceId is not a positive integer 400 Bad Request (e.g. invalid or non-numeric value)
Member search is disabled for the environment 404 Not Found
No actor record for the authenticated user 404 Not Found
Actor has no company IDs in the index 404 Not Found
Actor has no workspace IDs in the index 404 Not Found
workspaceId is not a workspace the caller belongs to 404 Not Found
POST, PUT, or DELETE 405 Method Not Allowed
Search backend unavailable 503 Service Unavailable

See also

  • MemberAutocomplete — company-scoped autocomplete (GET /members/companies/{companyId}/autocomplete)