Repository navigation
The REST API
This page began as a chapter of the 6.2.10 manual and has been corrected for 6.2.24. The Control Panel's pages are grouped differently now, so the paths below use today's groups; the TLS ports 465, 993 and 995 exist only after you create them on the TCP/IP ports page (a fresh install seeds 25, 587, 110 and 143); and everything added since 6.2.10 is in Changes Since 6.2.10. Where a value here disagrees with the Settings Reference, which is generated from the code, the reference is right.
A modern alternative to COM for automation, and the only option from a non-Windows machine.
RestApiPort=8443
RestApiBindAddress=127.0.0.1Authentication is one of: HTTP Basic with the administrator password
(Administrator:<password>; when a second factor is enrolled on that credential the
request also carries X-hMailServer-OTP: <code>), or a Bearer API key
(Authorization: Bearer hmapi_..., created on the REST API keys page or with
POST /api/v1/apikeys; read-only by default, expiring, optionally limited to named
domains and source addresses — the preferred credential for scripts). In the tree after
6.2.27, not yet in a published release: an account's own address and password reach the
self-service routes under /api/v1/me and the /portal page, and nothing else. The full
route table, the key store and the credential rules are in APIs Reference.
TLS is required unless bound to 127.0.0.1, localhost or ::1 — the listener
refuses to start otherwise ("TLS certificate is required unless bound to 127.0.0.1 or
::1. Set RestApiCertificateFile and RestApiPrivateKeyFile."). With no certificate
configured it uses the ACME certificate when one exists.
| Method | Endpoint | Does |
|---|---|---|
GET |
/api/v1/status |
Server status and session counts |
GET |
/api/v1/domains |
List domains |
GET / POST
|
/api/v1/domains/<name>/accounts |
List / create accounts |
DELETE |
/api/v1/accounts/<address> |
Delete an account |
GET |
/api/v1/domains/<name>/aliases |
List a domain's aliases |
GET / POST
|
/api/v1/domains/<name>/lists |
List / create distribution lists |
DELETE |
/api/v1/lists/<address> |
Delete a distribution list |
GET |
/api/v1/domains/<name>/dkim |
A domain's DKIM signing configuration |
GET |
/api/v1/queue |
The delivery queue |
POST |
/api/v1/queue/<id>/retry |
Retry a queued message |
DELETE |
/api/v1/queue/<id> |
Delete a queued message |
GET |
/api/v1/quarantine |
Quarantined messages |
POST |
/api/v1/quarantine/<id>/release |
Release one to its recipients |
DELETE |
/api/v1/quarantine/<id> |
Delete one |
GET |
/api/v1/archive?... |
Search the archive index; /archive/<id> one entry; POST/DELETE /archive/<id>/hold legal hold |
GET / POST
|
/api/v1/ipranges |
List / create IP ranges; DELETE /api/v1/ipranges/<id>
|
GET |
/api/v1/certificates |
The SSL certificates (never a key password) |
GET |
/api/v1/rules |
The global rules |
GET |
/api/v1/logs, /api/v1/logs/<name>?lines=N
|
Log files and a log's tail |
GET / POST
|
/api/v1/backup |
Backup status / start a backup |
GET |
/api/v1/settings |
A read-only snapshot of server-wide settings |
GET |
/api/v1/tlsa |
Publish-ready DANE TLSA records |
GET |
/api/v1/srv |
Publish-ready client-discovery SRV records |
GET |
`/api/v1/metrics/history?metric=&range=24h | 7d |
GET / POST / DELETE
|
/api/v1/apikeys[/<id>] |
Manage API keys (administrator password only) |
GET |
/api/v1/openapi.json |
The OpenAPI description |
In the tree after 6.2.27, not yet in a published release: GET /api/v1/update and
POST /api/v1/update/check|download|install (the live update), GET /portal (the
self-service sign-in page) and the account's own routes under /api/v1/me (state,
password, automatic reply, quarantine, folders, messages, search, send, drafts,
attachments, settings, Sieve filters) with POST/DELETE /api/v1/session for browser
sessions. Every route, its credential rules and its JSON shape are in APIs Reference
section 4.
# plain HTTP: the listener is bound to loopback and no certificate is configured
curl -u Administrator:your-admin-password http://127.0.0.1:8443/api/v1/status
# with RestApiCertificateFile/RestApiPrivateKeyFile (or an ACME certificate) set, use https://hMailServer 6.3.8, the latest release (2 November 2026, schema 6108) · AGPL-3.0-or-later · Repository · Mirror on GitHub · Report a documentation error (a GitLab issue naming the page)
Home — full index
Start here
1. Install and run
- Before You Install
- Installing hMailServer
- Installing on Linux
- Running in a Container
- Profiles and Environment
- The Control Panel
- The Control Deck
- Your First Domain and Mailbox
- Connecting a Mail Client
- The Webmail
- DNS for Your Domain
- Migration
2. Secure it
- Encryption and Certificates
- Database TLS
- Encryption for People
- Stopping Spam
- Stopping Viruses
- Security Hardening
- Secure Defaults
- The Service Account
- Secrets at Rest
- Sign-in and Identity
- Security Policy
3. Operate it
- Monitoring and Health
- The SNMP Agent
- Backup and Restore
- Message Storage
- Compliance and eDiscovery
- Troubleshooting
- Diagnosing Stalled Mail
- Relocating an Installation
- Upgrading hMailServer
- Upgrading Guide
- The Update Feed
- Migrating the Database Backend
- High Availability Runbook
- Warm Standby
- Runbooks Digest
4. Extend it
- Rules and Sieve
- Aliases Lists and Public Folders
- Rooms and Equipment
- Mailing Lists
- Routes and Relays
- Mail In to a Webhook
- Outbound Shaping
- The COM API and Scripting
- Event Scripts
- The REST API
- Command Line
- APIs Reference
5. Contribute to it
- Project Handbook
- Architecture
- Contributing
- Release Process
- Governance
- Assurance Case
- Regression Test Environment
- Fuzzing
- Regulatory Scope
- Third-Party Binaries
Look it up — from any journey
- Settings Reference
- Settings Overview
- Capabilities and Configuration
- Control Panel Reference
- Control Panel Pages
- Ports Reference
- Changes-Since-6210
- Version-History-to-6210
- Glossary
About this wiki
- hMailServer 6.3.8 is the latest release (2 November 2026, schema 6108)
- Pages say since 6.3.4 where a feature is new in it
- AGPL-3.0-or-later
- Repository, the one place the project is worked on
- Its mirror on GitHub, since 18 October 2026, with no Issues
- Questions: a GitLab issue with the Question template, GitHub Discussions Q&A, or the forum
- Report a documentation error: a GitLab issue naming the page