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/pearing/pearing
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. Usespg_trgmfuzzy 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/pearingorrepo:benw/myrepo)team:<slug>— boost team members and users who have participated in the team's repos
Usage
curl "$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"
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 Requestwhensearchis missing or empty.