User Profile
Manage user profile data and social handles.
Get Current User
Get the authenticated user's profile.
Endpoint: GET /api/me
Response:
{
"id": 1,
"email": "user@example.com",
"username": "alice",
"handle": "alice",
"displayName": "Alice Smith",
"createdAt": "2024-01-01T00:00:00Z"
}
Get User by Handle
Look up a user by their @handle.
Endpoint: GET /api/handles/resolve?handle=alice
Response:
{
"userId": 1,
"handle": "alice",
"displayName": "Alice Smith"
}
Check Handle Availability
Check if a handle is available.
Endpoint: GET /api/handles/check?handle=newhandle
Response:
{
"available": true
}
Or if taken:
{
"available": false,
"reason": "Handle is already in use"
}
Update Handle
Change the current user's handle.
Endpoint: POST /api/me/handle
Request Body
{
"handle": "newalice"
}
Response:
{
"success": true,
"handle": "newalice"
}
Handle Rules
- 3-20 characters
- Must start with a letter
- Alphanumeric, underscores, and periods only
- No consecutive periods
- 30-day cooldown between changes
Update Profile
Update profile information.
Endpoint: PATCH /api/me
Request Body
| Field | Type | Description |
|---|---|---|
displayName | string | Display name |
bio | string | Profile bio |
avatarUrl | string | Avatar image URL |
curl -X PATCH "https://travelmode2.replit.app/api/me" \
-H "Authorization: Bearer tm_your_api_key" \
-H "Content-Type: application/json" \
-d '{"displayName": "Alice S.", "bio": "World traveler"}'