Skip to main content
All admin endpoints require authentication with an admin role.

Get System Settings

Retrieve current system settings.

Endpoint

curl -X GET 'https://api.ceboelha.com/admin/settings' \
  -H 'Authorization: Bearer YOUR_ADMIN_TOKEN' \
  -H 'Content-Type: application/json'

Response

success
boolean
required
Indicates if the request was successful
data
object
required
System settings object

Response Example

{
  "success": true,
  "data": {
    "maintenance": {
      "enabled": false,
      "message": "System maintenance in progress. We'll be back soon!",
      "estimatedEnd": null
    },
    "features": {
      "achievements": true,
      "news": true,
      "social": false,
      "ai_insights": true
    },
    "limits": {
      "max_diary_entries_per_day": 20,
      "max_foods_per_meal": 30,
      "max_file_upload_size_mb": 5
    },
    "notifications": {
      "email_enabled": true,
      "push_enabled": true
    },
    "updatedAt": "2024-03-01T10:00:00Z"
  }
}

Update System Settings

Update system settings (partial update supported).

Endpoint

curl -X PATCH 'https://api.ceboelha.com/admin/settings' \
  -H 'Authorization: Bearer YOUR_ADMIN_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "maintenance": {
      "enabled": true,
      "message": "Scheduled maintenance from 2-4 AM UTC",
      "estimatedEnd": "2024-03-02T04:00:00Z"
    },
    "features": {
      "social": true
    }
  }'

Request Body

All fields are optional. Only include settings you want to update. Nested objects are merged.
maintenance
object
Maintenance mode settings
features
object
Feature flags
limits
object
System limits
notifications
object
Notification settings

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Updated system settings object

Response Example

{
  "success": true,
  "data": {
    "maintenance": {
      "enabled": true,
      "message": "Scheduled maintenance from 2-4 AM UTC",
      "estimatedEnd": "2024-03-02T04:00:00Z"
    },
    "features": {
      "achievements": true,
      "news": true,
      "social": true,
      "ai_insights": true
    },
    "limits": {
      "max_diary_entries_per_day": 20,
      "max_foods_per_meal": 30,
      "max_file_upload_size_mb": 5
    },
    "notifications": {
      "email_enabled": true,
      "push_enabled": true
    },
    "updatedAt": "2024-03-01T15:30:00Z"
  }
}

Maintenance Mode

When maintenance mode is enabled:
  • All non-admin users receive a 503 Service Unavailable response
  • The maintenance message is displayed to users
  • Admin users can still access all endpoints
  • The system automatically disables maintenance mode after estimatedEnd time (if set)

Maintenance Response Example

{
  "success": false,
  "error": {
    "code": "MAINTENANCE",
    "message": "Scheduled maintenance from 2-4 AM UTC",
    "estimatedEnd": "2024-03-02T04:00:00Z"
  }
}

Feature Flags

Disabling features will:
  • achievements: Hide achievements section, stop tracking progress
  • news: Hide news/articles section from users
  • social: Disable social features (likes, comments, etc.)
  • ai_insights: Disable AI-powered insights and recommendations

Notes

  • Settings changes are logged in the activity log
  • Maintenance mode changes take effect immediately
  • Feature flag changes may require users to refresh their app
  • Limit changes are validated and enforced on next request
  • Only admins can view and modify system settings

Build docs developers (and LLMs) love