User API Documentation
Overview
The User API provides endpoints for managing users in the wallet service, including creation, updates, and user management operations.Base URL
/api/v1/users
Authentication
All endpoints require authentication using an API key in the request headers:X-API-KEY: Your API keyX-Tenant-ID: Tenant identifier (required for most endpoints)countryCode: Country code (required for user creation)
Endpoints
Create User
Create a new user in the system. Endpoint:POST /register
Headers:
X-API-KEY(optional): API key for authenticationX-Tenant-ID: Tenant identifiercountryCode: Country code
Update User
Update an existing user’s information. Endpoint:PATCH /update
Headers:
X-API-KEY(optional): API key for authenticationX-Tenant-ID: Tenant identifier
Get Users
Retrieve users with filtering and pagination. Endpoint:GET /
Headers:
X-API-KEY(optional): API key for authenticationX-Tenant-ID(optional): Tenant identifier
userId: Filter by user ID (comma-separated for multiple IDs)tenantId: Filter by tenant IDfullName: Filter by full namephoneNumber: Filter by phone number (comma-separated for multiple numbers)email: Filter by emailcountry: Filter by country code (comma-separated for multiple countries)type: Filter by user type (comma-separated for multiple types)page: Page number (default: 0)size: Page size (default: 20)sort: Sort field and direction (e.g., “createdAt,desc”)
Activate/Deactivate User
Activate or deactivate a user account. Endpoint:GET /{userId}/{action}
Headers:
X-API-KEY(optional): API key for authenticationX-Tenant-ID(optional): Tenant identifier
userId: User IDaction: Action to perform (ACTIVATE or DEACTIVATE)
Error Responses
All endpoints may return the following error responses: 401 UnauthorizedNotes
- All timestamps are in ISO-8601 format
- User types:
- TENANT_ADMIN: Can manage users within their tenant
- TENANT_USER: Regular user within a tenant
- Platform admins can create users for any tenant
- Tenant admins can only create users for their own tenant
- Regular users can only update their own profile
- User activation/deactivation:
- Platform admins can activate/deactivate any user
- Tenant admins can only activate/deactivate users in their tenant
- Regular users cannot activate/deactivate accounts
- Email addresses must be unique across the system
- Phone numbers must be valid for the specified country
- User passwords are encrypted before storage
- API keys are automatically generated for new users
- User history is maintained for audit purposes
- Deleted users are soft-deleted and can be restored