Overview
Search for CycleMate users by name. Requires a minimum of 3 characters for the search query. Returns non-PII user profiles for regular users, or full profiles for admin users.
Authentication
Required : This endpoint requires Auth0 authentication. Include a valid JWT token in the Authorization header.
Query Parameters
Search query for user name (minimum 3 characters, case-insensitive)
Response
Returns an object with a count and array of matching users:
Total number of users matching the search query (max 50 results)
Array of user profile objects matching the search query Show User Object (Regular Users - UserPublicProfileSerializer)
Auth0 user identifier (e.g., “google-oauth2|115315991711634062214”)
URL to user’s profile image (null if not set)
ISO 8601 datetime when the user registered
Show User Object (Admin Users - UserProfileSerializer)
Admins receive additional fields: User’s email address (admin only)
URL to user’s profile image
User’s home address (admin only)
User’s home coordinates (admin only)
User’s work address (admin only)
User’s work coordinates (admin only)
ISO 8601 datetime when the user registered
Request Example
curl "https://api.cyclemate.com/api/users/search/?q=John" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
const response = await fetch (
'https://api.cyclemate.com/api/users/search/?q=John' ,
{
method: 'GET' ,
headers: {
'Content-Type' : 'application/json' ,
'Authorization' : `Bearer ${ yourJwtToken } ` ,
},
}
);
const data = await response . json ();
console . log ( `Found ${ data . count } users` );
console . log ( data . users );
import requests
url = "https://api.cyclemate.com/api/users/search/"
headers = {
"Content-Type" : "application/json" ,
"Authorization" : f "Bearer { your_jwt_token } "
}
params = { "q" : "John" }
response = requests.get(url, headers = headers, params = params)
data = response.json()
print ( f "Found { data[ 'count' ] } users" )
Response Example
Regular User Response
{
"count" : 2 ,
"users" : [
{
"auth0_user_id" : "google-oauth2|115315991711634062214" ,
"name" : "John Doe" ,
"image_url" : "https://storage.googleapis.com/users/profile-123.jpg" ,
"date_registered" : "2025-01-15T10:30:00Z"
},
{
"auth0_user_id" : "auth0|67890abcdef" ,
"name" : "Johnny Smith" ,
"image_url" : null ,
"date_registered" : "2025-03-20T14:45:00Z"
}
]
}
Admin User Response
Admin users receive additional PII fields:
{
"count" : 2 ,
"users" : [
{
"auth0_user_id" : "google-oauth2|115315991711634062214" ,
"email" : "[email protected] " ,
"name" : "John Doe" ,
"image_url" : "https://storage.googleapis.com/users/profile-123.jpg" ,
"home_address" : "123 Main St, San Francisco, CA" ,
"home_coords" : "-122.4194,37.7749" ,
"work_address" : "456 Market St, San Francisco, CA" ,
"work_coords" : "-122.3986,37.7893" ,
"date_registered" : "2025-01-15T10:30:00Z"
},
{
"auth0_user_id" : "auth0|67890abcdef" ,
"email" : "[email protected] " ,
"name" : "Johnny Smith" ,
"image_url" : null ,
"home_address" : null ,
"home_coords" : null ,
"work_address" : null ,
"work_coords" : null ,
"date_registered" : "2025-03-20T14:45:00Z"
}
]
}
Error Responses
Query Too Short (400)
{
"error" : "Search query must be at least 3 characters"
}
Unauthorized (401)
{
"error" : "Authentication credentials were not provided."
}
Notes
Minimum Query Length : Search query must be at least 3 characters
Case-Insensitive : Search is case-insensitive (searching “john” will match “John”, “JOHN”, etc.)
Partial Matching : Search matches partial names (searching “John” will match “Johnny”, “Johnson”, etc.)
Result Limit : Returns maximum 50 results
Privacy : Regular users only see public profile information (no email or address data)
Admin Access : Admin users see full profile information including email and addresses
Use Cases
Event Management : Find users to assign as event owners
User Discovery : Help users find and connect with other cyclists
Admin Operations : Search for users to manage accounts or resolve issues
Community Features : Enable user mentions, tagging, or invitations