Settings Endpoints
Manage system configuration and settings.
Get Settings
Get all system settings.
GET /api/v1/settings
Response
Success (200):
{
"general": {
"site_name": "Bloqd",
"site_url": "https://bloqd.example.com",
"timezone": "UTC"
},
"security": {
"session_timeout": 86400,
"mfa_required": false,
"password_min_length": 8
},
"notifications": {
"discord_enabled": true,
"email_enabled": true,
"daily_summary": true,
"daily_summary_hour": 8
},
"integrations": {
"abuseipdb_enabled": true,
"abuseipdb_rate_limit": 1000
}
}
Update Settings
Update system settings.
PATCH /api/v1/settings
Request Body
{
"general": {
"site_name": "My Bloqd Instance"
},
"security": {
"mfa_required": true
}
}
Response
Success (200):
{
"message": "Settings updated",
"updated_fields": ["general.site_name", "security.mfa_required"]
}
Get Discord Settings
Get Discord integration settings.
GET /api/v1/settings/discord
Response
Success (200):
{
"enabled": true,
"webhook_url": "https://discord.com/api/webhooks/...",
"notify_bans": true,
"notify_syncs": true,
"notify_errors": true,
"daily_summary": true,
"daily_summary_hour": 8
}
Update Discord Settings
Update Discord integration settings.
PATCH /api/v1/settings/discord
Request Body
{
"enabled": true,
"webhook_url": "https://discord.com/api/webhooks/...",
"notify_bans": true,
"daily_summary_hour": 9
}
Response
Success (200):
{
"message": "Discord settings updated"
}
Test Discord
Send a test message to Discord.
POST /api/v1/settings/discord/test
Response
Success (200):
{
"message": "Test message sent successfully"
}
Get Email Settings
Get SMTP/email settings.
GET /api/v1/settings/email
Response
Success (200):
{
"enabled": true,
"smtp_host": "smtp.example.com",
"smtp_port": 587,
"smtp_user": "notifications@example.com",
"smtp_tls": true,
"from_address": "Bloqd <notifications@example.com>",
"recipients": ["admin@example.com"],
"daily_summary": true,
"daily_summary_hour": 8
}
Update Email Settings
Update SMTP/email settings.
PATCH /api/v1/settings/email
Request Body
{
"smtp_host": "smtp.example.com",
"smtp_port": 587,
"smtp_user": "notifications@example.com",
"smtp_pass": "your_password",
"smtp_tls": true,
"from_address": "Bloqd <notifications@example.com>",
"recipients": ["admin@example.com", "security@example.com"]
}
Response
Success (200):
{
"message": "Email settings updated"
}
Test Email
Send a test email.
POST /api/v1/settings/email/test
Request Body
{
"recipient": "test@example.com"
}
Response
Success (200):
{
"message": "Test email sent successfully"
}
Get AbuseIPDB Settings
Get AbuseIPDB integration settings.
GET /api/v1/settings/abuseipdb
Response
Success (200):
{
"enabled": true,
"api_key_set": true,
"rate_limit": 1000,
"reports_today": 247,
"last_report": "2024-01-15T10:30:00Z"
}
Update AbuseIPDB Settings
Update AbuseIPDB integration settings.
PATCH /api/v1/settings/abuseipdb
Request Body
{
"enabled": true,
"api_key": "your_api_key",
"rate_limit": 1000
}
Response
Success (200):
{
"message": "AbuseIPDB settings updated"
}
Get License Info
Get current license information.
GET /api/v1/settings/license
Response
Success (200):
{
"tier": "personal",
"server_limit": 3,
"servers_used": 2,
"features": {
"abuseipdb": true,
"custom_templates": true,
"siem": false,
"terminal": false,
"port_knocking": false
},
"expires_at": null,
"registered_to": "user@example.com"
}
Activate License
Activate a license key.
POST /api/v1/settings/license
Request Body
{
"license_key": "BLOQD-XXXX-XXXX-XXXX"
}
Response
Success (200):
{
"message": "License activated",
"tier": "pro",
"server_limit": 25,
"features": {
"abuseipdb": true,
"custom_templates": true,
"siem": true,
"terminal": true,
"port_knocking": true
}
}
Get OAuth Settings
Get OAuth provider settings.
GET /api/v1/settings/oauth
Response
Success (200):
{
"github": {
"enabled": true,
"client_id_set": true,
"allowed_users": ["user1", "user2"],
"allowed_org": null
},
"google": {
"enabled": false,
"client_id_set": false,
"allowed_domains": []
},
"default_role": "Viewer",
"local_login_disabled": false
}
Update OAuth Settings
Update OAuth provider settings.
PATCH /api/v1/settings/oauth
Request Body
{
"github": {
"enabled": true,
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"allowed_users": ["user1", "user2"]
},
"default_role": "Viewer"
}
Response
Success (200):
{
"message": "OAuth settings updated"
}
Export Settings
Export all settings as JSON.
GET /api/v1/settings/export
Response
Success (200):
{
"version": "1.0.0",
"exported_at": "2024-01-15T10:30:00Z",
"settings": {
"general": {...},
"security": {...},
"notifications": {...},
"integrations": {...}
}
}
Import Settings
Import settings from JSON.
POST /api/v1/settings/import
Request Body
{
"settings": {
"general": {...},
"security": {...}
},
"merge": true
}
If merge is true, only provided settings are updated. If false, all settings are replaced.
Response
Success (200):
{
"message": "Settings imported",
"updated_sections": ["general", "security"]
}
Get Audit Log
Get system audit log.
GET /api/v1/settings/audit
Query Parameters
| Parameter | Type | Description |
|---|---|---|
user_id | integer | Filter by user |
action | string | Filter by action type |
from | string | Start date (ISO 8601) |
to | string | End date (ISO 8601) |
page | integer | Page number |
limit | integer | Items per page |
Response
Success (200):
{
"entries": [
{
"id": 12345,
"user": "admin",
"action": "settings.update",
"details": {
"field": "discord.enabled",
"old_value": false,
"new_value": true
},
"ip_address": "192.168.1.50",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"total": 500,
"page": 1,
"limit": 50
}