REST API
zohomail-free ships with a self-hostable FastAPI server. Start it with:
Interactive docs are available at http://localhost:8000/docs (Swagger UI) and http://localhost:8000/redoc.
Authentication
All endpoints (except /health) require an X-API-Key header:
Set API_KEY in your .env file.
Endpoints
GET /health
Liveness check. No auth required.
GET /emails
List inbox messages.
Query params:
| Param | Default | Max | Description |
|---|---|---|---|
limit |
10 |
50 |
Number of messages |
[
{
"id": "1782000221530004400",
"from": "noreply@zohoaccounts.eu",
"subject": "Password changed for your Zoho account",
"time_ms": 1782000221511,
"unread": true
}
]
GET /emails/{id}
Read full email by message ID.
{
"id": "1782000221530004400",
"from": "noreply@zohoaccounts.eu",
"reply_to": "noreply@zohoaccounts.eu",
"to": "you@yourdomain.com",
"date": "Sun, 21 Jun 2026 04:03:37 +0400",
"subject": "Password changed for your Zoho account",
"message_id": "<abc123@eumail.zohoaccounts.com>",
"body": "Hi, your password was changed...",
"body_html": "<html>...</html>"
}
POST /emails/send
Send a new email.
curl -X POST http://localhost:8000/emails/send \
-H "X-API-Key: your_key" \
-H "Content-Type: application/json" \
-d '{
"to": ["friend@example.com"],
"subject": "Hello",
"body": "Hi there!"
}'
Body schema:
| Field | Type | Required | Description |
|---|---|---|---|
to |
string[] |
yes | Recipients |
subject |
string |
yes | Subject |
body |
string |
yes | Body text or HTML |
cc |
string[] |
no | CC addresses |
html |
boolean |
no | Send as HTML |
POST /emails/{id}/reply
Reply to an email. Sets In-Reply-To and References automatically.
curl -X POST http://localhost:8000/emails/1782000221530004400/reply \
-H "X-API-Key: your_key" \
-H "Content-Type: application/json" \
-d '{"body": "Thanks!"}'
Docker
Railway
See Getting Started for Railway deployment steps.
Built by MelkonTech