Overview
The User Management module is the core authentication and user identity system for RcoinX. It provides a complete suite of features for user registration, authentication, profile management, and advanced security features including multi-factor authentication (MFA), WebAuthn, and OAuth integrations.Module Architecture
The User Management module is built with a modular architecture consisting of the following components:Key Features
1. Core Authentication
- Email and phone number-based registration
- Secure login with JWT tokens
- Token refresh mechanism
- Remember me functionality
- Password management
- Account freeze/unfreeze
- Account deletion
2. Profile Management
- User profile CRUD operations
- Profile image upload/delete
- Email and phone number management
- Username updates
- Metadata support
3. Multi-Factor Authentication (MFA)
- TOTP (Time-based One-Time Password)
- Email OTP
- SMS OTP
- Action-based MFA requirements
- Backup codes
- Multiple MFA method support
4. WebAuthn Support
- Passkey registration
- Biometric authentication
- Hardware security key support
- Credential management
5. OAuth Integration
- Google OAuth
- Telegram OAuth
- Multiple provider support
- Account linking/unlinking
6. Session Management
- Active session tracking
- Multi-device session management
- Remote logout
- Login activity history
- Session statistics
7. Security Features
- Rate limiting on sensitive endpoints
- Audit logging
- Login attempt tracking
- IP-based tracking
- User agent detection
Base URL
All User Management APIs are accessible under the base URL:Authentication
Most endpoints require authentication using JWT Bearer tokens. Include the access token in the Authorization header:Token Types
- Access Token: Short-lived token for API requests (default: 15 minutes)
- Refresh Token: Long-lived token for obtaining new access tokens (default: 7 days)
- Remember Me Token: Extended refresh token (default: 30 days)
Token Refresh Flow
When an access token expires, use the refresh token to obtain a new access token:Response Format
All API responses follow a consistent format:Success Response
Error Response
Common HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request - Invalid input |
| 401 | Unauthorized - Invalid or expired token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 409 | Conflict - Resource already exists |
| 422 | Unprocessable Entity - Validation error |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
| 503 | Service Unavailable |
Error Handling
Implement proper error handling in your frontend application:Rate Limiting
The API implements rate limiting on sensitive endpoints:- MFA Verification: 5 attempts per minute
- MFA General Operations: Configurable (default: 100 requests per minute)
- Code Generation: Rate limited per endpoint
429 Too Many Requests status code.
Data Validation
All request payloads are validated. Common validation rules:- Email: Must be valid email format
- Phone: Minimum 10 digits, numeric only
- Country Code: 1-3 digits
- Password: Minimum 8 characters
- Username: 3-50 characters, unique
Metadata Support
Many entities support ameta_data field for storing custom JSON data:
Next Steps
Explore the detailed API documentation for each component:Authentication APIs
Login, register, and token management
Profile Management
User profile operations and settings
MFA
Multi-factor authentication setup and verification
WebAuthn
Passkey and biometric authentication
OAuth
Third-party provider integration
Session Management
Session tracking and login activity
SDK & Libraries
While you can make direct HTTP requests, we recommend using standard HTTP clients:Support
For questions and support:- Email: support@rcoinx.com
- Documentation: https://docs.rcoinx.com
- GitHub Issues: https://github.com/rcoinx/backend/issues