mail.alpha61.com

Authenticated REST API for alpha61.com inboxes. Each user sees their own mailbox.

Authentication

All endpoints use HTTP Basic auth. Your username determines which inbox you access.

Endpoints

GET /api/mail

List all messages in your inbox (summary: id, from, subject, date).

curl -u username:password https://mail.alpha61.com/api/mail

GET /api/mail/<id>

Read a single message (full headers + body). Moves message from new/ to cur/.

curl -u username:password https://mail.alpha61.com/api/mail/<id>

DELETE /api/mail/<id>

Permanently delete a message.

curl -X DELETE -u username:password https://mail.alpha61.com/api/mail/<id>

Python Client

import requests
from requests.auth import HTTPBasicAuth

API = "https://mail.alpha61.com/api/mail"
auth = HTTPBasicAuth("username", "password")

# List all messages
# Returns: {"count": N, "messages": [{"id", "from", "subject", "date"}, ...]}
response = requests.get(API, auth=auth).json()
for m in response["messages"]:
    print(f"[{m['id']}] {m['date']}  {m['from']}  {m['subject']}")

# Read a single message by id
# Returns: {"id", "from", "to", "subject", "date", "body", "headers"}
#   body    - plain text content (or HTML if no plain text part)
#   headers - dict of all email headers
msg = requests.get(f"{API}/{msg_id}", auth=auth).json()
print(msg["subject"])
print(msg["body"])

# Delete a message by id
# Returns: {"ok": true, "deleted": "<id>"}
requests.delete(f"{API}/{msg_id}", auth=auth)