Create account

Create accounts (users) of varying permission levels (MasterAdmin, DomainAdmin, MailUser)

  • HTTP Method: POST
  • URL: https://example.domain.tld/api/v1/accounts/
  • Require authentication: Yes

Permission levels

  • MailUser is the permission level with ability to send and receive emails.
  • DomainAdmin administers all MailUsers of domains belonging to them.
  • MasterAdmin administers all admins & MailUsers and has access to server-wide configuration.

Password requirements

  • Must be at least 12 characters long
  • Must contain at least 1 uppercase & lowercase letter
  • Must contain at least 1 digit

Create MasterAdmin

  • Permission level required: MasterAdmin

Request parameters

Parameter Type Description Required
username str Account username Required
password str Account password Required
perm_level str Account permission level Required
api_access int Enable (1) or disable (0) API access Required
enabled int Enable (1) or disable (0) account Required
recovery_email str Email to use for password reset Required
language str ISO 639-1 or ISO 639-2 language code Required

password can be in plain-text or hashed form. Hash must use SHA512-Crypt scheme and must be of the following format: {SHA512-CRYPT}$6$...

Response parameters

Parameter Type Description
username str Account username
perm_level str Account permission level
api_access int Enabled (1) or disabled (0) API access
enabled int Enabled (1) or disabled (0) account
recovery_email str Email used for password reset
language str ISO 639-1 or ISO 639-2 language code

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/accounts/"
data = {
"username" : "some-username",
"password" : "some-password",
"perm_level" : "MasterAdmin",
"api_access" : 1,
"enabled" : 1,
"recovery_email" : "recovery@domain.tld",
"language" : "en"
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{'api_access': 1,
 'enabled': 1,
 'language': 'en',
 'perm_level': 'MasterAdmin',
 'recovery_email': 'recovery@domain.tld',
 'username': 'some-username'}

Create DomainAdmin

  • Permission level required: MasterAdmin

Request parameters

Parameter Type Description Required
username str Account username Required
password str Account password Required
perm_level str Account permission level Required
api_access int Enable (1) or disable (0) API access Required
enabled int Enable (1) or disable (0) account Required
recovery_email str Email to use for password reset Required
language str ISO 639-1 or ISO 639-2 language code Required
domains str Comma separated list of administered domains Required
storagequota_total int Storage quota in MB Required
quota_domains int Domains quota Required
quota_mailboxes int Mailboxes quota Required
quota_aliases int Aliases quota Required
quota_domainaliases int Domain aliases quota Required

password can be in plain-text or hashed form. Hash must use SHA512-Crypt scheme and must be of the following format: {SHA512-CRYPT}$6$...

Response parameters

Parameter Type Description
username str Account username
perm_level str Account permission level
api_access int Enabled (1) or disabled (0) API access
enabled int Enabled (1) or disabled (0) account
recovery_email str Email used for password reset
language str ISO 639-1 or ISO 639-2 language code
domains str Comma separated list of administered domains
storagequota_total int Storage quota in MB
quota_domains int Domains quota
quota_mailboxes int Mailboxes quota
quota_aliases int Aliases quota
quota_domainaliases int Domain aliases quota

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/accounts/"
data = {
"username" : "some-username",
"password" : "some-password",
"perm_level" : "DomainAdmin",
"api_access" : 1,
"enabled" : 1,
"recovery_email" : "recovery@domain.tld",
"language" : "en",
"domains" : "domain1.tld, domain2.tld", # value can be empty string
"storagequota_total" : 500,
"quota_domains" : 5,
"quota_mailboxes" : 5,
"quota_aliases" : 5,
"quota_domainaliases" : 5,
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{   
    'api_access': 1,
    'domains' : 'domain1.tld, domain2.tld',
    'enabled': 1,
    'language': 'en',
    'perm_level': 'DomainAdmin',
    'quota_domains' : 5,
    'quota_mailboxes' : 5,
    'quota_aliases' : 5,
    'quota_domainaliases' : 5,
    'recovery_email': 'recovery@domain.tld',
    'storagequota_total' : 500,
    'username': 'some-username'
}

Create MailUser

  • Permission level required: MasterAdmin / DomainAdmin

Request parameters

Parameter Type Description Required
username str Account username (email address) Required
password str Account password Required
perm_level str Account permission level Required
api_access int Enable (1) or disable (0) API access Required
enabled int Enable (1) or disable (0) account Required
recovery_email str Email to use for password reset Required
language str ISO 639-1 or ISO 639-2 language code Required
domain str Domain of email account Required
storagequota_total int Storage quota in MB Required

password can be in plain-text or hashed form. Hash must use SHA512-Crypt scheme and must be of the following format: {SHA512-CRYPT}$6$...

Response parameters

Parameter Type Description
username str Account username (email address)
perm_level str Account permission level
api_access int Enabled (1) or disabled (0) API access
enabled int Enabled (1) or disabled (0) account
recovery_email str Email used for password reset
language str ISO 639-1 or ISO 639-2 language code
domain str Domain of email account
storagequota_total int Storage quota in MB

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/accounts/"
data = {
"username" : "user@mydomain.tld",
"password" : "some-password",
"perm_level" : "MailUser",
"api_access" : 1,
"enabled" : 1,
"recovery_email" : "recovery@domain.tld",
"language" : "en",
"domain" : "mydomain.tld",
"storagequota_total" : 100
}
r = requests.post(url, json=data, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except: 
    print(r.text)

Example response (JSON)

{   
    'api_access': 1,
    'domain' : 'mydomain.tld',
    'enabled': 1,
    'language': 'en',
    'perm_level': 'MailUser',
    'recovery_email': 'recovery@domain.tld',
    'storagequota_total' : 100,
    'username': 'user@mydomain.tld'
}