Skip to content

API Overview

The Mail API is a REST API with endpoints for managing mailboxes, sending mail, viewing delivery stats, and controlling user access — available to all authenticated users based on their permissions.

Base URL

https://mail-api.solutechhub.com/api/v1

Interactive Documentation

The API exposes auto-generated interactive docs:

Authentication

All endpoints require the X-MAILAPI-TOKEN header.

curl -H "X-MAILAPI-TOKEN: your-token" https://mail-api.solutechhub.com/api/v1/users

Token Types

Type Description
admin Full access — all users, all domains, all mailboxes
user Scoped access — own mailbox + granted permissions only

Modules

Module Prefix Endpoints Description
Auth /auth 5 Login, logout, signup, token management
Mail /mail 8 Send mail, read inbox/sent, delivery log
Mailbox /mailbox 12 IMAP folder browser, message reader, attachments
Users /users 10 Create, update, enable/disable, delete, quota
Domains /domains 9 Domain management, DNS verification, DKIM
Tokens /tokens 6 API token CRUD
Stats /stats 7 Delivery stats, domain stats, per-user stats
Permissions /permissions 6 Grant/revoke delegated permissions

Permission System

Non-admin users can be granted domain-scoped permissions:

Permission Allows
manage_users Create/update/delete users in permitted domains
manage_domains View/update domains in permitted domains
view_mailbox Read mailboxes in permitted domains
view_stats View delivery stats for permitted domains
send_mail Send mail via the API

Permissions are granted by admins via POST /api/v1/permissions.

Response Format

All responses are JSON. Errors follow:

{
  "detail": "Human-readable error message"
}