We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - Variables::get_user_information
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the user's account configuration settings.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Variables/get_user_information?name-1=domain&name-2=cgi_enabled&name-3=dkim_enabled



Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
//Retrieve user settings for example.com.
$variables = $cpanel->uapi(
    'Variables', 'get_user_information',
    array(
        'name-1' => 'domain',
		'name-2' => 'cgi_enabled',
		'name-3' => 'dkim_enabled',
        )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve user settings for example.com.
my $variables = $cpliveapi->uapi(
    'Variables', 'get_user_information',
    {
        'name-1' => 'domain',
		'name-2' => 'cgi_enabled',
		'name-3' => 'dkim_enabled',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username Variables get_user_information name-1=domain name-2=cgi_enabled name-3=dkim_enabled


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"messages": null,
	"errors": null,
	"status": 1,
	"metadata": {},
	"data": {
		"cgi_enabled": "1",
		"dkim_enabled": "1",
		"domain": "example.com"
	}
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
name string

The user configuration variables to retrieve.

Note:

Pass this parameter multiple times to retrieve multiple variables. For example, name-1=variable, name-2=variable, name-3=variable 

If you don't use this parameter, this function returns all of the user's configuration data. 

 Click to view...
  • backup_enabled
  • bandwidth_limit
  • cgi_enabled
  • contact_email
  • contact_email_2
  • cpanel_root_directory
  • created
  • database_owner 
  • dead_domains
  • demo_mode
  • disk_block_limit
  • dkim_enabled
  • domain
  • domains
  • feature
  • feature_list 
  • gid
  • home
  • home_directory_links
  • ip
  • lang
  • last_modified
  • legacy_backup_enabled
  • locale
  • mailbox_format
  • maximum_addon_domains
  • maximum_databases
  • maximum_defer_fail_percentage
  • maximum_email_account_disk_quota
  • maximum_emails_per_hour
  • maximum_ftp_accounts
  • maximum_mail_accounts
  • maximum_mailing_lists
  • maximum_parked_domains
  • maximum_subdomains
  • maximum_passenger_apps
  • mxcheck
  • notify_account_authn_link

  • notify_account_authn_link_notification_disabled

  • notify_account_login 
  • notify_account_login_for_known_netblock
  • notify_account_login_notification_disabled
  • notify_autossl_expiry
  • notify_autossl_expiry_coverage
  • notify_autossl_renewal_coverage
  • notify_autossl_renewal_coverage_reduced
  • notify_autossl_renewal_uncovered_domains
  • notify_bandwidth_limit
  • notify_contact_address_change
  • notify_contact_address_change_notification_disabled
  • notify_disk_limit
  • notify_password_change
  • notify_password_change_notification_disabled
  • notify_ssl_expiry
  • notify_twofactorauth_change
  • notify_twofactorauth_change_notification_disabled
  • owner
  • package_extensions
  • plan
  • pushbullet_access_token
  • shell
  • spf_enabled
  • theme
  • user
  • utf8_mailbox
  • uid
  • user
domain 

Returns

ReturnTypeDescriptionPossible valuesExample

backup_enabled

 
BooleanWhether the user has backups enabled.
  • 1 — Backups enabled.
  • 0   — Backups not enabled.
1 
bandwidth_limitstring

The account's bandwidth limit.

  • 0 — unlimited
  • A maximum amount of bandwidth, in bytes.
0 
cgi_enabledBooleanWhether CGI is enabled.
  • 1  — Enabled.
  • 0  Not enabled.
1 
contact_emailstring

The account's contact email address.

A valid email address.user@example.com 
contact_email_2stringThe account's alternate contact email address, if one exists.A valid email address.user2@example.com 
cpanel_root_directory string

The root directory.

A valid directory path./usr/local/cpanel 
created integerThe account's creation date.

A date in  Unix time  format.

1432220941

database_owner string

The owner of the account's databases.

Note:

We added this return in cPanel & WHM version 88.

  • root
  • A reseller account's username.
  • The account's username.
root 
dead_domainsarray of stringsThe account's inactive domains.An array of one or more domains or subdomains.example.example.com
demo_modeBooleanWhether demo mode is enabled.
  • 1  — Enabled.
  • 0  Not enabled.
1 
disk_block_limitintegerThe number of disk blocks for the account.
  • 0 — unlimited
  • A maximum amount of disk blocks, in kilobytes.
100000000
dkim_enabled BooleanWhether Domain Keys Identified Mail (DKIM) is enabled.
  • 1  — Enabled.
  • 0  Not enabled.
1 
domainstring

The account's main domain.

A valid domain name.example.com
domainsarray of stringsA list of the account's domains and subdomains.An array of one or more valid domains or subdomains.example.com
featurehash

A hash of available features on the account that exist in the /var/cpanel/users/user file, where user represents the cPanel user.

Note:

  • This hash returns any custom features that the hosting provider adds to the /var/cpanel/users/user file.
  • We added this return in cPanel & WHM version 88.

This hash includes the feature return.


feature

 
Boolean

Whether the feature is enabled.

Note:

The feature's name is the return name.

The function returns this value in the features hash.

  • 1 — Enabled.
  • 0 — Disabled.
1 
feature_list stringThe account's feature list name.A valid feature list name.feature_list 
gid integerThe account's group ID.An integer value.5678 
home stringThe user's home directory.A valid file path./home/user 
home_directory_linksarray of stringsAny symlinks to the cPanel account's home directory.An array of one or more home directory symlinks.symlink
ipstring

The account's IPv4 address.

A valid IPv4 address.192.0.2.0
langstring

The account's language.

Note:

We added this return in cPanel & WHM version 88.

A valid string.english 
last_modified integer

The most recent modification time of the /var/cpanel/users/user file.

Note:

user represents the cPanel user.

A time, in Unix time format. 1416586493
legacy_backup_enabledBoolean

Whether legacy backups are enabled.

  • 1  — Enabled.
  • 0  — Disabled.
1 
localestring

The account's default locale.

A two-letter ISO-3166 code.en 
mailbox_formatstring

The storage format that the account's mailboxes use.

  • maildir
  • mbox
maildir 
maximum_addon_domains stringThe account's maximum number of addon domains.
  • unlimited
  • An integer that represents a number of addon domains.
unlimited
maximum_databases stringThe account's maximum number of SQL databases.
  • unlimited
  • An integer that represents a number of SQL databases.
unlimited 
maximum_defer_fail_percentagestringThe percentage of failed or deferred email messages that the account can send per hour before outgoing mail is rate-limited.
  • unlimited
  • An integer value.
unlimited 
maximum_email_account_disk_quota 
The maximum size, that the account can define when it creates an email account.
  • unlimited

  • An integer value, in Megabytes (MB).
unlimited 
maximum_emails_per_hourstring

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

  • A positive integer.
  • 0  or  unlimited — The account can send an unlimited number of emails.
unlimited 
maximum_ftp_accountsstringThe account's maximum number of FTP accounts.
  • unlimited
  • An integer that represents a number of FTP accounts.
unlimited 
maximum_mail_accounts stringThe maximum number of email accounts for the account.
  • unlimited
  • An integer that represents a number of email accounts.
0 
maximum_mailing_listsstring

The account's maximum number of mailing lists.

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

The account's maximum number of aliases.

  • unlimited
  • An integer that represents a number of aliases.
unlimited 
maximum_passenger_apps string

The account's maximum number of Ruby applications.

Note:

We added this return in cPanel & WHM version 88.

  • unlimited
  • An integer that represents a number of applications.
unlimited 
maximum_subdomainsstringThe account's maximum number of subdomains.
  • unlimited
  • An integer that represents a number of subdomains.
unlimited 
mxcheckhash

A hash of domains and their mail exchanger (MX) type.

Note:

We added this return in cPanel & WHM version 88.

This hash includes the domain return, where domain is the domain's name.

domain

 
string

The domain's MX type.

Note:

The return's name is the domain name.

The function returns this value in the mxcheck hash.

  • local  Accept mail locally for the domain.
  • secondary  — Accept mail until a higher priority mail server is available.
  • remote  — Do not accept mail locally for the domain.
local 
notify_account_authn_link Boolean

Whether the systems sends a notification when someone links the account to an external authentication account.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_account_authn_link_notification_disabled Boolean

Whether the systems sends a notification when someone disables notifications for external authentication account links.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_account_login Boolean

Whether the system sends a notification when someone logs in to the account.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_account_login_for_known_netblock Boolean

Whether the system sends a notification when a user on a known netblock logs in to the account.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_account_login_notification_disabled Boolean

Whether the system sends a notification when someone disables notifications for account logins

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_autossl_expiry Boolean

Whether the system sends a notification when an AutoSSL certificate expires.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_autossl_expiry_coverageBoolean

Whether the system sends a notification when AutoSSL cannot renew a certificate because domains that fail Domain Control Validation (DCV) exist on the current certificate.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_autossl_renewal_coverageBoolean

Whether the system sends a notification when AutoSSL renews a certificate.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_autossl_renewal_coverage_reducedBoolean

Whether the system sends a notification when AutoSSL renews a certificate, but the new certificate lacks at least one domain that the previous certificate secured. 

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_autossl_renewal_uncovered_domainsBoolean

Whether the system sends a notification when AutoSSL renews a certificate, but the new certificate lacks at least one domain that the previous certificate secured.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1 
notify_bandwidth_limit Boolean

Whether the systems sends a notification when the account reaches its bandwidth quota.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_contact_address_change Boolean

Whether the systems sends a notification when someone changes the contact address for the account.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_contact_address_change_notification_disabled Boolean

Whether the systems sends a notification when disables the notification for contact address changes.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_disk_limit Boolean

Whether the systems sends a notification when the account reaches its disk usage limit.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_password_change Boolean

Whether the systems sends a notification when someone changes the account's password.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_password_change_notification_disabled Boolean

Whether the systems sends a notification when someone disables notifications for password changes.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_ssl_expiry Boolean

Whether the systems sends a notification when an SSL certificate on the account expires.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_twofactorauth_change Boolean

Whether the systems sends a notification when the account's Two-Factor Authentication (2FA) credentials change.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
notify_twofactorauth_change_notification_disabled Boolean

Whether the systems sends a notification when someone disables notifications for 2FA.

Note:

We added this return in cPanel & WHM version 88.

  • 1  — Notifies.
  • 0  — Doesn't notify.
1
ownerstring

The account's owner.

  • root
  • A reseller account's username.
  • The account's username.
root 
package_extensions array of stringsThe account's package extensions.An array of one or more package extension names.ext1, ext2, ext3
planstring

The account's hosting package.

The name of a package on the server. packagename
pushbullet_access_tokenstringThe account's Pushbullet access token.A valid Pushbullet token ID.1234567890
shell stringThe account's shell.A shell location on the server./bin/bash
spf_enabled BooleanWhether Sender Policy Framework (SPF) is enabled.
  • 1  — Enabled.
  • 0  Not enabled.
1 
theme stringThe account's current theme.

paper_lantern is the only possible value.

paper_lantern
uid integerThe account's user ID on the system.An integer value.1234 
userstring

The account's current username.

An existing account's username.username 
utf8_mailboxBooleanWhether UTF-8-encoded mailbox names are enabled for the cPanel account.
  • 1  — Enabled.
  • 0  — Not enabled.
1