The TalkBox REST API is a JSON-over-HTTP interface that powers user registration, login, profile retrieval, and message exchange. Every response body — success or error — is JSON. Authentication relies on a short-lived JWT that you obtain by calling the login endpoint and then attach to all subsequent requests via anDocumentation 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.
Authorization header.
Base URL
All endpoints share a common prefix. During local development the server listens on port 3000:/api/auth/*, /api/users/*, /api/messages/*) stays the same.
Authentication
TalkBox uses the Bearer token scheme. After a successful login you receive a JWT. Pass it in theAuthorization header of every request that requires authentication:
401 Unauthorized.
Obtaining a token
CallPOST /api/auth/login with valid credentials. The response body contains a single token field:
JWT_SECRET (set via environment variable) and expire after 7 days.
Example authenticated request
Public vs. Protected Endpoints
| Endpoint | Method | Auth Required |
|---|---|---|
/api/auth/register | POST | No |
/api/auth/login | POST | No |
/api/users/me | GET | Yes |
/api/users | GET | Yes |
/api/messages | POST | Yes |
/api/messages | GET | Yes |
/api/messages/:userId | GET | Yes |
Error Responses
All errors follow a consistent shape with a single human-readablemessage field:
| Status Code | Meaning |
|---|---|
400 Bad Request | Missing, invalid, or malformed request fields |
401 Unauthorized | No token, invalid token, or wrong credentials |
404 Not Found | The requested resource does not exist |
409 Conflict | A unique constraint was violated (e.g. duplicate username or email) |
500 Internal Server Error | An unexpected server-side failure occurred |
The
message string in a 401 response is intentionally generic ("Unauthorized." or "Invalid email or password.") to avoid leaking information about which credential was wrong.Explore the API
Auth
Register a new account or log in to obtain a JWT.
Users
Fetch your own profile or list all other users in the app.
Messages
Send messages and retrieve conversation history.