System Settings API
This article describes how to change the system settings stored in the PA_CONFIGURATION table. QPR ProcessAnalyzer expression language provides functions to read and change system settings, as described below. In addition, there is the REST API endpoint POST /api/SetSystemSettings to change system settings.
GetSystemSettings
Returns all effective and readable system settings stored in the PA_CONFIGURATION table as a dictionary. Settings containing secrets or passwords are omitted, such as SnowflakeConnectionString, OpenAIAPIKey, and McpServerConfiguration.McpApiKey. Global GenericWrite permission is needed to use this function.
When a returned setting is declared as JSON, the function returns a well-formed value as a structured object or array. Nested properties are not filtered based on their names or values. Settings declared as strings remain strings even when their values contain valid JSON.
Environment variable values are applied after database values in the PA_CONFIGURATION table. When a setting has an effective environment variable value, GetSystemSettings returns that environment value rather than the persisted database value.
Example
Get all readable system settings:
ToJson(GetSystemSettings());
SetSystemSettings
Changes one or more system settings that are stored in the PA_CONFIGURATION table. The parameter is a hierarchical dictionary where each key name is a setting name and each key value is a setting value. Global GenericWrite permission is needed to change system settings.
Settings that are configured in the ApiRestrictedSettings setting are read-only and cannot be changed using this function. The ApiRestrictedSettings setting itself is always read-only.
Settings effective immediately
The following settings are effective immediately when changed:
- SmtpServer
- SmtpPort
- SmtpAuthenticationUsername
- SmtpAuthenticationPassword
- SmtpEnableSSL
- SmtpFromAddress
- DefaultUiLanguage
- DefaultDateFormat
- DefaultFirstDayOfWeek
- DefaultUse12HourClock
- DefaultColorPalette
- ContentTranslations
- AIAgentDefaultModelName
- SAMLUserIdAttribute
- SAMLGroupsAttribute
- ExternalOAuthServerConfiguration
Settings conditionally effective when changed
- BuiltInOAuthServerConfiguration: Properties of an already-enabled configuration are effective immediately. Enabling or disabling its MCP authentication integration requires a restart.
- McpServerConfiguration.McpApiKey: Replacing a key is effective immediately when API-key authentication was already enabled at startup. Enabling or disabling that authentication requires a restart.
- MeaConnectionString: Changing an existing connection value is effective immediately. Enabling or disabling the built-in MEA MCP tools requires a restart.
- ServiceProviderLocation: Consumers that read the current value, such as OAuth redirects, use the new value immediately. Applying it to SAML registration requires a restart.
Notes
- Setting names are case-sensitive, and only known setting names can be stored.
- Each setting has a distinct data type, and the key value must have that correct data type.
- Settings declared with the JSON data type accept only a valid JSON object or array.
- When an effective setting value comes from an environment variable, the SetSystemSettings function stores the supplied value to PA_CONFIGURATION but does not change the effective value. Subsequent GetSystemSettings calls return the effective value.
Examples
Change the SessionIdleTimeout and BuiltInOAuthServerConfiguration settings:
SetSystemSettings(#{
"SessionIdleTimeout": 1800,
"BuiltInOAuthServerConfiguration": #{
"AcceptedAudiences": ["Audience1", "Audience2"]
}
});
Change the DefaultColorPalette setting:
SetSystemSettings(#{
"DefaultColorPalette": "[ \"#1F77B4\", \"#FF7F0E\", \"#2CA02C\" ]"
});