Overview
The System Settings API provides endpoints for managing platform-wide configuration and administrative settings for the Alliance IGAD Innovation Hub. Base URL:/api/admin
Authentication: All endpoints require admin authentication via JWT Bearer token with is_admin: true privileges.
Authentication
All admin endpoints require a JWT Bearer token from a user with admin privileges:verify_admin_access middleware checks:
- Valid JWT token
- User has
is_admin: truein token payload
401 Unauthorized- Missing or invalid token403 Forbidden- Valid token but user is not an admin
User Management
List Users
Get User
username(string, required) - User email address
404 Not Found- User does not exist500 Internal Server Error- Failed to retrieve user
Create User
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | User identifier (email format recommended) |
email | string | Yes | User email address |
temporary_password | string | Yes | Initial password (user must change on first login) |
send_email | boolean | No | Send welcome email with credentials (default: true) |
200 OK
400 Bad Request- User already exists500 Internal Server Error- Failed to create user
- Email addresses are automatically normalized to lowercase
- Email is automatically verified (
email_verified: true) - User status is set to
FORCE_CHANGE_PASSWORDrequiring password change on first login - If
send_email: true, Cognito sends a welcome email using custom templates - If
send_email: false, the email is suppressed and credentials must be shared manually
Update User
username(string, required) - User email address
Delete User
username(string, required) - User email address
Enable User
username(string, required) - User email address
Disable User
username(string, required) - User email address
Reset User Password
username(string, required) - User email address
- Sends a password reset email to the user’s registered email address
- User receives a temporary code to set a new password
- Previous password is invalidated
Group Management
List Groups
Add User to Group
username(string, required) - User email addressgroup_name(string, required) - Group name (e.g., “admins”, “users”)
Remove User from Group
username(string, required) - User email addressgroup_name(string, required) - Group name
Configuration Details
AWS Cognito Integration
The system uses AWS Cognito for user management with the following configuration:- Region:
us-east-1(or configured viaAWS_REGIONenvironment variable) - User Pool ID: Configured via
COGNITO_USER_POOL_IDenvironment variable - Client ID: Configured via
COGNITO_CLIENT_IDenvironment variable
User Status Values
Users can have the following status values:CONFIRMED- User has verified email and set passwordFORCE_CHANGE_PASSWORD- User must change password on next login (newly created users)RESET_REQUIRED- Admin has reset the passwordUNCONFIRMED- User has not verified emailDISABLED- User account is disabled
Email Notifications
Whensend_email: true is used during user creation, Cognito sends:
- Welcome Email - Contains temporary password and login instructions
- Custom Templates - Uses platform-specific email templates configured in Cognito
send_email: false:
- No email is sent
- Admin must manually share credentials with the user
- Use this for bulk imports or when using external notification systems
Error Handling
All endpoints follow consistent error response format:200 OK- Successful request201 Created- Resource created successfully400 Bad Request- Validation error or business logic violation401 Unauthorized- Authentication required or failed403 Forbidden- Insufficient permissions (not an admin)404 Not Found- Resource not found500 Internal Server Error- Server-side error
UserExistsException- User already exists (returned as 400)UserNotFoundException- User not found (returned as 404)InvalidParameterException- Invalid input parameters (returned as 400)LimitExceededException- Too many requests (returned as 429)
Best Practices
-
User Creation:
- Always use email addresses as usernames for consistency
- Use strong temporary passwords (min 8 chars, uppercase, lowercase, numbers, symbols)
- Enable
send_emailfor individual user creation - Disable
send_emailfor bulk imports
-
Password Management:
- Use password reset instead of manually setting passwords
- Enforce password change on first login
- Document password requirements in user communications
-
User Lifecycle:
- Disable users instead of deleting for audit trail
- Only delete users when required for data privacy compliance
- Review user groups regularly
-
Group Management:
- Use groups to manage permissions at scale
- Document group purposes and permissions
- Audit group memberships periodically
-
Security:
- Regularly review admin user list
- Use principle of least privilege for group assignments
- Monitor failed authentication attempts
- Implement password rotation policies
Rate Limiting
AWS Cognito enforces rate limits on user management operations:- User operations: 10 requests per second per account
- Bulk operations: Consider batching with delays
429 Too Many Requests error.