Delete User

Use Delete User API to delete existing user from server.

The function is for cloud user.

HTTP Request

https://hostname:4083/index.php?act=users&delete=uid

Parameters

NameTypeValueDescriptionRequired
actGETusersThe action will return the list of usersYes
deleteGETIntDelete the user by specifying the user id i.e. uidYes

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

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

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);

    $delete = 389;
    $output = $admin->delete_users($delete);
    print_r(json_encode($output));
?>

Curl

curl -k -X GET -L "https://hostname:4083/index.php?act=users& 
delete=387&api=json&apikey=your_api_key& 
apipass=your_api_pass"

Output

{
    "uid": "372",
    "act": "users",
    "timezone": 1,
    "timenow": "October 7, 2016, 4:34 am",
    "vpsid": "3589",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "Kini",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": "12"
    },
    "pdns": {
        "pdnsid": "12"
    },
    "support_link": "http://softaculous.com",
    "title": "Users",
    "user_list": {
        "389": {
            "uid": "389",
            "password": "$1$.pnnY8lq$YKo8y/zDPqBHtUU0u5kAG1",
            "email": "test@example.com",
            "type": "0",
            "aclid": "0",
            "pid": "372",
            "num_vs": "0",
            "num_users": "0",
            "space": "0",
            "ram": "0",
            "burst": "0",
            "bandwidth": "0",
            "cpu": "0",
            "cores": "0",
            "cpu_percent": "0",
            "num_cores": "0",
            "num_ipv4": "0",
            "num_ipv6": "0",
            "num_ipv6_subnet": "0",
            "allowed_virts": "",
            "network_speed": "0",
            "upload_speed": "0",
            "openvz": "0",
            "xen": "0",
            "xenhvm": "0",
            "kvm": "0",
            "sg": null,
            "mg": null,
            "preferences": null,
            "dnsplid": "0",
            "date_created": "0",
            "service_period": "0",
            "band_suspend": "0",
            "suspended": null,
            "suspend_reason": null
        }
    },
    "done": {
        "msg": "The User has been deleted",
        "goto": "act=users"
    },
    "time_taken": "0.085"
}
Was this helpful to you?