SmailPro Bridge · v2.10.3

Temporary email, under your control.

Authenticated receive-only API over the account owner's SmailPro Premium inboxes. No Sonjj API credits.

Русская версия · Updates and release notes · OpenAPI JSON · AI instructions

Keeping your integration current

Watch for changes

Release notes live at /changelog, and the same history is served as JSON at /changelog.json. Both are public and need no token. Every release states whether it is drop-in or breaking and names the exact client-side action.

curl -sS "$BASE/changelog.json" | jq '{version, latest}'

Compatibility rules

New response fields and new error codes can appear in any release, so parse defensively and ignore unknown keys. An existing field is never removed or renamed without a breaking entry in the changelog. Current version: 2.10.3.

Start in three requests

export BASE=https://smailpro.bridgefive.top
export TOKEN='your-long-random-api-token'

# Pick a domain and a server id its provider actually accepts
curl -sS "$BASE/domains?grouped=1" -H "Authorization: Bearer $TOKEN"

# Create a premium Gmail inbox (server 2)
curl -sS "$BASE/create" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json'   -H "Idempotency-Key: create-$(date +%s)-$RANDOM" -d '{"type":"real","server":"2"}'

# Persist address, key, timestamp. Key rotates after every check.
curl -sS "$BASE/wait" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"address":"…@gmail.com","key":"…","timestamp":123,"subject_contains":"Confirm","timeout":90}'

For people

Authentication

/health and /ready are public side-effect-free checks. Other API routes require Authorization: Bearer TOKEN. Give every client a separate token: create fairness and diagnostics are tracked by API-key identity. Keep tokens out of browser code, URLs, and logs.

Create queue and retries

Only one upstream create can run at once, but callers wait in FIFO order and one token cannot reserve multiple waiting positions. On 429 or 503, honor Retry-After, add random jitter, and retry the identical body with the same Idempotency-Key. Never spin in a tight retry loop.

Rotating inbox key

An inbox is address, key, and timestamp. Persist the complete returned inbox object after every poll, wait, OTP, or link response.

For AI agents

  1. Read llms.txt for operational invariants and OpenAPI JSON for the contract.
  2. Persist returned inbox state atomically and serialize poll/wait/otp/link operations per inbox; concurrent uses of one rotating key race.
  3. Interpret live:null as an upstream check failure, not an empty inbox; inspect error_code.
  4. Never expose Bearer tokens, inbox keys, message bodies, attachments, or confirmation URLs.

Endpoint reference

Public: GET /health and GET /ready are side-effect-free liveness and readiness checks; GET /docs, /changelog, /changelog.json, /openapi.json and /.well-known/llms.txt are documentation.

Bearer required: GET /status, /capabilities, /domains, /history, /stats, /message, /links, /otp, /attachment, /inboxes; POST /login, /logout, /create, /restore, /poll, /poll/batch, /wait, /otp, /link, /inboxes; and DELETE /inboxes/<alias>.

The address you get is the address to use

The upstream issues Microsoft mailboxes from a shared pool. Ask for hotmail.com, outlook.fr or any other Microsoft domain and you receive an @outlook.com address. /create and /restore report this explicitly: domain is what was issued, requested_domain is what you asked for, and domain_substituted is true when they differ. Send verification mail to address. Mail sent to the domain you requested reaches a mailbox that does not exist, and restoring such an address is 400 bad_argument.

Alias registry

An alias belongs to the API key that created it. POST /inboxes with {"alias":"signup-a"} creates the inbox and stores it under your key, GET /inboxes lists the aliases your own key created, DELETE /inboxes/<alias> forgets one. Aliases match [A-Za-z0-9_-]{1,64} and the rotating key is never returned. An alias another key created answers 404 not_found like an unknown one, and POST /inboxes on it returns 409 alias_taken — pick another name. Aliases created before per-key ownership, or from the admin panel or the CLI, are not addressable over the API; re-create them with POST /inboxes. The same registry backs the admin panel and the CLI.

Re-attaching an address

POST /restore requires type

alias and real are different mailboxes, not two spellings of one: alias is a dotted or plus variant of the account address, real is a clean address from the pool. Nothing in the address itself says which one you hold, so /restore requires you to say. Send type as exactly "alias" or "real", matching how the address was created; omitting it or sending anything else is 400 bad_argument.

Why it is required rather than defaulted. Sending the wrong flavour is invisible in the response: the upstream re-attaches the other mailbox, answers 200 with an address and a key, and every later /poll then reports live:true with an empty messages array — identical to mail that never arrived. A 400 that names both values costs one fixed request; a plausible-looking empty inbox costs a debugging session. Persist type from the /create response next to the address, key and timestamp.

curl -sS "$BASE/restore" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json'   -d '{"address":"…@gmail.com","type":"real","server":"2"}'

POST /create and POST /inboxes are unchanged: type stays optional there and still defaults to alias. Both now reject any value other than alias or real instead of forwarding it upstream.

Errors and recovery

400 bad_json

A request body must be one valid JSON document, sent raw (application/json). A form-encoded, truncated or otherwise unparseable body — or a JSON value that is not an object — is bad_json. The other 400 is bad_argument: the body parsed, but a field is missing, mistyped or out of range, and the message names it. Both are permanent; fix the request, do not retry it unchanged.

400 bad_argument

Malformed input, rejected regex, or an upstream refusal that genuinely names your request as the fault - an address outside the pool ("no … email found") or a validation error naming the field. Fix it; do not retry unchanged. Any other upstream 400 on /poll, /wait, /otp and /poll/batch is 502 upstream_error instead: retryable, not your bug to fix.

400 unknown_domain

That domain is not offered. List the valid ones with GET /domains?grouped=1; do not retry unchanged.

400 bad_server

The domain's provider does not offer that server id. The message names the accepted ids; other domains take none.

503 upstream_busy

The provider is throttling or temporarily out of capacity. Retry-After is 120 seconds; the request is valid and will succeed once the burst passes.

503 captcha_cooldown

Our upstream session lapsed and the login challenge could not be solved yet, so session-bound calls are paused while it backs off. Retry-After carries the exact remaining seconds. Your credentials are fine: retry after the hint rather than re-issuing your token.

400 bad_argument (rejected key)

The inbox key does not belong to that address, or the upstream named it as the argument it refused. This is not an expiry: the mailbox may still be live, so do not discard it. An upstream refusal that does not name an argument is 502 upstream_error instead, because those clear on their own — retry it rather than discarding the inbox.

401 unauthorized

Invalid Bearer token or unaccepted Host header.

404 not_found

Unknown route, or an alias that does not exist or was created by another API key - the two are indistinguishable by design, so the API cannot be used to discover what other clients hold.

409 alias_taken

That alias is already in use by another API key, or predates per-key ownership and belongs to the admin panel. Choose another name; retrying unchanged will not help.

410 inbox_expired

The temporary address is no longer active. Create or restore another inbox.

502 upstream_error

SmailPro/Sonjj failed on its own state, including any 400 it returned that did not name your request as the fault. Retry-After is included; retry with bounded backoff and avoid duplicate create calls. A response cut off in transit is 502 network, which /wait retries within your deadline.

Migrating to v2.10.3

One change requires a client edit: POST /restore now requires a type field — see item 1. Everything else is additive, so a client written against v2.1.0 keeps working. Full history with dates is on the updates page.

1. Send type on POST /restore

Add type to every /restore body, set to the value the address was created with. Without it the call is now 400 bad_argument; before this release it silently re-attached the alias mailbox, which for a real address is a different inbox that answers live:true and never shows your mail. Store type alongside the address and key.

curl -sS "$BASE/restore" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json'   -d '{"address":"…@gmail.com","type":"real","server":"2"}'

2. Stop hardcoding gmail.com

Ask for the catalog, then send a server id that the chosen domain's provider actually accepts. Passing server: "4" with an Outlook domain is now a clear 400 bad_server instead of an upstream failure.

# Read the catalog once, cache it, refresh occasionally
curl -sS "$BASE/domains?grouped=1" -H "Authorization: Bearer $TOKEN"

# google: servers 1-4 · microsoft: servers 1-2 · other: no server at all
curl -sS "$BASE/create" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -H "Idempotency-Key: create-$(date +%s)-$RANDOM" \
  -d '{"type":"real","domain":"outlook.com","server":"2"}'

3. Handle two new 400 codes

Treat unknown_domain and bad_server as permanent input errors: log them, fix the request, never retry unchanged. Both are rejected before the create queue, so a mistake costs you no slot and no Idempotency-Key.

4. Read an OTP without waiting

If you already fetched the message, use GET /otp instead of POST /otp. It returns immediately and holds none of the 64 service-wide long-poll slots, so it never competes with a real wait.

curl -sS "$BASE/otp?address=$ADDR&mid=$MID&length=6" -H "Authorization: Bearer $TOKEN"

5. Let the bridge track rotating keys

If storing and rotating the inbox key is awkward in your client, register an alias instead and address the inbox by name. The key stays server-side and is never returned.

curl -sS "$BASE/inboxes" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -H "Idempotency-Key: alias-$(date +%s)-$RANDOM" \
  -d '{"alias":"signup-a","type":"real","domain":"outlook.com","server":"2"}'

curl -sS "$BASE/inboxes" -H "Authorization: Bearer $TOKEN"
curl -sS -X DELETE "$BASE/inboxes/signup-a" -H "Authorization: Bearer $TOKEN"

6. Use percentiles, not averages

GET /stats duration entries now carry p50, p95 and p99. Alert on p95: an average hides the slow tail that your users actually feel.

Deployment

# Keep the origin private behind an authenticated Cloudflare Tunnel or a
# firewall/ACL that permits only the trusted reverse proxy. Do not copy a
# Cloudflare IP allowlist into nginx.
#
# /etc/smailpro-api.env (root:root, mode 0600 — systemd reads it as root
# before dropping to User=smailpro, so the service account never needs
# read access) MUST define:
# SMALLPRO_EMAIL, SMALLPRO_PASSWORD, SMALLPRO_API_TOKEN,
# SMAILPRO_ADMIN_PASSWORD_HASH
#
# The supplied unit configures SMAILPRO_PUBLIC_HOST,
# SMAILPRO_ADMIN_SESSION_SECONDS, SMAILPRO_MAX_LONG_POLLS,
# SMAILPRO_MAX_LONG_POLLS_PER_KEY, and all state-file paths.
#
# Preflight needs BOTH sources, so run it the way the unit does rather than
# by hand: the Environment= names live in the unit, not in the env file.
sudo systemctl start smailpro-api.service   # ExecStartPre runs preflight first
systemctl show smailpro-api.service -p ExecStartPre --value   # expect status=0

# /health and /ready are public checks. Every operating API route needs:
# Authorization: Bearer TOKEN
# nginx preserves Host and supplies X-SmailPro-Client-IP itself; it discards
# caller-supplied X-Forwarded-For / X-Real-IP / CF-Connecting-IP.

The offline preflight verifies required names, configuration syntax, and state-parent access without connecting upstream or printing secret values.