Skip to main content
GET
/
api
/
settings
System Settings
curl --request GET \
  --url https://api.example.com/api/settings \
  --header 'Content-Type: application/json' \
  --data '
{
  "companySettings": {},
  "maintenanceMode": {},
  "loanSettings": {},
  "enabled": true,
  "message": "<string>",
  "allowedUsers": [
    {}
  ]
}
'
{
  "companySettings": {
    "companyName": "<string>",
    "address": "<string>",
    "phone": "<string>",
    "email": "<string>",
    "logo": "<string>"
  },
  "maintenanceMode": {
    "enabled": true,
    "message": "<string>",
    "allowedUsers": [
      {}
    ]
  },
  "loanSettings": {
    "defaultLateFeePercentage": 123,
    "gracePeriodDays": 123,
    "autoApprovalThreshold": 123
  }
}
Manage global system settings and configurations.

Get Settings

GET /api/settings

Retrieve current system settings.

Authentication

Required. All authenticated users can view settings.

Response

companySettings
object
maintenanceMode
object
loanSettings
object

Example Request

cURL
curl -X GET "https://api.millenium-potters.com/api/settings" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "companySettings": {
    "companyName": "Millenium Potters Cooperative",
    "address": "123 Main Street, Lagos, Nigeria",
    "phone": "+234-800-POTTER",
    "email": "[email protected]",
    "logo": "/uploads/company/logo.png"
  },
  "maintenanceMode": {
    "enabled": false,
    "message": "System maintenance in progress. Please try again later.",
    "allowedUsers": []
  },
  "loanSettings": {
    "defaultLateFeePercentage": 5.0,
    "gracePeriodDays": 3,
    "autoApprovalThreshold": 0
  }
}

Update Settings

PUT /api/settings

Update system settings.

Authentication

Required. Only Admin role can update settings.

Request Body

companySettings
object
Company information settings
maintenanceMode
object
Maintenance mode configuration
loanSettings
object
Loan-related settings

Example Request

cURL
curl -X PUT "https://api.millenium-potters.com/api/settings" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "companySettings": {
      "companyName": "Millenium Potters Cooperative Ltd",
      "phone": "+234-800-NEW-NUMBER"
    },
    "loanSettings": {
      "gracePeriodDays": 5
    }
  }'

Maintenance Mode

GET /api/settings/maintenance

Check maintenance mode status.
{
  "enabled": false,
  "message": "System maintenance in progress"
}

PUT /api/settings/maintenance

Enable or disable maintenance mode.

Request Body

enabled
boolean
required
Maintenance mode status
message
string
Message to display to users
allowedUsers
array
Array of user IDs allowed to access during maintenance
When maintenance mode is enabled, all users except those in the allowedUsers list will be unable to access the system.

Error Responses

Missing or invalid authentication token.
User does not have Admin permissions to modify settings.
Invalid settings values provided.

See Also

Build docs developers (and LLMs) love