Page tree
Skip to end of metadata
Go to start of metadata

Description

This function modifies a cPanel account.

  • The user parameter is required in order to identify the account to update. 
  • All other input parameters are optional, and indicate the new values to assign to the account. If you specify the existing value in one of these parameters, no change will occur. 

Warning:

We strongly recommend that you do not modify a single account's settings if the account has a hosting plan (package). If the hosting plan's settings change, the system will overwrite the account-specific values with the hosting plan's new settings. 

This function's parameters are case sensitive. You must enter any parameters in the correct case format, or the function will ignore that parameter.


Note:

On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.

  • This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use TXT records instead of SPF records.
  • Red Hat 7.1 and CentOS 7.1 both contain bind-9.9.4-23.el7, which is an updated version of BIND that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of BIND. For more information, read the Red Hat Bugzilla case about SPF record errors.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/modifyacct?api.version=1&user=tweedledee&QUOTA=unlimited&newuser=tweedledum
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/modifyacct?api.version=1&user=tweedledee&QUOTA=unlimited&newuser=tweedledum
 Command Line
whmapi1 modifyacct user=username quota=unlimited newuser=tweedledum


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)
{  
   "data":{  
      "domain":"example.com",
      "user":"tweedledum",
      "setshell":"unmodified",
      "cpuser":{  
         "DOMAINS":[  
            "addondomain.com",
            "seconddomain.com",
            "seconddomain.example.com",
            "subdomain.example.com",
         ],
         "HASSPF":"1",
         "MAXADDON":"unlimited",
         "MAXSUB":"unlimited",
         "MAX_DEFER_FAIL_PERCENTAGE":"unlimited",
         "DEMO":"0",
         "_PACKAGE_EXTENSIONS":"",
         "bogus_food":"y",
         "BACKUP":"0",
         "RS":"paper_lantern",
         "USER":"tweedledum",
         "MAX_EMAIL_PER_HOUR":"unlimited",
         "MAXMONGREL":"4",
         "LOCALE":"en",
         "HOMEDIRLINKS":[  

         ],
         "MAXLST":"unlimited",
         "MAXPARK":"unlimited",
         "bogus_appetite":"normal",
         "IP":"10.215.214.95",
         "MAXSQL":"unlimited",
         "MAXPOP":"unlimited",
         "OWNER":"root",
         "FEATURELIST":"default",
         "HASCGI":"1",
         "DEADDOMAINS":[  
            "example.example.com",
         ],
         "HASDKIM":"1",
         "MTIME":1416590437,
         "MAXFTP":"unlimited",
		 "MAXPASSENGERAPPS":"unlimited",	
         "LEGACY_BACKUP":"0",
         "CONTACTEMAIL2":"",
         "BWLIMIT":"unlimited",
         "STARTDATE":"1369256589",
         "CONTACTEMAIL":"tweedledum@example.com",
         "__CACHE_DATA_VERSION":"0.4",
         "bogus_name":"Quarks",
         "DOMAIN":"example.com",
         "PLAN":"extensions_username_username"
      }
   },
   "metadata":{  
      "version":1,
      "reason":"Account Modified",
      "output":{  
         "warnings":[  

         ],
         "messages":[  

         ]
      },
      "result":1,
      "command":"modifyacct"
   }
}
 Output (XML)
<result>
    <data>
        <domain>example.com</domain>
        <user>tweedledum</user>
        <setshell>unmodified</setshell>
        <cpuser>
            <MAXSUB>unlimited</MAXSUB>
            <MAXADDON>unlimited</MAXADDON>
            <HASSPF>1</HASSPF>
            <DOMAINS>addondomain.com</DOMAINS>
            <DOMAINS>seconddomain.com</DOMAINS>
            <DOMAINS>seconddomain.example.com</DOMAINS>
            <DOMAINS>subdomain.example.com</DOMAINS>
            <MAX_DEFER_FAIL_PERCENTAGE>unlimited</MAX_DEFER_FAIL_PERCENTAGE>
            <DEMO>0</DEMO>
            <_PACKAGE_EXTENSIONS/>
            <bogus_food>y</bogus_food>
            <BACKUP>0</BACKUP>
            <RS>paper_lantern</RS>
            <MAX_EMAIL_PER_HOUR>unlimited</MAX_EMAIL_PER_HOUR>
            <USER>tweedledum</USER>
            <MAXMONGREL>4</MAXMONGREL>
            <LOCALE>en</LOCALE>
            <MAXLST>unlimited</MAXLST>
			<MAXPASSENGERAPPS>unlimited</MAXPASSENGERAPPS>
            <MAXPARK>unlimited</MAXPARK>
            <bogus_appetite>normal</bogus_appetite>
            <IP>10.215.214.95</IP>
            <MAXPOP>unlimited</MAXPOP>
            <MAXSQL>unlimited</MAXSQL>
            <OWNER>root</OWNER>
            <FEATURELIST>default</FEATURELIST>
            <HASCGI>1</HASCGI>
            <DEADDOMAINS>example.example.com</DEADDOMAINS>
            <MTIME>1416590659</MTIME>
            <HASDKIM>1</HASDKIM>
            <MAXFTP>unlimited</MAXFTP>
            <LEGACY_BACKUP>0</LEGACY_BACKUP>
            <CONTACTEMAIL2/>
            <STARTDATE>1369256589</STARTDATE>
            <BWLIMIT>unlimited</BWLIMIT>
            <CONTACTEMAIL>username@example.com</CONTACTEMAIL>
            <bogus_name>Quarks</bogus_name>
            <__CACHE_DATA_VERSION>0.4</__CACHE_DATA_VERSION>
            <DOMAIN>example.com</DOMAIN>
            <PLAN>extensions_username_username</PLAN>
        </cpuser>
    </data>
    <metadata>
        <version>1</version>
        <reason>Account Modified</reason>
        <output/>
        <result>1</result>
        <command>modifyacct</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The account's current username.

An existing cPanel account's username.

tweedledee
BACKUPBooleanWhether backups are enabled for the account.
  • 1 — Enabled.
  • 0 — Disabled.
1
BWLIMITstring

The account's maximum bandwidth use.

  • A positive integer that represents the maximum bandwidth use, in bytes.
  • 0, unlimited, or null — The account possesses unlimited bandwidth.
unlimited
contactemailstringThe account's contact email address.A valid email address.tweedledee@example.com
DNSstring

The account's main domain.

A valid domain name.example.com
HASCGIBoolean

Whether CGI access is enabled for the account.

  • 1 — Enabled.
  • 0 — Disabled.
1
HASDKIMBooleanWhether DKIM is enabled for the account.
  • 1 — Enabled.
  • 0 — Disabled.
1
HASSHELLBoolean

Whether shell (SSH) access is enabled for the account.

Note:

We strongly recommend that you use the shell parameter to specify a shell for SSH access. 

  • 1 — Enabled.
  • 0 — Disabled.
1
HASSPFBooleanWhether SPF is enabled for the account.
  • 1 — Enabled.
  • 0 — Disabled.
1
LOCALEstring

The account's default locale.

A two-letter ISO-3166 code. en
MAXADDONstring

The account's maximum number of addon domains.

  • An integer between zero and 999,999.
  • 0 , unlimited , or null — The account possesses unlimited addon domains.
unlimited
MAXFTPstring

The account's maximum number of FTP accounts.

  • A positive integer between one and 999,999.
  • unlimited or null — The account possesses unlimited FTP accounts.
unlimited
MAXLSTstring

The account's maximum number of mailing lists.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited mailing lists.
unlimited
MAXPARKstring

The account's maximum number of parked domains (aliases).

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited parked domains.
unlimited
MAXPASSENGERAPPSstring

The account's maximum number of Ruby applications.

Note:

We added this parameter in cPanel & WHM version 66.

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited Ruby applications.
unlimited
MAXPOPstring

The account's maximum number of email accounts.

  • A positive integer between one and 999,999.
  • unlimited or null — The account possesses unlimited email accounts.
unlimited
MAXSQLstring

The account's maximum number of each available type of SQL database.

For example, if you set this value to 5 and the system administrator allows MySQL® and PostgreSQL® databases , users can create up to five MySQL databases and up to five PostgreSQL databases.

  • A positive integer between one and 999,999.
  • unlimited or null — The account possesses unlimited databases.
unlimited
MAXSUBstring

The account's maximum number of subdomains.

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited subdomains.
unlimited
MAX_EMAIL_PER_HOURinteger

The maximum number of emails that the account can send in one hour.

Note:

We introduced this parameter in cPanel & WHM version 11.32.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of emails.
unlimited
MAX_DEFER_FAIL_PERCENTAGEinteger

The percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.

Note:

We introduced this parameter in cPanel & WHM version 11.32.

  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of failed or deferred messages.
unlimited
newuserstring

The account's new username.

Note:

If you rename the account, and database prefixing is enabled, you may also use the rename_database_objects parameter. 

A valid cPanel username.


Notes:

  • Usernames cannot begin with a number, or the string test.
  • In cPanel & WHM version 11.38 and older, usernames must contain eight characters or fewer.
  • In cPanel & WHM version 11.40 and later, usernames may contain 16 characters or fewer if database prefixes are disabled.
  • In cPanel & WHM version 11.44 and later, the first eight characters of usernames must be unique. MySQL requires this due to potential conflicts with account transfers.
  • In cPanel & WHM version 11.56 and later, MySQL's unique character limit requirement does not exist on servers that use MariaDB.

tweedledum
ownerstring

A new owner username, to change the account's owner.

Notes:

The authenticated user must have root privileges in order to assign the account to a reseller other than that account. 

  • A valid reseller username.
  • root
reseller_name
QUOTAinteger

The account's disk space quota.

  • An integer in multiples of 1,048,576 bytes.
  • 0 , unlimited , or null — The account's disk space is unlimited.
unlimited
remove_missing_extensionsstring

A list of removed, missing, or uninstalled extensions.

Warning:

This parameter removes all of the extensions that you list from the _PACKAGE_EXTENSIONS variable in the user file. It will not remove the extensions' variables.

For more information, read our Guide to Package Extensions

Note:

We introduced this parameter in cPanel & WHM version 11.40.

A space-separated list of one or more package extension names.packageext1 packageext2
rename_database_objectsBoolean

Whether to rename the account's database objects to use a new username's database prefix.

This parameter defaults to 0.

Warning:

  • The account owner must update any applications to use the new database object names.
  • Use this parameter carefully, as it may cause confusion for system administrators. 
  • For a full description of how cPanel & WHM renames databases, read the rename_database_objects parameter section below.

Notes:

  • This parameter only applies to servers that use database prefixing.
  • We introduced this parameter in cPanel & WHM version 11.44.
  • 1 — Rename the account's database objects.
  • 0 — Do not rename the account's database objects.
0
shellstring
The absolute filepath to the shell's location.

Note:

We introduced this parameter in cPanel & WHM version 60. 

A valid absolute filepath./bin/bash
spamassassinBoolean

Whether Apache SpamAssassin™ is enabled for the account.

This parameter defaults to 1.

Note:

We added this parameter in cPanel & WHM version 70.


  • 1 — Enabled.
  • 0 — Disabled.
0
frontpageBoolean

Whether Microsoft® FrontPage Extensions are enabled for the account.

Note:

cPanel & WHM will ignore all FrontPage settings and parameters if either of the following statements is true:

  • The server runs cPanel & WHM version 11.44 and FrontPage Extensions are not installed.
  • The server runs cPanel & WHM version 11.46 or later.
  • 1 — Enabled.
  • 0 — Disabled.
0
RSstring

The account's cPanel theme.

  • paper_lantern
  • A valid theme on the server.
paper_lantern

The rename_database_objects parameter

MySQL does not natively rename databases. When cPanel & WHM "renames" a database, the system performs the following steps:
  1. The system creates a new database.
  2. The system moves data from the old database to the new database.
  3. The system recreates grants and stored code in the new database.
  4. The system deletes the old database and its grants. 

Warning:

  • If any of the first three steps fail, the system returns an error and attempts to restore the database's original state. If the restoration process fails, the function's error message will include the additional failures.
  • In rare cases, the system creates the new database successfully, but fails to complete step 4. The system treats this as a success, but the function will return warning messages that describe the failure.

Returns

ReturnTypeDescriptionPossible valuesExample

domain

string

The account's main domain.

A valid domain name on the account.example.com

user

string

The account username.

The cPanel account's username.

Note:

If you changed the account's username, the function returns the new value. 

tweedledum

setshell

string

The account's shell.

The absolute path to a shell location on the server./bin/bash

cpuser

hashA hash of account information.

This function contains one or more of the MAXSUB, MAXADDON, HASSPF, DOMAINS, MAX_DEFER_FAIL_PERCENTAGE, DEMO, _PACKAGE_EXTENSIONS, BACKUP, RS, MAX_EMAIL_PER_HOUR, USER, MAXMONGREL, LOCALE, HOMEDIRLINKS, MAXLST, MAXPARK, MAXSQL, OWNER, FEATURELIST, HASCGI, DEADDOMAINS, MTIME, HASDKIM, MAXFTP, MAXPASSENGERAPPS LEGACY_BACKUP, CONTACTEMAIL2, STARTDATE, BWLIMIT, CONTACTEMAIL, __CACHE_DATA_VERSION, DOMAIN, and PLAN returns.

Note:

If the account or its hosting plan use package extensions, the cpuser hash will also include the extension's variables. 

 

MAXSUB

string

The account's maximum number of subdomains.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of subdomains.
unlimited  

MAXADDON

string

The account's maximum number of addon domains.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of addon domains.
unlimited

 HASSPF

Boolean

Whether SPF is enabled for the account.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

DOMAINS

array

A list of the account's domains and subdomains.

The function returns this value in the cpuser hash.

An array of one or more valid domains or subdomains.example.com

MAX_DEFER_FAIL_PERCENTAGE

string

The percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a percentage of messages.
unlimited

 DEMO

Boolean

Whether demo mode is enabled for the account.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
0

_PACKAGE_EXTENSIONS

string

The account's package extensions.

The function returns this value in the cpuser hash.

A space-separated list of one or more package extension names.ext1 ext2 ext3

BACKUP

Boolean

Whether backups are enabled.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
0

RS

string

The account's cPanel interface theme.

The function returns this value in the cpuser hash.

  • paper_lantern
  • A valid theme on the server.
paper_lantern

MAX_EMAIL_PER_HOUR

string

The maximum number of emails that the account can send in one hour.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of sent emails.
unlimited

USER

string

The account username.

The function returns this value in the cpuser hash.

The cPanel account's username.

Note:

If you changed the account's username, the function returns the new value. 

tweedledum

 MAXMONGREL

integer

The maximum number of Mongrel instances.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of Mongrel instances.
4

LOCALE

string

The account's locale.

The function returns this value in the cpuser hash.

The ISO code for any locale on the server.en

HOMEDIRLINKS

array

Any symlinks to the account's home directory.

The function returns this value in the cpuser hash.

An array of one or more home directory symlinks.symlink

MAXLST

string

The account's maximum number of mailing lists.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of mailing lists.
unlimited

MAXPARK

string

The account's maximum number of parked domains.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of parked domains.
unlimited  

MAXPASSENGERAPPS

string

The account's maximum number of Ruby applications.

The function returns this value in the cpuser hash.

Note:

We added this return in cPanel & WHM version 66.

  • unlimited
  • An integer that represents a number of Ruby applications.
unlimited

MAXSQL

string

The account's maximum number of SQL databases.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of SQL databases.
unlimited  

OWNER

string

The account's owner.

The function returns this value in the cpuser hash.

  • root
  • A reseller account's username.
  • The cPanel account username.
root

 FEATURELIST

string

The account's featurelist.

The function returns this value in the cpuser hash.

A valid feature list name.default

HASCGI

Boolean

Whether CGI is enabled for the account.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

DEADDOMAINS

array

The account's inactive domains.

The function returns this value in the cpuser hash.

An array of one or more domains or subdomains.example.example.com

MTIME

integer

The time of the function call.

The function returns this value in the cpuser hash.

A time, in Unix time format.1416586493

HASDKIM

Boolean

Whether DKIM is enabled for the account.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

MAXFTP

string

The account's maximum number of FTP accounts.

The function returns this value in the cpuser hash.

  • unlimited
  • An integer that represents a number of FTP accounts.
unlimited

LEGACY_BACKUP

Boolean

Whether legacy backups are enabled.

The function returns this value in the cpuser hash.

  • 1 — Enabled.
  • 0 — Disabled.
0

CONTACTEMAIL2

string

The account's secondary contact email address, if one exists.

The function returns this value in the cpuser hash.

A valid email address.email2@example.com

STARTDATE

string

The account creation date.

The function returns this value in the cpuser hash.

The date in YY Mon DD HH:mm human-readable format, where:

  • YY represents the year.
  • Mon represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
13 May 22 16:03

 BWLIMIT

string

The account's bandwidth limit.

The function returns this value in the cpuser hash.

  • unlimited
  • A maximum amount of bandwidth, in Megabytes (MB).
unlimited

CONTACTEMAIL

string

The account's contact email address.

The function returns this value in the cpuser hash.

A valid email address.tweedledum@example.com

__CACHE_DATA_VERSION

string

The account's cache data's version.

The function returns this value in the cpuser hash.

A numeric value that indicates a version of the cache data.0.4

DOMAIN

string

The account's main domain.

The function returns this value in the cpuser hash.

A valid domain on the cPanel account.example.com

PLAN

string

The account's hosting package.

The function returns this value in the cpuser hash.

The name of a package on the server.packagename