Suggest users

Autocomplete user suggestions by username or name, with optional scope-based ranking.

Endpoint

GET /api/v1/suggest-users?search=text&scope=repo:teams/ghit/ghit

Authentication

None required for public repos and teams. Optional for private repo scopes.

When scope=repo:<locator> targets a private repo, a valid API token with access to that repo is required for scoped ranking. Without a token (or without access), the request silently falls back to global suggestions.

Parameters

  • search (required) — text to match against username and name. Uses pg_trgm fuzzy matching and prefix matching.
  • scope (optional) — boost users relevant to a scope. Supported values:
    • repo:<locator> — boost users who have participated in threads or pulls on the repo (e.g. repo:teams/ghit/ghit or repo:benw/myrepo)
    • team:<slug> — boost team members and users who have participated in the team's repos
    Invalid or unresolvable scopes silently fall back to global suggestions.

Usage

curl "$GHIT_API_URL/v1/suggest-users?search=ben"
curl \
  "$GHIT_API_URL/v1/suggest-users?search=ben&scope=repo:teams/ghit/ghit"
curl "$GHIT_API_URL/v1/suggest-users?search=cl&scope=team:ghit"

Success

200 OK

{
  "next": null,
  "previous": null,
  "results": [
    { "uuid": "...", "username": "benwilber", "name": "Ben Wilber" },
    { "uuid": "...", "username": "bendev", "name": "Ben Developer" }
  ]
}

Returns up to 15 results. Only active users are included. Results are ranked by exact match, prefix match, scope participation, and trigram similarity.

Errors

  • 400 Bad Request when search is missing or empty.