Documentation

HyProxy Mail API

A self-hosted temporary email service. Receive mail at anything@hyproxy.lol, fetch messages via JSON API, and manage permanent inboxes from one control panel.

Introduction

All API endpoints accept and return JSON. Base URL is the deployment origin (https://mail.hyproxy.lol).

Every request that reads messages or manages inboxes must carry a valid X-API-Key header. The master key (set as a secret) authenticates as "master"; created keys authenticate as their own raw value and inherit a 1-year TTL.

Mail addresses follow the pattern <local>@hyproxy.lol. Temporary addresses (any random recipient that receives mail) are stored for 24 hours. Registered addresses created via the Inbox Manager are stored for 7 days and can be re-claimed by exactly one API key at a time.

Authentication

Pass your API key in the X-API-Key header (or as ?key= query param).

The master key is configured as a worker secret at deploy time. Created keys live in the apikey:<key> KV records and can be revoked from the admin panel.

bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/messages?to=solar.onyx.3168@hyproxy.lol"
bash
# Alternative: query string parameter
curl "https://mail.hyproxy.lol/messages?to=solar.onyx.3168@hyproxy.lol&key=YOUR_KEY"

Rate Limits

Address creation (POST /api/inboxes) is rate-limited per API key.

Two layers enforce the limit: an in-isolate memory counter (strict) and a cross-isolate KV epoch counter (best-effort). The strict per-isolate layer means bursts within a single Worker isolate will always return 429.

ScopeLimitWindowHeader on 429
Per-key1 requestsecondRetry-After: 1
Per-key60 requestsminuteRetry-After: 60

Message reads (/messages, /code) are not rate-limited.

Get Messages

List messages stored for a recipient address, newest first. Max 50 results.

ParamTypeDescription
tostringRecipient address (e.g. solar.onyx.3168@hyproxy.lol) — required.
afternumberUnix ms epoch; only return messages with ts > after. Default 0.
bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/messages?to=solar.onyx.3168@hyproxy.lol"
json
{
  "messages": [
    {
      "from": "verify@accounts.google.com",
      "subject": "Your verification code",
      "ts": 1715000000000,
      "text": "Your Google verification code is 482913. ..."
    }
  ]
}

Get Verification Code

Extract a numeric verification code from the latest message stored for an address.

The regex (?<!\d)(\d{n})(?!\d) is run over the concatenation of the latest message's subject and body. Returns null if no code is found.

ParamTypeDescription
tostringRecipient address — required.
digitsnumberLength of the code to extract. Default 6. Range 3–10.
bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/code?to=solar.onyx.3168@hyproxy.lol&digits=6"
json
{
  "code": "482913",
  "ts": 1715000000000,
  "from": "verify@accounts.google.com",
  "subject": "Your verification code"
}

Create Inbox

Create a permanent address (7-day message retention, no TTL on the slot itself).

Send either { "random": true } for an adjective.noun.4digits name (e.g. solar.onyx.3168), or { "name": "my-inbox" } with a custom 3–30 char local part.

Body FieldTypeDescription
randombooleanIf true, generate a random adj.noun.digits name.
namestringCustom local part. Regex ^[a-z0-9][a-z0-9._-]{1,28}[a-z0-9]$. Reserved names rejected.
bash
# Random
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"random":true}' \
  "https://mail.hyproxy.lol/api/inboxes"

# Custom
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"name":"signup-flow"}' \
  "https://mail.hyproxy.lol/api/inboxes"
json
{
  "addr": "solar.onyx.3168@hyproxy.lol",
  "created": 1715000000000
}

List Inboxes

List all permanent inboxes owned by the current API key. Includes message count per inbox.

bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/api/inboxes"
json
{
  "inboxes": [
    { "addr": "solar.onyx.3168@hyproxy.lol", "created": 1715000000000, "messages": 3 },
    { "addr": "signup-flow@hyproxy.lol", "created": 1714999999000, "messages": 0 }
  ],
  "used": 2,
  "max": 25
}

Inbox Messages

Fetch messages and the extracted 6-digit code for an inbox you own.

Returns 403 if the inbox is not owned by your key. Includes a pre-extracted code field for the latest message.

bash
curl -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/api/inboxes/messages?addr=solar.onyx.3168@hyproxy.lol"
json
{
  "messages": [
    { "from": "no-reply@example.com", "subject": "Code", "ts": 1715000000000, "text": "Your code: 482913" }
  ],
  "code": "482913"
}

Delete Inbox

Release a permanent inbox slot. The reg: and inbox: records are deleted immediately; the address becomes claimable again.

Returns 403 if the inbox is not owned by your key.

bash
curl -X DELETE -H "X-API-Key: YOUR_KEY" \
  "https://mail.hyproxy.lol/api/inboxes?addr=solar.onyx.3168@hyproxy.lol"
json
{ "ok": true, "addr": "solar.onyx.3168@hyproxy.lol" }

Errors

All errors return JSON with error and message fields.

StatusErrorMeaning
401unauthorizedMissing or invalid X-API-Key.
400missing to / bad_bodyRequired parameter missing or body malformed.
403forbiddenInbox not owned by your key.
404not_foundResource not found.
409taken / slots_fullAddress already claimed by another key, or your 25-slot limit is reached.
422invalid_nameCustom name failed validation.
429rate_limitedAddress-creation rate limit hit. Includes retry_after.