Appearance
Update Settings
Update system settings and configuration. Only users with the settings scope can modify settings.
📖 Configuration Reference: For detailed information about all configuration fields, structure, and valid values, see the Complete Configuration Documentation.
Request
http
PUT /api/settingsAuthentication Required: Must include JWT token in Authorization header.
Required Scope: settings
Content-Type: application/json
Request Body
A JSON object containing one or more of the following top-level keys (all optional, only provided fields are updated):
json
{
"api": {
"api_port": 8080,
"api_http_port": 8081,
"api_jwt_secret": "your-64-character-jwt-secret-key-here-must-be-exactly-64-chars",
"private_key": "/path/to/private.key",
"public_key": "/path/to/public.key"
},
"database": {
"enabled": true,
"sqluser": "ipcom_user",
"sqlpass": "secure_password",
"sqlhost": "localhost",
"sqldatabase": "ipcom_db",
"sqlport": 3306,
"remove_lost_objects_age": 30,
"remove_events_age": 365,
"device_session_log_count": 10
},
"device_status_output": {
"enabled": true,
"port": 9000,
"encryption_enabled": false,
"encryption_key": "16-character-key"
},
"general": {
"instance_name": "IPCom Server",
"synchronize_device_time_interval": 3600
},
"ignorable_startup_events": [
{
"event_code": "0x001",
"group_no": "0x01",
"zone_no": "0x001"
}
],
"internal_events": [
{
"type": "heartbeat",
"classificator": "E",
"event_code": "0x100",
"group_no": "0x01",
"zone_no": "0x001",
"name": "System Heartbeat"
}
],
"outputs": [
{
"id": 1,
"name": "TCP_Output",
"type": 1,
"protocol": "TCP",
"identificator": "output1",
"oid": 12345,
"receiver_number": 1,
"line_number": 1
}
],
"receivers": {
"tcp_receivers": [
{
"id": 1,
"name": "Receiver1",
"port": 9001,
"encryption_password": "secret"
}
],
"udp_receivers": [
{
"id": 2,
"name": "Receiver2",
"port": 9002
}
]
},
"tracker": {
"timeout_multiplier": 3,
"sms_timeout_multiplier": 5,
"timeout_tolerance": 30,
"sms_timeout_tolerance": 60,
"event_count_for_restore": 3,
"event_count_for_restore_sms": 2
},
"users": [
{
"id": 1,
"login": "admin",
"password": "secure_password",
"token_time": 1440,
"scopes": ["settings", "users", "events", "objects"],
"visible_receivers": {
"all": true,
"custom": []
}
}
]
}Example Request
bash
curl -X PUT "http://your-server-ip:port/api/settings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"general": {
"instance_name": "My IPCom Server"
},
"api": {
"api_port": 8080
}
}'Response
Success (200 OK)
json
{
"success": true
}Error Responses
All error responses are returned as plain text:
401 Unauthorized
NOT_LOGGED_IN403 Forbidden
FORBIDDEN500 Internal Server Error
E_3Validation Rules
All updated fields are validated before changes are applied. Invalid data will result in a plain text error response.
API Settings Validation
api_portandapi_http_portmust be between 1 and 65535api_jwt_secretmust be exactly 64 characters and not emptyprivate_keyandpublic_keymust be non-empty and point to valid PEM files
Database Settings Validation
- If enabled,
sqluser,sqlpass,sqlhost, andsqldatabasemust be non-empty sqlportmust be between 1 and 65535 (default 3306 if 0)- Database connection is validated for connectivity
remove_lost_objects_ageandremove_events_agemust be between 1 and 365 daysdevice_session_log_countmust be between 1 and 25
General Settings Validation
instance_namemust be non-emptysynchronize_device_time_intervalmust be greater than 0
Receivers Validation
- Each receiver must have a unique, non-zero
idand non-emptyname - TCP/UDP ports must be between 1 and 65535 and unique per category
- Encryption password must be either 6 or 16 characters for IP/Modem receivers
- COM/Modem receivers must have valid
port_idand reference existing COM terminals
Outputs Validation
- Each output must have a unique, non-zero
idand non-emptyname type,protocol, andidentificatormust be within allowed rangesoid,receiver_number, andline_numbermust be within allowed ranges- SIA DC09 settings: encryption key must be valid if encryption is enabled
- Filters must have valid receiver numbers and settings
Users Validation
- Each user must have a unique, non-zero
id, non-emptyloginandpassword token_timemust be between 1 and 5,256,000 minutes (10 years)- Scopes must be from the allowed set:
settings,users,events,objects - If
visible_receivers.allis false,custommust not be empty - User count may be limited by license
Tracker Settings Validation
timeout_multiplierandsms_timeout_multipliermust be between 1 and 100timeout_toleranceandsms_timeout_tolerancemust be between 0 and 3600event_count_for_restoreandevent_count_for_restore_smsmust be between 1 and 10
Internal Events Validation
typemust be a valid enum valueclassificatormust be "E" or "R"event_code,group_no, andzone_nomust be valid hex strings and within allowed rangesnamemust be non-empty
Device Status Output Validation
portmust be between 1 and 65535- If encryption is enabled,
encryption_keymust be exactly 16 characters
Ignorable Startup Events Validation
event_code≤ 0xFFF,group_no≤ 0xFF,zone_no≤ 0xFFF- Each triplet (event_code, group_no, zone_no) must be unique
Update Examples
Update Server Name
bash
curl -X PUT "http://your-server-ip:port/api/settings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"general": {
"instance_name": "Production IPCom Server"
}
}'Update API Port
bash
curl -X PUT "http://your-server-ip:port/api/settings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"api": {
"api_port": 9090
}
}'Add New User
bash
curl -X PUT "http://your-server-ip:port/api/settings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"users": [
{
"id": 2,
"login": "operator",
"password": "operator_password",
"token_time": 480,
"scopes": ["events", "objects"],
"visible_receivers": {
"all": false,
"custom": [1, 2]
}
}
]
}'Update Database Settings
bash
curl -X PUT "http://your-server-ip:port/api/settings" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"database": {
"enabled": true,
"sqlhost": "db.example.com",
"sqlport": 5432,
"remove_events_age": 180
}
}'Important Notes
- Partial updates: Only fields provided in the request are updated; others remain unchanged
- Settings scope required: Only users with
settingsscope can modify settings - Validation: All fields are validated before applying changes
- Plain text errors: Error responses are not in JSON format
- Cross-validation: Receivers and outputs are cross-validated for consistency
- Immediate effect: Most settings take effect immediately; some may require restart