Users API

Account management, user search, and connections.

Account

GET /api/account

Get the current user's profile.

Response:

{
  "id": "string",
  "name": "string",
  "email": "string",
  "image": "string | null",
  "provider": "email | google | both",
  "role": "user | admin"
}

PATCH /api/account

Update name and email with validation.

Body:

{
  "name": "string (optional)",
  "email": "string (optional)"
}

PATCH /api/account/password

Change password. Requires current password verification.

Body:

{
  "currentPassword": "string",
  "newPassword": "string"
}

POST /api/account/avatar

Upload a new avatar image.

Content-Type: multipart/form-data

User Search

GET /api/users/search

Search users for mentions and collaboration.

Query params: q (searches username, display name, email)

Results respect privacy controls — only users who have opted into discovery are returned.


GET /api/users/find

Find users by specific criteria. Used for administrative functions.

Connections

GET /api/connections

List the current user's connections.


POST /api/connections

Create a new connection with another user.


GET /api/connections/search

Search for users to connect with.


DELETE /api/connections/[connectionId]

Remove a connection.

Search

Search docs, blog posts, and more.