Create Subaccount
This function creates a Subaccount.
Query parameters
The Subaccount user's associated domain that the cPanel account owns.
The Subaccount's password.
Note:
Email, FTP, and Web Disk services use this password.
The username for the Subaccount. The username can only contain alphanumeric characters, dots (.), hyphens (-), and underscores (_).
Note:
This value does not include the domain name.
An alternate email address for the Subaccount's user.
Note:
You must use this parameter if you set the send_invite value to 1.
The URL path to the user's Subaccount profile photo.
Note:
You must use the HTTPS protocol to prevent mixed content warnings when users view the image from another HTTPS URL.
Warning:
We reserved this parameter for future use. Do not use this parameter.
The Subaccount user's first and/or last name.
Whether to send a reset password email to the Subaccount's alternate email address.
- 1 - Send.
- 0 - Do not send.
Whether to grant the Subaccount email access.
- 1 - Can access.
- 0 - Cannot access.
The maximum amount of disk space, in megabytes (MB), allocated to Subaccount's email account.
- 0 or unlimited - The subaccount has unlimited disk space.
This value defaults to the defined system value.
Note:
This value cannot be larger than the system's maximum email quota.
Whether to send client configuration instructions to the account.
- 1 - Send the instructions.
- 0 - Do not send the instructions.
Whether to grant the Subaccount FTP access.
- 1 - Can access.
- 0 - Cannot access.
The Subaccount's FTP home directory, relative to the cPanel account's home directory.
Note:
- This parameter is required if you enabled the services.ftp.homedir parameter.
- The directory must exist.
Whether to grant the Subaccount Web Disk access.
- 1 _ Can access.
- 0 - Cannot access.
Whether to enable the Web Disk Digest Authentication.
- 1 - Enabled.
- 0 - Disabled.
Note:
- Only enable Digest Authentication for clients that require additional compatibility support on certain versions of Windows® operating systems. This compatibility support is only required on servers that use a self-signed certificate for the cpsrvd and cpdavd daemons.
- We recommend that you do not use Digest Authentication.
The Subaccount's Web Disk home directory, relative to the cPanel account's home directory.
Note:
This parameter is required if you enable the services.webdisk.enabled parameter.
The Subaccount's file permissions for its Web Disk home directory.
- ro - Read-only permissions.
- rw - Read and write permissions.
Note:
The services.webdisk.homedir parameter determines the Subaccount's Web Disk home directory.
Whether to set the directory's permissions to public or private.
- 1 - Private (0700).
- 0 - Public (0755).
The type of account.
- sub - A Subaccount.
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "create_user",
"module": "UserManager",
"result": {
"data": {
"alternate_email": "user@example.com",
"avatar_url": "https://img.example.com/avatars/example.jpg",
"can_set_password": 1,
"dismissed": 1,
"domain": "example.com",
"full_username": "user@example.com",
"guid": "N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4",
"issues": [
{
"area": "quota",
"limit": 1500,
"message": "Your account is over quota.",
"service": "email",
"type": "info",
"used": 2000
}
],
"parent_type": "hypothetical",
"phone_number": "+15551234567",
"real_name": "John Doe",
"services": {
"email": {
"enabled": 1,
"quota": 1500
},
"ftp": {
"homedir": "/subaccount",
"quota": "0.00"
},
"webdisk": {
"homedir": "/bob",
"perms": "rw"
}
},
"special": 1,
"type": "sub",
"username": "example",
"dismissed_merge_candidates": [
{
"alternate_email": "user@example.com",
"avatar_url": "https://img.example.com/avatars/example.jpg",
"can_set_password": 1,
"dismissed": 1,
"domain": "example.com",
"full_username": "user@example.com",
"guid": "N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4",
"issues": [
{
"area": "quota",
"limit": 1500,
"message": "Your account is over quota.",
"service": "email",
"type": "info",
"used": 2000
}
],
"parent_type": "hypothetical",
"phone_number": "+15551234567",
"real_name": "John Doe",
"services": {
"email": {
"enabled": 1,
"quota": 1500
},
"ftp": {
"homedir": "/subaccount",
"quota": "0.00"
},
"webdisk": {
"homedir": "/bob",
"perms": "rw"
}
},
"special": 1,
"type": "sub",
"username": "example"
}
],
"invite_expiration": 1591718154,
"merge_candidates": [
{
"alternate_email": "user@example.com",
"avatar_url": "https://img.example.com/avatars/example.jpg",
"can_set_password": 1,
"dismissed": 1,
"domain": "example.com",
"full_username": "user@example.com",
"guid": "N4641:EXAMPLE.COM:564CC8A7:A82EA007D8348AC631C0170F9418EC1DEB0D164CC5A722A87C55EF5DD2AD98D4",
"issues": [
{
"area": "quota",
"limit": 1500,
"message": "Your account is over quota.",
"service": "email",
"type": "info",
"used": 2000
}
],
"parent_type": "hypothetical",
"phone_number": "+15551234567",
"real_name": "John Doe",
"services": {
"email": {
"enabled": 1,
"quota": 1500
},
"ftp": {
"homedir": "/subaccount",
"quota": "0.00"
},
"webdisk": {
"homedir": "/bob",
"perms": "rw"
}
},
"special": 1,
"type": "sub",
"username": "example"
}
]
},
"status": 1
}
}