The users endpoints let authenticated clients inspect their own account and discover other people on the platform. Both routes sit behind theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/abdelhafid37/talkbox/llms.txt
Use this file to discover all available pages before exploring further.
authMiddleware, so every request must carry a valid Bearer token. The password field is never included in any user response — only _id, username, and email are returned.
All endpoints below require the following header:
GET /api/users/me
Returns the profile of the user identified by the JWT in theAuthorization header. The server decodes the token, extracts userId, and performs a findById query that selects only the _id, username, and email fields.
Request body
None.Success response — 200 OK
The user’s MongoDB ObjectId, serialised as a 24-character hex string.
The unique display name chosen at registration.
The email address associated with the account.
Error responses
| Status | Condition |
|---|---|
401 Unauthorized | The Authorization header is absent, malformed, or the token is expired/invalid |
404 Not Found | The userId encoded in the token no longer matches any document in the database |
500 Internal Server Error | An unexpected server error occurred |
Example
GET /api/users
Returns an array of all registered users except the currently authenticated user. The server queries for every document whose_id is not equal to the caller’s userId, selecting only _id, username, and email.
Request body
None.Success response — 200 OK
An array of user objects. Returns an empty array [] if no other users exist.
The user’s MongoDB ObjectId, serialised as a 24-character hex string.
The unique display name of the other user.
The email address of the other user.
Error responses
| Status | Condition |
|---|---|
401 Unauthorized | The Authorization header is absent, malformed, or the token is invalid |
500 Internal Server Error | An unexpected database or server error occurred |
Example
The React client uses this endpoint to populate the chat sidebar with the list of users you can open a conversation with. Because your own account is excluded from the results, every entry in the array is a valid conversation partner.