Temporary email API
Create inboxes and read messages from code: for sign-up autotests, checking mailings and email confirmations.
Authentication
Every request is signed with a key in the Authorization header. Keys are issued on paid plans.
Authorization: Bearer um_YOUR_KEYBase URL
https://urusmail.pro/api/v1Quick start
- Create an inbox
- Wait for a message (the request itself waits up to 30 seconds)
- Read the message: text, verification code and links
# 1. create an inbox
curl -X POST https://urusmail.pro/api/v1/inboxes \
-H "Authorization: Bearer um_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"ttl_minutes": 60}'
# -> {"inbox":{"id":123,"email":"swift.fox1234@urusmail.pro","expires_at":"..."}}
# 2. wait for a message (up to 30 s)
curl "https://urusmail.pro/api/v1/inboxes/123/messages?wait=30" \
-H "Authorization: Bearer um_YOUR_KEY"
# -> {"messages":[{"id":456,"subject":"Your code","code":"482910", ...}]}
# 3. read the full message
curl https://urusmail.pro/api/v1/inboxes/123/messages/456 \
-H "Authorization: Bearer um_YOUR_KEY"const API = "https://urusmail.pro/api/v1";
const headers = { Authorization: "Bearer " + process.env.URUSMAIL_KEY, "Content-Type": "application/json" };
// create an inbox for one test
const { inbox } = await (await fetch(API + "/inboxes", { method: "POST", headers, body: JSON.stringify({ ttl_minutes: 30 }) })).json();
// ... your app sends a confirmation email to inbox.email ...
// wait for the email and take the code
let code = null;
for (let i = 0; i < 4 && !code; i++) {
const { messages } = await (await fetch(`${API}/inboxes/${inbox.id}/messages?wait=30`, { headers })).json();
code = messages[0]?.code ?? null;
}
console.log(inbox.email, code);
await fetch(`${API}/inboxes/${inbox.id}`, { method: "DELETE", headers });Endpoints
| GET | /me | Plan, limits, current usage and settings |
| PATCH | /me | Change settings. Body: full_messages_in_list (true or false) |
| GET | /domains | Domains you can create inboxes on |
| POST | /inboxes | Create an inbox. Body: name, domain, ttl_minutes (all optional) |
| GET | /inboxes | List your inboxes |
| GET | /inboxes/{id} | A single inbox |
| DELETE | /inboxes/{id} | Delete an inbox with its messages |
| GET | /messages | All messages of the account in one list (short). Parameters: inbox_id, since_id, limit (up to 100), full=0 |
| GET | /inboxes/{id}/messages | Messages in an inbox (short). Parameters: since_id, wait (0–30 seconds), full=0 |
| GET | /inboxes/{id}/messages/{mid} | Full message: text, html, code, links |
| DELETE | /inboxes/{id}/messages/{mid} | Delete a message |
| GET | /custom-domains | Your domains and the DNS records they need |
| POST | /custom-domains | Add a domain. Body: domain, catch_all |
| POST | /custom-domains/{id}/verify | Check DNS records and enable mail reception |
| PATCH | /custom-domains/{id} | Turn catch_all on or off |
| DELETE | /custom-domains/{id} | Delete a domain and its inboxes |
| GET | /webhook | Notification URL, secret and the last delivery result |
| PUT | /webhook | Turn on notifications. Body: url (https), rotate_secret (optional) |
| POST | /webhook/test | Send a test notification and get the result right away |
| DELETE | /webhook | Turn off notifications and delete the URL |
What a message contains
| code | The verification code if found next to words like "code" or "verification"; otherwise null |
| text | Message text. For HTML-only emails the text is built from the HTML without styles |
| html | The original HTML (render it only inside a sandboxed frame) |
| links | Links from the message, up to 50 |
Custom domain
- Add a domain with POST /custom-domains. The response contains two DNS records.
- At your registrar, create the TXT record with the verification code and an MX record pointing to mail.urusmail.pro.
- Call /verify. Once both records are found, the domain appears in GET /domains and you can create inboxes on it.
- With catch_all, an email to any address on the domain creates an inbox by itself, if your plan allows.
New message notifications (webhook)
Set your program's URL in the account page (API tab) or with PUT /webhook. On every new message in any inbox of the account we send a POST request with JSON to this URL, so your program doesn't have to keep asking the API for new mail.
The URL must start with https:// and be reachable from the internet. Answer with a 2xx code within 5 seconds. Redirects (3xx) are not followed and count as a failure.
If a delivery fails, we retry after 30 seconds and after 2 minutes, up to 3 attempts in total. After 100 failed deliveries in a row notifications are turned off; save the URL again to turn them back on.
A notification contains the confirmation code and a preview. Get the full text, HTML and links with GET /inboxes/{inbox.id}/messages/{message.id}.
Notifications don't replace the API: if your program was unavailable, fetch missed messages with GET /messages and the since_id parameter.
| X-UrusMail-Event | Event type: message.received (new message) or test |
| X-UrusMail-Timestamp | Send time, Unix seconds |
| X-UrusMail-Signature | sha256= followed by HMAC-SHA256 of the string "timestamp.request body", keyed with your whsec_… secret |
Request body:
{
"id": "evt_3f9c2a71d0b84e5a9c1f2e7d",
"event": "message.received",
"created_at": "2026-10-05T15:20:52.104Z",
"inbox": { "id": 123, "email": "shop.test@urusmail.pro" },
"message": {
"id": 456,
"from": "noreply@example.com",
"from_name": "Example",
"subject": "Your confirmation code",
"received_at": "2026-10-05T15:20:51.743Z",
"code": "482910",
"preview": "Hello! Your confirmation code: 482910"
}
}Signature check (Node.js). Reject requests with a wrong signature or a timestamp older than 5 minutes:
import crypto from "node:crypto";
import express from "express";
const app = express();
const SECRET = process.env.URUSMAIL_WEBHOOK_SECRET; // whsec_...
// the signature covers the raw body — do not parse JSON before checking it
app.post("/urusmail-webhook", express.raw({ type: "application/json" }), (req, res) => {
const ts = req.get("X-UrusMail-Timestamp");
const sig = req.get("X-UrusMail-Signature") || "";
const expected = "sha256=" + crypto.createHmac("sha256", SECRET).update(ts + "." + req.body).digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
if (!fresh || sig.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
return res.sendStatus(401);
}
const event = JSON.parse(req.body);
if (event.event === "message.received") console.log(event.inbox.email, event.message.code);
res.sendStatus(200); // answer fast, do slow work after responding
});
app.listen(3000);Errors and limits
| 401 | Missing or invalid key |
| 403 | The key is disabled or expired |
| 404 | Inbox, message or domain not found (or not yours) |
| 409 | Plan limit reached or the address is taken |
| 429 | Per-minute request limit exceeded. Retry later (Retry-After header) |
Errors always have the same shape:
{ "error": { "code": "inbox_limit", "message": "Inbox limit reached (10). Delete an inbox or upgrade the plan" } }At most three requests per key can wait for a message at the same time. An inbox keeps the last 200 messages. Message lists are short by default: id, from, from_name, subject, received_at, is_read, code and preview (up to 160 characters). The full text, HTML and links come from the single-message request. If you need them right in the list, turn on "Full message text in lists" on the API tab of your account (or PATCH /me with full_messages_in_list: true) — lists then return at most 25 messages per request, and full=0 in a list request returns the short form. To fetch only new messages, pass since_id — the id of the last message you received.
