1. Home
  2. Docs
  3. Developer Guide
  4. API
  5. Email Accounts

Email Accounts

The email function manages the mailboxes of a hosting account. emailadmin returns the server administrator’s email address.

URL: https://YOUR-SERVER:2304/v1/email/ — permission Email.

Note: Creating a mailbox uses the parameters email + domain. All other actions identify the mailbox with mailbox = the full address (info@example.com). Using email for those actions returns an error page.

Create a mailbox (action=add)

ParameterDescription
userHosting account username
emailPart before @, for example info
domainDomain of the account
passMailbox password
quotamailMailbox size in MB (0 = unlimited)
curl -k -X POST https://203.0.113.10:2304/v1/email/ \
  -d "key=YOUR_API_KEY&action=add&user=john&email=info&domain=example.com&pass=S3cretPass&quotamail=100"
{"status":"OK"}

List mailboxes (action=list)

curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=list&user=john"
{"status":"OK","result":[{"email":"info@example.com","pass":"{SHA512-CRYPT}$6$…","quota":"104857600","consumed":0,"status":"1"}]}
FieldMeaning
emailMailbox address
quotaQuota in bytes (104857600 = 100 MB)
consumedUsed space
status1 = active
passPassword hash — do not log or display it

Update a mailbox (action=udp)

ParameterDescription
userHosting account username
mailboxFull address
passwordNew password (optional)
quotaNew quota in MB (optional)
curl -k -X POST https://203.0.113.10:2304/v1/email/ \
  -d "key=YOUR_API_KEY&action=udp&user=john&mailbox=info@example.com&password=N3wS3cret&quota=200"
{"status":"OK"}

Suspend, unsuspend and delete

curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=susp&user=john&mailbox=info@example.com"
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=unsp&user=john&mailbox=info@example.com"
curl -k -X POST https://203.0.113.10:2304/v1/email/ -d "key=YOUR_API_KEY&action=del&user=john&mailbox=info@example.com"
{"status":"OK"}

A suspended mailbox cannot log in or receive mail. Deleting a mailbox removes all its messages.

Server admin email (emailadmin)

URL: /v1/emailadmin/ — action=list. Returns the email address of the server administrator.

curl -k -X POST https://203.0.113.10:2304/v1/emailadmin/ -d "key=YOUR_API_KEY&action=list"
{"status":"OK","emailadmin":"admin@example.com"}

Related

Was this article helpful to you? No Yes