Update Settings API Documentation
Description
The Update Settings API allows clients to update settings in the database. If a key from the request data is not found in the existing table, a new column with the same name as the key will be added to the existing table, and its value will be updated accordingly.
Endpoint
Method: POST
URL: /update-settings
Request Body
The request body should be a JSON object containing key-value pairs representing the settings to be updated.
Example:
{
"use_proxy": "", // 'Use proxy from settings'
"timeout": 30,
"proxy_mode": "global" | "country",
"change_proxy_on_fail": true,
"proxy_change_attempts": 3,
"batch_size": 10,
"log_to": "file+console",
"default_browser": false,
"floodwait": 10,
"peer_flood": 10,
"local_port": 3000,
"log_folder": "log_folder",
}
Response
200 OK: The settings were updated successfully. 500 Internal Server Error: An error occurred during the update process.
Example Response (200 OK)
{
"text": "Settings updated successfully",
"updated_settings": {
"setting1": "value1",
"setting2": "value2",
}
}
Example Response (500 Internal Server Error)
{
"error": "Error updating settings: <error_message>"
}