Using the CLI utility secret_key is another way to generate a key that can be used in XML API calls for authentication in Plesk. Plesk’s XML API interface provides the secret_key operator, which serves the same purpose.

Usage

secret_key <command> [
<option_1> [<param>]
[<option_2> [<param>]]
]

Example

The following command creates a secret key and associates it with the IP address 192.168.1.100:

plesk bin secret_key -c -ip-address 192.168.1.100

Commands

Command Parameter Description Example
--create or -c  

Generates a secret key for the specified IP address.

Used with the -ip-address and -description options.

To create a secret key associated with the IP address 192.168.1.100 and the description “test key”:

plesk bin secret_key --create -ip-address 192.168.1.100 -description "test key"

--list or -l   Displays a list of existing secret keys, their IP addresses and descriptions.

To display all secret keys issued by Plesk:

plesk bin secret_key --list

--delete or -d <key>

Removes the specified secret key.

Used with the -key option.

To delete the key becc9673c714723515ca9bbeb6c83c73:

plesk bin secret_key --delete -key becc9673c714723515ca9bbeb6c83c73

--help or -h   Displays help on the usage of the utility.

To view help on the use of the utility:

plesk bin secret_key -h

Options

Option Parameter Description Example
-ip-address <ip address>

The IP address with which the key is associated. From this address you are going to send XML API requests to the Plesk server.

Used with the --create command.

To create a secret key associated with the IP address 192.168.1.100 and the description “test key”:

plesk bin secret_key -create -ip-address 192.168.1.100 -description "test key"

-description <string> Description of the secret key. Used with the --create command.  
-key <string> Secret key. Used with the --delete command.

To delete the key becc9673c714723515ca9bbeb6c83c73:

plesk bin secret_key --delete -key becc9673c714723515ca9bbeb6c83c73