{% extends "docs/base.html" %} {% block docs_content %}
Autocomplete user suggestions by username or name, with optional scope-based ranking.
GET /api/v1/suggest-users?search=text&scope=repo:teams/pearing/pearing
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.
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/pearing/pearing or repo:benw/myrepo)team:<slug> — boost team members and users who have participated in the team's reposcurl "$PEARING_API_URL/v1/suggest-users?search=ben"
curl \
"$PEARING_API_URL/v1/suggest-users?search=ben&scope=repo:teams/pearing/pearing"
curl "$PEARING_API_URL/v1/suggest-users?search=cl&scope=team:pearing"
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.
400 Bad Request when search is missing or empty.