cPanel API 2 Functions - CustInfo::savecontactinfo
The cPanel API 2 system is deprecated. We strongly recommend that you use UAPI instead of cPanel API 2.
Description
This function modifies an account's contact and notification settings.
We strongly recommend that you use the following UAPI function instead of this function:
-
ContactInformation::set_email_addresses
— Use this function to set an account's contact email address(es).
Examples
WHM API (JSON)
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=CustInfo&cpanel_jsonapi_func=savecontactinfo&email=bert%40example.com&second_email=ernie%40example.com¬ify_account_authn_link=1¬ify_account_authn_link_notification_disabled=1¬ify_account_login=1¬ify_account_login_for_known_netblock=1¬ify_account_login_notification_disabled=1¬ify_autossl_renewal_coverage_reduced=1¬ify_bandwidth_limit=1¬ify_contact_address_change=1¬ify_contact_address_change_notification_disabled=1¬ify_disk_limit=1¬ify_email_quota_limit=1¬ify_password_change=1¬ify_password_change_notification_disabled=1¬ify_twofactorauth_change=1¬ify_twofactorauth_change_notification_disabled=1&pushbullet_access_token=a1b2c3d4e5f6g7h8i9j0&username=example1@example.com¬ify_autossl_expiry=1¬ify_autossl_expiry_coverage=1¬ify_autossl_renewal=1¬ify_autossl_renewal_coverage=1¬ify_ssl_expiry=1
For more information, read our Calls from the WHM API documentation.
LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Modify contact information.
$save_contact = $cpanel->api2(
'CustInfo', 'savecontactinfo',
array(
email => 'bert@example.com',
notify_account_authn_link => '0'
notify_account_authn_link_notification_disabled => '0',
notify_account_login => '0',
notify_account_login_for_known_netblock => '0',
notify_autossl_expiry => 1,
notify_autossl_expiry_coverage => 1,
notify_autossl_renewal_coverage_reduced => 1,
notify_autossl_renewal => 1,
notify_autossl_renewal_coverage => 1,
notify_account_login_notification_disabled => '0',
notify_bandwidth_limit => '0',
notify_contact_address_change => '0',
notify_contact_address_change_notification_disabled => '0',
notify_disk_limit => '0',
notify_email_quota_limit => '0',
notify_password_change => '0',
notify_password_change_notification_disabled => '0',
notify_ssl_expiry => '1',
notify_twofactorauth_change => '0',
notify_twofactorauth_change_notification_disabled => '0',
pushbullet_access_token => 'a1b2c3d4e5f6g7h8i9j10',
second_email => 'ernie@example.com',
username => 'example1@example.com'
)
);
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.
# Modify contact information.
my $save_contact = $cpliveapi->api2(
'CustInfo', 'savecontactinfo',
{
email => 'bert@example.com',
notify_account_authn_link => '0'
notify_account_authn_link_notification_disabled => '0',
notify_account_login => '0',
notify_account_login_for_known_netblock => '0',
notify_account_login_notification_disabled => '0',
notify_autossl_expiry => 1,
notify_autossl_expiry_coverage => 1,
notify_autossl_renewal_coverage_reduced => 1,
notify_autossl_renewal => 1,
notify_autossl_renewal_coverage => 1,
notify_bandwidth_limit => '0',
notify_contact_address_change => '0',
notify_contact_address_change_notification_disabled => '0',
notify_disk_limit => '0',
notify_email_quota_limit => '0',
notify_password_change => '0',
notify_password_change_notification_disabled => '0',
notify_ssl_expiry => '1',
notify_twofactorauth_change => '0',
notify_twofactorauth_change_notification_disabled => '0',
pushbullet_access_token => 'a1b2c3d4e5f6g7h8i9j10',
second_email => 'ernie@example.com',
username => 'example1@example.com'
}
);
For more information, read our Guide to the LiveAPI System.
- cPanel tags are deprecated . We strongly recommend that you only use the LiveAPI system to call the cPanel APIs. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI .
- cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
- For more information, read our Deprecated cPanel Tag Usage documentation.
Command Line
cpapi2 --user=username CustInfo savecontactinfo email=bert@example.com second_email=ernie@example.com notify_account_authn_link=1 notify_account_authn_link_notification_disabled=1 notify_account_login=1 notify_account_login_for_known_netblock=1 notify_account_login_notification_disabled=1 notify_autossl_renewal_coverage_reduced=1 notify_bandwidth_limit=1 notify_contact_address_change=1 notify_contact_address_change_notification_disabled=1 notify_disk_limit=1 notify_email_quota_limit=1 notify_password_change=1 notify_password_change_notification_disabled=1 notify_twofactorauth_change=1 notify_twofactorauth_change_notification_disabled=1 pushbullet_access_token=a1b2c3d4e5f6g7h8i9j0 username=example1@example.com notify_autossl_expiry=1 notify_autossl_expiry_coverage=1 notify_autossl_renewal=1 notify_autossl_renewal_coverage=1 notify_ssl_expiry=1
- You must URI-encode values.
-
username
represents your account-level username. -
You
must
include the
--user=username
option. -
For more information and additional output options, read our
Guide to cPanel API 2
documentation or run the
cpapi2 --help
command. -
If you run CloudLinux™, you
must
use the full path of the
cpapi2
command:/usr/local/cpanel/bin/cpapi2
Output (JSON)
{
"cpanelresult": {
"apiversion": 2,
"func": "savecontactinfo",
"event": {
"result": 1
},
"module": "CustInfo",
"data": [{
"display_value": "bert@example.com",
"value": "bert@example.com",
"name": "email",
"descp": "Enter an email address to receive account notifications and password reset confirmations. Do not use an email address that your cPanel account owns."
}, {
"descp": "Enter a second email address to receive account notifications and password reset confirmations.",
"value": "ernie@example.com",
"name": "second_email",
"display_value": "ernie@example.com"
}, {
"descp": "An access token for Pushbullet.",
"value": "a1b2c3d4e5f6g7h8i9j0",
"name": "pushbullet_access_token",
"display_value": "a1b2c3d4e5f6g7h8i9j0"
}, {
"display_value": "on",
"name": "notify_contact_address_change",
"value": 1,
"descp": "My contact email address changes."
}, {
"name": "notify_contact_address_change_notification_disabled",
"value": 1,
"descp": "My preference for contact email address change notifications is disabled.",
"display_value": "on"
}, {
"display_value": "on",
"descp": "My account approaches its disk quota.",
"value": 1,
"name": "notify_disk_limit"
}, {
"display_value": "on",
"name": "notify_bandwidth_limit",
"value": 1,
"descp": "My account approaches its bandwidth usage limit."
}, {
"display_value": "on",
"descp": "Any of my account's email accounts approaches or is over quota.",
"value": 1,
"name": "notify_email_quota_limit"
}, {
"value": 1,
"name": "notify_password_change",
"descp": "My account's password changes.",
"display_value": "on"
}, {
"display_value": "on",
"descp": "My preference for account password change notifications is disabled.",
"value": 1,
"name": "notify_password_change_notification_disabled"
}, {
"display_value": "on",
"value": 1,
"descp": "Someone logs in to my account.",
"name": "notify_account_login"
}, {
"descp": "Send login notifications, even when the user logs in from an IP address range or netblock that contains an IP address from which a user successfully logged in previously.",
"value": 1,
"name": "notify_account_login_for_known_netblock",
"display_value": "on"
}, {
"value": 1,
"descp": "My preference for successful login notifications is disabled.",
"name": "notify_account_login_notification_disabled",
"display_value": "on"
}, {
"name": "notify_account_authn_link",
"value": 1,
"descp": "An external account links to my account for authentication.",
"display_value": "on"
}, {
"value": 1,
"descp": "My preference for external account link notifications is disabled.",
"name": "notify_account_authn_link_notification_disabled",
"display_value": "on"
}, {
"descp": "AutoSSL has renewed a certificate.",
"display_value": "off",
"name": "notify_autossl_renewal",
"value": 1
}, {
"descp": "AutoSSL cannot add any additional domains because domains that fail Domain Control Validation exist on the current certificate.",
"display_value": "off",
"name": "notify_autossl_renewal_coverage",
"value": 1
}, {
"descp": "AutoSSL cannot renew a certificate because domains that fail Domain Control Validation exist on the current certificate.",
"display_value": "off",
"name": "notify_autossl_expiry_coverage",
"value": 1
}, {
"descp": "AutoSSL certificate expiry.",
"display_value": "off",
"name": "notify_autossl_expiry",
"value": 1
}, {
"descp": "SSL certificate expiry.",
"display_value": "off",
"name": "notify_ssl_expiry",
"value": 1
}, {
"descp": "AutoSSL has renewed a certificate, but the new certificate lacks at least one domain that the previous certificate secured.",
"display_value": "off",
"name": "notify_autossl_renewal_coverage_reduced",
"value": 1
}]
}
}
Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
email |
string | The primary contact email address. This parameter defaults to an empty string. |
A valid email address. | bert@example.com |
second_email |
string | A secondary contact email address. This parameter defaults to an empty string. |
A valid email address. | ernie@example.com |
notify_account_authn_link |
Boolean | Whether to send a notification when the user enables [External Authentication](/guides/guide-to-external-authentication/guide-to-external-authentication-openid-connect/). This parameter defaults to |
|
1 |
|
Boolean | Whether to send a notification when the This parameter defaults to |
|
1 |
notify_account_login |
Boolean | Whether to send a notification when the user logs in to their account. This parameter defaults to |
|
1 |
notify_account_login_for_known_netblock |
Boolean | Whether to send a notification when the user logs in to their account, regardless of the user's previously known IP address history. This parameter defaults to |
|
1 |
notify_account_login_notification_disabled |
Boolean | Whether to send a notification when the This parameter defaults to |
|
1 |
notify_autossl_expiry |
Boolean |
Whether to send a notification upon AutoSSL certificate expiry. We added this parameter in cPanel & WHM version 68.This parameter defaults to |
|
1 |
notify_autossl_expiry_coverage |
Boolean |
Whether to send a notification when AutoSSL cannot renew a certificate because domains that fail Domain Control Validation (DCV) exist on the current certificate. We added this parameter in cPanel & WHM version 68. This parameter defaults to |
|
1 |
notify_autossl_renewal_coverage_reduced |
Boolean | Whether to send a notification when AutoSSL renews a certificate, but the new certificate lacks at least one domain that the previous certificate secured. This parameter defaults to |
|
1 |
notify_autossl_renewal |
Boolean |
Whether to send a notification when AutoSSL renews a certificate. We added this parameter in cPanel & WHM version 68. This parameter defaults to |
|
1 |
notify_autossl_renewal_coverage |
Boolean |
Whether to send a notification when AutoSSL cannot add any additional domains because domains that fail DCV exist on the current certificate. We added this parameter in cPanel & WHM version 68. This parameter defaults to |
|
1 |
notify_bandwidth_limit |
Boolean |
Whether to send a notification when the user approaches their bandwidth limit.
This parameter defaults to |
|
1 |
notify_contact_address_change |
Boolean |
Whether to send a notification when the contact address changes.
This parameter defaults to |
|
1 |
notify_contact_address_change_notification_disabled |
Boolean |
Whether to send a notification when the
This parameter defaults to |
|
1 |
notify_disk_limit |
Boolean |
Whether to send a notification when the user approaches their disk quota. The function ignores this parameter when you authenticate as a Subaccount or use the This parameter defaults to |
|
1 |
notify_email_quota_limit |
Boolean |
Whether to send a notification when an email user approaches or exceeds their quota. The function ignores this parameter when you authenticate as a Subaccount or use the This parameter defaults to |
|
0 |
notify_password_change |
Boolean |
Whether to send a notification when the user changes their password. The function ignores this parameter when you authenticate as a Subaccount or use the 1 .
|
|
0 |
notify_password_change_notification_disabled |
Boolean |
Whether to send a notification when the
1 .
|
|
0 |
notify_ssl_expiry |
Boolean |
Whether to send a notification about SSL certificate expiry. We added this parameter in cPanel & WHM version 68. This parameter defaults to |
|
1 |
notify_twofactorauth_change |
Boolean | Whether to send a notification when the user's Two-Factor Authentication for WHM configuration changes. This parameter defaults to |
|
1 |
notify_twofactorauth_change_notification_disabled |
Boolean | Whether to send a notification when the This parameter defaults to |
|
1 |
pushbullet_access_token |
string |
An access token for Pushbullet notifications.
|
A valid string. | a1b2c3d4e5f6g7h8i9j0 |
username |
string | The cPanel account or Subaccount in which to save the contact information. We introduced this parameter in cPanel & WHM version 11.56. |
|
example1@example.com |
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
display_value |
string | The notification setting's display value. | A valid string. | user@example.com |
desc |
string | A notification setting's description. | A valid string. |
This is an email address at which the system can contact you. This should be an email address that is not on your account.
|
name |
string | The notification setting's name. |
|
email |
value |
string | The notification setting's value. | A valid string or Boolean value. | user@example.com |
reason |
string |
A reason for failure. This function only returns a |
A string that describes the error. |
This is an error message. |
result |
Boolean | Whether the function succeeded. |
|
1 |