Child pages
  • WHM API 1 Functions - set_tweaksetting
Skip to end of metadata
Go to start of metadata

Description

This function sets an option's value in WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings) The system stores the keys and values that this function updates in the /var/cpanel/cpanel.config file.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/set_tweaksetting?api.version=1&key=proxysubdomains&value=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/set_tweaksetting?api.version=1&key=proxysubdomains&value=1
 Command Line
whmapi1 set_tweaksetting key=proxysubdomains value=1


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/api/whmapi1

 Output (JSON)
{
    result:{
        metadata:{
            version:1,
            reason:'OK',
            result:1,
            command:'set_tweaksetting'
        }
    }
}
 Output (XML)
<result>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>set_tweaksetting</command>
  </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
keystring

Required

The cpanel.config setting name that corresponds to the desired setting in WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings).

The name of a setting that resides in the /var/cpanel/cpanel.config file.proxysubdomains
modulestring

The Tweak Settings interface section.

The name of a Tweak Settings interface section.Main
valuestring

The value to assign to the setting.

  • If you do not include this parameter in the call, the value defaults to undef.
  • If you include this parameter in the call but do not set a value, the value defaults to an empty value.

A valid string.

For more information about the requirements for values in the cpanel.config settings, read our The cpanel.config File documentation.

example.com

Returns

This function only returns metadata.