Authentication
All endpoints (except email verification endpoints) require JWT authentication via theAuthorization header:
Get User Information
Response
User ID
Username
Email address
Display name
Avatar URL (S3 URLs are automatically refreshed if expired)
User role (e.g., “USER”, “ADMIN”)
Authentication provider (“local”, “google”, “github”, etc.)
Whether email is verified
Array of installed plugin identifiers
ISO 8601 timestamp
Get Terms of Service Status
Response
Whether the user has accepted terms
Error Responses
- 404 Not Found: User not found
- 500 Internal Server Error: Failed to fetch status
Accept Terms of Service
Response
Success message: “Terms accepted successfully”
Error Responses
- 404 Not Found: User not found
- 500 Internal Server Error: Failed to accept terms
Update User Plugins
Request Body
Plugin identifier (e.g., “web_search”, “mcp_serverName”)
Action to perform: “install” or “uninstall”
Authentication credentials (key-value pairs)
Whether this is an entity-level tool (doesn’t update user.plugins array)
Plugin-Specific Behavior
Web Search Plugin
When installing/uninstallingweb_search, all web search provider keys are managed:
- Tavily, Google Search, Brave Search, SerpAPI, etc.
MCP Servers
For MCP tools (starting withmcp_):
- Install: Saves provided credentials
- Uninstall: Deletes all credentials for the MCP server and disconnects active sessions
- OAuth MCP Servers: Automatically revokes OAuth tokens on uninstall
Response
Returns 200 OK on success. Error responses include status code and message.Error Responses
- 400 Bad Request: Invalid parameters
- 500 Internal Server Error: Plugin update failed
Verify Email
Request Body
Email verification token from the verification link
Response
Returns verification result.Error Responses
- 400 Bad Request: Invalid or expired token
- 500 Internal Server Error: Verification failed
Resend Verification Email
Request Body
Email address to send verification to
Response
Returns success message.Error Responses
- 400 Bad Request: Invalid email or already verified
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Failed to send email
Delete User Account
What Gets Deleted
The following data is permanently removed:- All messages and conversations
- All user sessions
- All presets and settings
- All files (including cloud storage)
- All tool calls and memory entries
- All agents and assistants
- All API keys and tokens
- All conversation tags
- All user prompts and actions
- User profile and authentication data
- ACL entries and group memberships
Response
Success message: “User deleted”
Error Responses
- 403 Forbidden: Account deletion is disabled in server configuration
- 500 Internal Server Error: Deletion failed
User Settings
User-specific settings are managed through a separate sub-route. See the settings endpoint at/api/user/settings for managing user preferences and configuration.
Plugin Management
Available Plugins
Common plugins that can be managed:| Plugin Key | Description | Required Auth |
|---|---|---|
web_search | Web search capability | Provider API keys (Tavily, Google, etc.) |
code_interpreter | Execute code | May require API key depending on provider |
dall-e | Image generation | OpenAI API key |
mcp_<serverName> | MCP server tools | Server-specific credentials |
Plugin Auth Flow
-
Install Plugin:
- Frontend calls
POST /api/user/pluginswithaction: "install"and credentials - Server validates and stores credentials securely
- Plugin is added to user’s installed plugins list
- Frontend calls
-
Update Credentials:
- Call
POST /api/user/pluginswithaction: "install"and new credentials - Existing credentials are updated
- Call
-
Uninstall Plugin:
- Call
POST /api/user/pluginswithaction: "uninstall"andauth: {} - Credentials are deleted
- Plugin is removed from user’s list
- For MCP servers, active connections are disconnected
- Call
MCP OAuth Cleanup
When uninstalling OAuth-enabled MCP servers:- Access and refresh tokens are revoked at the OAuth provider
- Tokens are deleted from the database
- OAuth flow state is cleared from cache
- Active server connections are terminated
Common Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or malformed request |
| 401 | Unauthorized - Invalid or missing JWT token |
| 403 | Forbidden - Operation not allowed (e.g., account deletion disabled) |
| 404 | Not Found - User not found |
| 429 | Too Many Requests - Rate limit exceeded (verification emails) |
| 500 | Internal Server Error - Server-side error occurred |