Mailwurf

Inboxes

Temporary inboxes for tests, permanent addresses for everything else.

An inbox is an address on the Mailwurf mail domain (mail.mailwurf.io), or on a custom domain of your organization. It belongs to one organization. Every API key of that organization can read it; keys of other organizations get 404.

Two kinds

TemporaryPermanent
Created byAPI key, POST /v1/inboxesDashboard, owners and admins
AddressGenerated, e.g. inbox_k3f9x2…@mail.mailwurf.ioYou choose the name and domain
Lifetime1 hourUntil deleted in the dashboard
Message lifetimeUntil the inbox expiresUntil the address is deleted
Delete via APIYes, 204No, 403
Per organizationNo limit5

Use temporary inboxes in tests. Each call returns a fresh address nobody else knows, so parallel runs and retries never read each other's mail.

Use permanent addresses when an address has to be configured ahead of time, for example a seeded test user or a staging account that receives reports. See Permanent addresses.

Temporary inboxes

const inbox = await mailwurf.createInbox();

inbox.id; // "inbox_K3f9x2Ab7QzLp0Wd"
inbox.address; // "inbox_k3f9x2ab7qzlp0wd@mail.mailwurf.io"
inbox.expiresAt; // one hour from now

The address is the lowercased id. Always use inbox.id for API calls and inbox.address for the recipient; do not derive one from the other.

Custom temporary addresses are not supported. Sending an address returns 400. Temporary inboxes always use the Mailwurf mail domain.

Inboxes can also send mail. See Sending.

Expiry

A temporary inbox stops working one hour after it was created:

  • Mail to the address is rejected with 550.
  • Reading the inbox, its messages, or waiting on it returns 404.

Create the inbox inside the test, right before the step that sends mail. Do not create inboxes in a global setup that runs long before the tests.

Deleting

await inbox.delete();

Deleting is optional; expiry cleans up on its own. Delete when a test must be sure no further mail can arrive, for example before asserting that something was not sent twice.

Permanent addresses can only be deleted in the dashboard.

On this page