Get mail stats

Fetch the following mail statistics: number of domains, domain aliases, relay domains, mailboxes, aliases, sender addresses, addressbooks, calendars and sieve filters added in the system.

Also retrieves the total resource usage / properties (domains, domain aliases, relay domains, mailboxes, aliases & sender addresses) added by each DomainAdmin.

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

Response parameters

Parameter Type Description
addressbooks int Number of addressbooks
aliases int Number of aliases
calendars int Number of calendars
domain_aliases int Number of domain aliases
domains int Number of domains
mailboxes int Number of mailboxes
relay_domains int Number of relay domains
sender_addresses int Number of sender addresses
sieve_filters int Number of sieve filters
domainadmin_usage list Total properties added by each DomainAdmin

Example request (Python)

import requests
import json
from pprint import pprint

url = "https://example.domain.tld/api/v1/stats/mail/"
r = requests.get(url, auth=("admin","long-auth_token-here"))
try:
    pprint(r.json())
except:
    print(r.text)

Example response (JSON)

{'addressbooks': 77,
 'aliases': 90,
 'calendars': 78,
 'domain_aliases': 5,
 'domainadmin_usage': [{'alice': 44},
                       {'bob': 22},
                       {'charlie': 11}],
 'domains': 57,
 'mailboxes': 77,
 'relay_domains': 0,
 'sender_addresses': 25,
 'sieve_filters': 10}