API operation · mail group
GET
/mail/stats
First published 3 Oct 2026
0.1.0Unchanged since publicationGet mail statistics and the Postfix queue size
Who may call it
AdministratorResellerCustomer
Token scope, any of
mailreadallAnswers200 OK
The stats object contains Rspamd counters for scanned messages, actions taken, and Bayes learning, along with today's mail totals from pflogsumm and the Postfix queue size.
Each fresh reading requires pflogsumm to scan the entire mail log. Use max_age to reuse a recent reading. The API returns 400 if max_age falls outside the allowed whole-number range.
As a command
Run as root on the serverParameters
max_agequery ·integer, 1 to 86400Maximum age in seconds of a saved reading eligible for reuse, from 0 to 86400. A reused reading is marked cached.
Example
See the API overview for how to set $API and $TOKEN.Request
curl -sS -X GET "$API/mail/stats?max_age=1" \ -H "Authorization: Bearer $TOKEN"
Response ·
200 OK{
"stats": {
"cached": true,
"queue": 1,
"read_at": "text",
"rspamd": {},
"today": {}
}
}Errors
2 errors, each a status and a sentence400<what> must be a whole number from 0 to <max>401Authentication requiredNo error of this operation matches.
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/get-mail-stats/