Overview
MX API Documentation
Configure domains, manage mailboxes, sync mail, and subscribe to mailbox events from a single API.
Quickstart
- Set env vars in
.envor shell (MX_API_KEYS, Postgres, IMAP, JWT). - Start the server:
npm run dev. - Open
http://127.0.0.1:3000/docsfor docs. - Use the API key from
MX_API_KEYSfor/v2routes.
Core concepts
Authentication. /v2 routes use x-api-key. Mail routes require
JWT.
Rate limits. 60 requests per minute per IP.
Realtime events. Connect to /ws for mailbox change notices.
Common headers
Authorization: Bearer YOUR_JWT x-api-key: YOUR_API_KEY x-dovecot-signature: hex_hmac
Webhook requests must be signed using the raw request body.
Service endpoints
These endpoints serve the documentation UI and assets.
| Method | Path | Description |
|---|---|---|
| GET | / |
Docs home page (same as /docs). |
| GET | /docs |
Docs home page. |
| GET | /docs/* |
Static docs files (HTML, CSS, JS, images, markdown). |
Examples
curl -i "http://127.0.0.1:3000/"
curl -i "http://127.0.0.1:3000/docs/reference.html"
Notes
These routes are public and do not require authentication.
If you deploy behind a proxy, ensure it forwards /docs paths.