Create email address

This function creates an email address.

Important:

  • When you disable the Receive Mail role, the system disables this function.
  • We recommend that you use the UAPI UserManager::create_user function to create an email address instead of this function. This function is incompatible with the Reset Password feature.
SecurityBasicAuth
Request
query Parameters
required
string or string

The email account username or address.

  • A valid email account username. For example, user to create user@example.com.
  • A valid email address.

Note:

You cannot enter cpanel as an account name when you create an email account.

Example: email=user
password
required
string

The email account password.

Example: password=123456luggage
domain
string <domain>
Default: "The cPanel account's main domain."

The email account's domain. For example, example.com to create user@example.com.

Example: domain=example.com
password_hash
string

The account's password hash.

Notes:

  • You can use this parameter instead of the password parameter. However, you cannot use both password and password_hash parameters in the same request.
  • You can find your server's hash type in the /etc/sysconfig/authconfig file.
Example: password_hash=$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/
string or integer
Default: "The defined system value."

The maximum amount of disk space that the new email account may use.

  • A positive integer that represents the maximum amount of disk space, in megabytes (MB).
  • 0 or unlimited — The account possesses unlimited disk space.

Note:

  • The positive integer value cannot exceed the maximum email quota.
  • The 0 or unlimited value is only available to users without a maximum email account quota.
Example: quota=500
send_welcome_email
integer
Default: 0

Whether to send client configuration instructions to the account.

  • 1 — Send the instructions.
  • 0 — Do not send the instructions.
Enum: 0 1
Example: send_welcome_email=0
skip_update_db
integer
Default: 0

Whether to skip the update of the email accounts database's cache.

  • 1 — Skip the update.
  • 0 — Perform the update.
Enum: 0 1
Example: skip_update_db=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Email/add_pop
Request samples
uapi --output=jsonpretty \
  --user=username \
  Email \
  add_pop \
  email='user' \
  password='123456luggage'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "add_pop",
  • "module": "Email",
  • "result": {
    • "data": "user+example.com",
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}