Get all accounts

Retrieve all accounts (including the authenticated user)

  • HTTP Method: GET
  • URL: https://example.domain.tld/api/v1/accounts/
  • Require authentication: Yes
  • Permission level required: MasterAdmin / DomainAdmin / MailUser

Query parameters

Parameter Type Description Required
limit int Number of records (max 50) Optional
start int Record offset Optional
search str Search term Optional
perm_level str Permission level Optional
enabled int Status: 0 or 1 Optional
api_access int Status: 0 or 1 Optional

Response parameters for MasterAdmin

Parameter Type Description
accounts list List of accounts
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
last_login int Previous login as UNIX timestamp (seconds)
password_hash str SHA512-Crypt hash of password

Response parameters for DomainAdmin

Parameter Type Description
accounts list List of accounts
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
last_login int Previous login as UNIX timestamp (seconds)
password_hash str SHA512-Crypt hash of password
domains str Comma separated list of administered domains
quota_aliases int Aliases quota
quota_aliases_used int Aliases quota used
quota_domainaliases int Domain aliases quota
quota_domainaliases_used int Domain aliases quota used
quota_domains int Domains quota
quota_domains_used int Domains quota used
quota_mailboxes int Mailboxes quota
quota_mailboxes_used int Mailboxes quota used
storagequota_total int Storage quota in MB
storagequota_used int Storage quota used in MB

Response parameters for MailUser

Parameter Type Description
accounts list List of accounts
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
last_login int Previous login as UNIX timestamp (seconds)
password_hash str SHA512-Crypt hash of password
domain str Domain of email account
storagequota_total int Storage quota in MB
storagequota_used int Storage quota used in MB

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/accounts/"
#url = "https://example.domain.tld/api/v1/accounts/?limit=10&start=0" # example using query parameters to fetch first 10 accounts
r = requests.get(url, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response (JSON)

{'accounts': [{'api_access': 1,
               'enabled': 1,
               'language': 'en',
               'last_login': 1583116949,
               'password_hash': '{SHA512-CRYPT}$6$rounds=70000$vUk5SWTc2srgRya8$RQOljAPVjnjr3apPOmHbcZKsK9I2lrjA82u0ud4CaJl0wO.tyqqEWyqMwi57Z1wURYwHU8uDPQST0NdrJdbZI0',
               'perm_level': 'MasterAdmin',
               'recovery_email': 'recovery@mydomain.tld',
               'username': 'admin'},
              {'api_access': 1,
               'domains': 'mydomain.com',
               'enabled': 1,
               'language': 'en',
               'last_login': 1582561785,
               'password_hash': '{SHA512-CRYPT}$6$rounds=70000$/oRqKJRjL8qazidW$emfUhHeRzZ4d1y7s.UI6iJF8kJ.ZjLJB9hxXFSW9FyZ8/dfwNMLEmrVdFGyKBZfpAx6gAXOVnMNZmX0Ll9LmT/',
               'perm_level': 'DomainAdmin',
               'quota_aliases': 9999,
               'quota_aliases_used': 1,
               'quota_domainaliases': 9999,
               'quota_domainaliases_used': 0,
               'quota_domains': 9999,
               'quota_domains_used': 1,
               'quota_mailboxes': 9999,
               'quota_mailboxes_used': 1,
               'recovery_email': 'recovery@mydomain.tld',
               'storagequota_total': 10000,
               'storagequota_used': 500,
               'username': 'domainadm'},
              {'api_access': 1,
               'domain': 'mydomain.com',
               'enabled': 1,
               'language': 'en',
               'last_login': 1582561631,
               'password_hash': '{SHA512-CRYPT}$6$rounds=70000$a6twk7EltgxYbby5$rmaSWGyDQTR0uz.KRN.pmFs35DKhMMREHFZL14pRtAsFTSNSiOxt/1i9sSoYzzFVzjzF9tqkoE00xsTCjUwOU.',
               'perm_level': 'MailUser',
               'recovery_email': 'recovery@mydomain.tld',
               'storagequota_total': 500,
               'storagequota_used': 2,
               'username': 'user1@mydomain.com'}]}