Tokenmail's API is at https://api.tokenmail.dev/v1. Send an API key from the dashboard as a bearer token. JSON in and out. Errors: {"error": {"code", "message", "request_id"}}; the id is also in X-Request-Id. Quote it when reporting a problem.
$ curl -s https://api.tokenmail.dev/v1/inboxes \
-H "Authorization: Bearer $TOKENMAIL_API_KEY" -H "Content-Type: application/json" \
-d '{"username": "signup", "name": "acme trial"}'
$ curl -s "https://api.tokenmail.dev/v1/inboxes/signup-k3f9qz@tokenmail.dev/wait?timeout=60" \
-H "Authorization: Bearer $TOKENMAIL_API_KEY"Rate limit. 10,000 requests per 60 seconds per account (all keys and sessions together), or per IP without a valid key. Responses carry RateLimit-Limit, -Remaining, -Reset and -Policy. Past it: 429 account_rate_limited or 429 ip_rate_limited, with Retry-After.
Mail limits. 100 inboxes per account. Messages up to 10 MB, kept 30 days. More than 100 messages an hour to one inbox are deferred (the sender retries).
Retries. Sending (/messages/send) takes an Idempotency-Key, so a retry doesn't send twice. Creating an inbox takes a client_id: the same client_id returns the inbox already made.
Routes
An inbox in a path is its id, its address, or the part before @.
| GET · POST | /inboxes | List · create {username?, name?, domain?, client_id?} ($2 a month; 402 inbox_payment_required without a subscription) |
| GET · PATCH · DELETE | /inboxes/{inbox} | Show · change name, metadata, status, signature, expiry · delete (the address is never reissued) |
| GET | /inboxes/{inbox}/wait?timeout= | The next received message, with its codes and links |
| GET | /inboxes/{inbox}/messages · /messages/search?q= | Messages, newest first · full-text search |
| GET · PATCH · DELETE | /inboxes/{inbox}/messages/{id} | One message · add and remove labels · delete |
| GET | /inboxes/{inbox}/messages/{id}/raw · /attachments/{att} | As received · an attachment's bytes |
| POST | /inboxes/{inbox}/messages/batch-get · /batch-update | Up to 100 messages · labels on up to 100 |
| GET · PATCH · DELETE | /inboxes/{inbox}/threads[/{thread}] | Conversations · labels on a whole one · delete |
| GET · POST · PATCH · DELETE | /inboxes/{inbox}/drafts[/{id}] | Drafts, replies, forwards, scheduled sends |
| POST | /inboxes/{inbox}/messages/send · /messages/{id}/reply · /reply-all · /forward | Sending (not on yet: 503 mail_send_off) |
| GET | /inboxes/messages · /threads · /drafts · /search | The same across every inbox you can see |
| GET | /inboxes/events?after=&wait= · /events/ws | Events: the feed (30 days) · a WebSocket |
| GET · POST · DELETE | /inboxes/[{inbox}/]lists/{direction}/{list_type}[/{entry}] | Allow and block lists (receive, send, reply) |
| GET · PUT · DELETE | /inboxes/[{inbox}/]forwarding | Forwarding addresses (up to 5, each confirmed) |
| GET · POST · PATCH · DELETE | /inboxes/domains[/{domain}] | Your own domains; /verify, /zone-file, /setup-link |
| GET · DELETE | /inboxes/suppressions[/{address}] | Addresses not sent to any more |
| GET | /inboxes/metrics · /inboxes/{inbox}/metrics | Events per type and day, bounce and complaint rates, storage |
| GET · POST | /inboxes/billing · /billing/checkout | Seats and the subscription · a Checkout page for more |
| GET · POST · DELETE | /api-keys[/{id}] · /{id}/rotate | API keys |
| GET · POST · PATCH · DELETE | /webhooks[/{id}] · /deliveries · /rotate · /test | Webhooks |
| GET | /account · /account/connections | The account · sign-in methods |
| GET | /audit · /audit/export?format=csv|ndjson | Audit log |
| GET · POST · PATCH · DELETE | /orgs[/{org}], /orgs/active, /orgs/{org}/members, /invites | Organizations |
| POST | /account/close · /account/reopen | Close · reopen within 30 days |