Get Global Config

Gets the value of the specified global config key. Sensitive keys (SMTP password, LDAP bind password) are returned as ********. For the list of available keys, see Get Global Configs.

Required Permissions

Requires the Master role.

HTTP Request

GET /api/sonar/global-configs/:key
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/global-configs/smtp_host
Request Parameters
Path Parameters
KeyTypeDescriptionNotes
keyStringGlobal config keyCase-insensitive. The response uses the lowercase form.

Success Response

The response body uses the lowercase form of the requested key as the field name.

{
  "smtp_host": "smtp.example.com"
}
  • {key} (String): Global config value. null if not set, or ******** for masked keys.

Error Responses

Unsupported key

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "invalid option name: foo"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}