Get Virtualizor

Add SSH Keys

Use list ssh keys API to get list of sshkeys added in users through enduser panel.

HTTP Request



actGETusersThe action specified to carry out operation and return dataYes
add_ssh_keysGETIntPass this to add sshkeysYes
vpsidGETIntVPS in which to add ssh keysYes
sshkeysPOSTArrayArray of sshkey id (sshkey id can be retirved using list ssh keys api)Yes

NOTE : SSH keys should be added in User through enduser.

Sample Code



    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);
    $post['vpsid'] = 559;
    $post['sshkeys'] = array(1,6); //ssh key ids which can be get using list ssh keys api
    $output = $admin->add_sshkeys($post);



      "msg":"SSH keys were added sucessfully, SSH Keys will be applied when the VM is Powered off and started"
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list