You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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

Description

This function removes a cPanel user account's archives.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/delete_account_archives?api.version=1&user=username&mountpoint=%2Fhome%2Fexample
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/delete_account_archives?api.version=1?user=username&mountpoint=%2Fhome%2Fexample
 Command Line
whmapi1 delete_account_archives user=username mountpoint=%2Fhome%2Fexample


Notes:

  • Unless otherwise noted, 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/whmapi1

 Output (JSON)
{
	"metadata:": {
		"command": "delete_account_archives",
		"reason": "OK",
		"version": 1,
		"output": {
			"messages": [
				"Found archive: /home/example/example.tar.gz"
			]
		},
		"result": 1
	}
}
 Output (XML)
<result>
    <metadata>
        <command>delete_account_archives</command>
        <output>
          <messages>Found archive: /home/example/example.tar.gz</messages>
        </output>
        <reason>OK</reason>
        <result>1</result>
        <version>1</version>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
user
string

Required

The cPanel account username.

A valid cPanel account name.username
mountpointstring

The filepath to the archive storage location.

This parameter defaults to the /home directory.

A valid filepath./home/example/

Returns

This function only returns metadata.

Note:

This function's metadata contains an output hash that can contain either of the messages and warnings arrays. These arrays contain status messages and errors, respectively, for the function call.