🔧 Settings API Test

1. Login

✅ Login successful

Endpoint: POST https://la.deltascripts.com/api/v1/auth/login
Input:
{
    "email": "api@example.com",
    "password": "***"
}
Response:
Status: HTTP 200
{
    "token": "997fa270279850c54bfae479a0cca48c13dcf70461357da1ad3becf134ab385f",
    "user": {
        "id": 49,
        "email": "api@example.com",
        "name": "Updated Tester"
    },
    "expires_at": "2025-12-30 16:29:05"
}

2. List All Settings

📋 List Settings

Endpoint: GET https://la.deltascripts.com/api/v1/settings
Input: (none)
Response:
Status: HTTP 200
[
    {
        "id": 16,
        "setting_key": "api-cors-origins",
        "setting_value": "[\"*\"]",
        "setting_type": "json",
        "category": "api",
        "description": "Allowed CORS origins",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 15,
        "setting_key": "api-logging",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "api",
        "description": "Enable API request logging",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 14,
        "setting_key": "api-rate-limit",
        "setting_value": "1000",
        "setting_type": "int",
        "category": "api",
        "description": "API rate limit per hour",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 10,
        "setting_key": "default-language",
        "setting_value": "en",
        "setting_type": "string",
        "category": "general",
        "description": "Default system language",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 13,
        "setting_key": "maintenance-mode",
        "setting_value": "0",
        "setting_type": "bool",
        "category": "general",
        "description": "Maintenance mode (0=off, 1=on)",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 11,
        "setting_key": "max-file-size",
        "setting_value": "10485760",
        "setting_type": "int",
        "category": "general",
        "description": "Maximum file upload size in bytes",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 12,
        "setting_key": "session-timeout",
        "setting_value": "604800",
        "setting_type": "int",
        "category": "general",
        "description": "Session timeout in seconds (7 days)",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 8,
        "setting_key": "system-name",
        "setting_value": "Translation Manager",
        "setting_type": "string",
        "category": "general",
        "description": "System display name",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 9,
        "setting_key": "system-version",
        "setting_value": "1.0.0",
        "setting_type": "string",
        "category": "general",
        "description": "System version",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 18,
        "setting_key": "email-notifications",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "notifications",
        "description": "Enable email notifications",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 19,
        "setting_key": "notification-email",
        "setting_value": "admin@example.com",
        "setting_type": "string",
        "category": "notifications",
        "description": "Default notification email",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 17,
        "setting_key": "notifications-enabled",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "notifications",
        "description": "Enable system notifications",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 7,
        "setting_key": "smtp-from-email",
        "setting_value": "noreply@yourdomain.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender email",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 6,
        "setting_key": "smtp-from-name",
        "setting_value": "Translation Manager System",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender name",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 1,
        "setting_key": "smtp-hostname",
        "setting_value": "smtp.gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail SMTP server",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-24 00:40:11"
    },
    {
        "id": 4,
        "setting_key": "smtp-port",
        "setting_value": "587",
        "setting_type": "int",
        "category": "smtp",
        "description": "Gmail SMTP port",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 5,
        "setting_key": "smtp-secure",
        "setting_value": "1",
        "setting_type": "int",
        "category": "smtp",
        "description": "Use TLS encryption",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:43:16"
    },
    {
        "id": 2,
        "setting_key": "smtp-username",
        "setting_value": "your-email@gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail username",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 22,
        "setting_key": "test-feature-flag",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "testing",
        "description": "Test feature flag for API testing",
        "is_sensitive": 0,
        "created_at": "2025-08-24 00:40:11",
        "updated_at": "2025-08-24 00:40:11"
    }
]

3. List SMTP Settings

📋 SMTP Settings

Endpoint: GET https://la.deltascripts.com/api/v1/settings?category=smtp
Input: (none)
Response:
Status: HTTP 200
[
    {
        "id": 7,
        "setting_key": "smtp-from-email",
        "setting_value": "noreply@yourdomain.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender email",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 6,
        "setting_key": "smtp-from-name",
        "setting_value": "Translation Manager System",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender name",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 1,
        "setting_key": "smtp-hostname",
        "setting_value": "smtp.gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail SMTP server",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-24 00:40:11"
    },
    {
        "id": 4,
        "setting_key": "smtp-port",
        "setting_value": "587",
        "setting_type": "int",
        "category": "smtp",
        "description": "Gmail SMTP port",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 5,
        "setting_key": "smtp-secure",
        "setting_value": "1",
        "setting_type": "int",
        "category": "smtp",
        "description": "Use TLS encryption",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:43:16"
    },
    {
        "id": 2,
        "setting_key": "smtp-username",
        "setting_value": "your-email@gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail username",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    }
]

4. Get Specific Setting

🔍 Get Setting

Endpoint: GET https://la.deltascripts.com/api/v1/settings/system-name
Input: (none)
Response:
Status: HTTP 200
{
    "id": 8,
    "setting_key": "system-name",
    "setting_value": "Translation Manager",
    "setting_type": "string",
    "category": "general",
    "description": "System display name",
    "is_sensitive": 0,
    "created_at": "2025-08-23 20:27:22",
    "updated_at": "2025-08-23 20:27:22"
}

5. Update SMTP Settings

✏️ Update smtp-hostname

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-hostname
Input:
{
    "value": "smtp.gmail.com",
    "description": "Gmail SMTP server"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-hostname"
}

✏️ Update smtp-username

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-username
Input:
{
    "value": "your-email@gmail.com",
    "description": "Gmail username"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-username"
}

✏️ Update smtp-password

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-password
Input:
{
    "value": "your-app-password",
    "description": "Gmail app password"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-password"
}

✏️ Update smtp-port

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-port
Input:
{
    "value": "587",
    "description": "Gmail SMTP port"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-port"
}

✏️ Update smtp-secure

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-secure
Input:
{
    "value": "1",
    "description": "Use TLS encryption"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-secure"
}

✏️ Update smtp-from-name

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-from-name
Input:
{
    "value": "Translation Manager System",
    "description": "System sender name"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-from-name"
}

✏️ Update smtp-from-email

Endpoint: PUT https://la.deltascripts.com/api/v1/settings/smtp-from-email
Input:
{
    "value": "noreply@yourdomain.com",
    "description": "System sender email"
}
Response:
Status: HTTP 200
{
    "ok": true,
    "key": "smtp-from-email"
}

6. Create Custom Setting

➕ Create Setting

Endpoint: POST https://la.deltascripts.com/api/v1/settings
Input:
{
    "key": "custom-feature-flag",
    "value": "1",
    "type": "bool",
    "category": "features",
    "description": "Enable custom feature",
    "is_sensitive": 0
}
Response:
Status: HTTP 201
{
    "id": "26",
    "key": "custom-feature-flag",
    "value": "1",
    "type": "bool",
    "category": "features",
    "description": "Enable custom feature",
    "is_sensitive": 0
}

7. List Categories

📂 List Categories

Endpoint: GET https://la.deltascripts.com/api/v1/settings/categories
Input: (none)
Response:
Status: HTTP 200
[
    "api",
    "features",
    "general",
    "notifications",
    "smtp",
    "testing"
]

8. List Settings (Include Sensitive)

🔓 Settings with Sensitive Data

Endpoint: GET https://la.deltascripts.com/api/v1/settings?include_sensitive=1
Input: (none)
Response:
Status: HTTP 200
[
    {
        "id": 16,
        "setting_key": "api-cors-origins",
        "setting_value": "[\"*\"]",
        "setting_type": "json",
        "category": "api",
        "description": "Allowed CORS origins",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 15,
        "setting_key": "api-logging",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "api",
        "description": "Enable API request logging",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 14,
        "setting_key": "api-rate-limit",
        "setting_value": "1000",
        "setting_type": "int",
        "category": "api",
        "description": "API rate limit per hour",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 26,
        "setting_key": "custom-feature-flag",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "features",
        "description": "Enable custom feature",
        "is_sensitive": 0,
        "created_at": "2025-12-23 16:29:06",
        "updated_at": "2025-12-23 16:29:06"
    },
    {
        "id": 10,
        "setting_key": "default-language",
        "setting_value": "en",
        "setting_type": "string",
        "category": "general",
        "description": "Default system language",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 13,
        "setting_key": "maintenance-mode",
        "setting_value": "0",
        "setting_type": "bool",
        "category": "general",
        "description": "Maintenance mode (0=off, 1=on)",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 11,
        "setting_key": "max-file-size",
        "setting_value": "10485760",
        "setting_type": "int",
        "category": "general",
        "description": "Maximum file upload size in bytes",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 12,
        "setting_key": "session-timeout",
        "setting_value": "604800",
        "setting_type": "int",
        "category": "general",
        "description": "Session timeout in seconds (7 days)",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 8,
        "setting_key": "system-name",
        "setting_value": "Translation Manager",
        "setting_type": "string",
        "category": "general",
        "description": "System display name",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 9,
        "setting_key": "system-version",
        "setting_value": "1.0.0",
        "setting_type": "string",
        "category": "general",
        "description": "System version",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 18,
        "setting_key": "email-notifications",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "notifications",
        "description": "Enable email notifications",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 19,
        "setting_key": "notification-email",
        "setting_value": "admin@example.com",
        "setting_type": "string",
        "category": "notifications",
        "description": "Default notification email",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 17,
        "setting_key": "notifications-enabled",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "notifications",
        "description": "Enable system notifications",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:27:22"
    },
    {
        "id": 7,
        "setting_key": "smtp-from-email",
        "setting_value": "noreply@yourdomain.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender email",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 6,
        "setting_key": "smtp-from-name",
        "setting_value": "Translation Manager System",
        "setting_type": "string",
        "category": "smtp",
        "description": "System sender name",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:05"
    },
    {
        "id": 1,
        "setting_key": "smtp-hostname",
        "setting_value": "smtp.gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail SMTP server",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-24 00:40:11"
    },
    {
        "id": 3,
        "setting_key": "smtp-password",
        "setting_value": "your-app-password",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail app password",
        "is_sensitive": 1,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 4,
        "setting_key": "smtp-port",
        "setting_value": "587",
        "setting_type": "int",
        "category": "smtp",
        "description": "Gmail SMTP port",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 5,
        "setting_key": "smtp-secure",
        "setting_value": "1",
        "setting_type": "int",
        "category": "smtp",
        "description": "Use TLS encryption",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-08-23 20:43:16"
    },
    {
        "id": 2,
        "setting_key": "smtp-username",
        "setting_value": "your-email@gmail.com",
        "setting_type": "string",
        "category": "smtp",
        "description": "Gmail username",
        "is_sensitive": 0,
        "created_at": "2025-08-23 20:27:22",
        "updated_at": "2025-09-23 06:20:04"
    },
    {
        "id": 22,
        "setting_key": "test-feature-flag",
        "setting_value": "1",
        "setting_type": "bool",
        "category": "testing",
        "description": "Test feature flag for API testing",
        "is_sensitive": 0,
        "created_at": "2025-08-24 00:40:11",
        "updated_at": "2025-08-24 00:40:11"
    }
]

9. Delete Custom Setting

🗑️ Delete Setting

Endpoint: DELETE https://la.deltascripts.com/api/v1/settings/custom-feature-flag
Input: (none)
Response:
Status: HTTP 204

🎉 Settings API Test Completed!

Summary:

📋 Suggested API Calls for SMTP Configuration:

// Configure SMTP settings
PUT /api/v1/settings/smtp-hostname
{
  "value": "smtp.gmail.com",
  "description": "SMTP server hostname"
}

PUT /api/v1/settings/smtp-username
{
  "value": "your-email@gmail.com",
  "description": "SMTP username"
}

PUT /api/v1/settings/smtp-password
{
  "value": "your-app-password",
  "description": "SMTP password (will be hidden in responses)"
}

PUT /api/v1/settings/smtp-port
{
  "value": "587",
  "description": "SMTP port number"
}

PUT /api/v1/settings/smtp-secure
{
  "value": "1",
  "description": "SMTP security (0=none, 1=tls, 2=ssl)"
}

PUT /api/v1/settings/smtp-from-name
{
  "value": "Your System Name",
  "description": "Default sender name"
}

PUT /api/v1/settings/smtp-from-email
{
  "value": "noreply@yourdomain.com",
  "description": "Default sender email"
}