Skip to content

Inboxes and their domains

An inbox receives mail for your tests. Each one has a domain of its own under waridex.email, and every address under that domain reaches it: the inbox is a catch-all. A suite therefore creates one inbox for a test run and lets every test invent its own recipient.

Terminal window
curl -sS https://api.waridex.com/v1/inboxes \
-H "Authorization: Bearer $WARIDEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "signup", "tags": ["run-42"], "expiresInSeconds": 3600}'

POST /v1/inboxes needs the inbox:create scope and takes:

  • name, required: 1 to 100 characters, shown on the dashboard. Names need not be unique.
  • tags, optional: up to ten labels, typically the test run. See tags and the per-run purge.
  • expiresInSeconds, optional: from one second to one year. When it passes, the inbox stops receiving mail and is deleted with its messages within the hour. Without it the inbox lives until you delete it; its messages still go when the plan’s retention runs out.

You never choose the address. The API makes the inbox’s slug from the name (accents removed, lower case, every run of other characters one hyphen, at most 47 characters) plus a hyphen and six random characters, and answers with it:

FieldExampleMeaning
slugsignup-k3f9x2the name’s base and a random suffix
domainsignup-k3f9x2.waridex.emailthe inbox’s own domain; any address under it reaches the inbox
addresssignup@signup-k3f9x2.waridex.emaila ready-made default recipient
catchAlltrueevery local part under domain is delivered

A domain is never issued twice, not even after its inbox is deleted, so mail meant for an old inbox can never land in a new one.

Any local part under the inbox’s domain is delivered, plus signs and all: user1@signup-k3f9x2.waridex.email, reset+42@signup-k3f9x2.waridex.email and anything@signup-k3f9x2.waridex.email all land in the same inbox. Every message records the exact recipient in envelopeTo, and the to filter of wait and of the message list matches it exactly, ignoring case.

Anything else is refused while the sender is still connected, so it bounces rather than disappearing: an address under an unknown, deleted or expired inbox’s domain, the bare waridex.email, and a deeper name such as user@x.signup-k3f9x2.waridex.email. A message may be at most 10 MB and have at most 20 recipients, and a workspace takes at most 300 recipients a minute, each address a message is delivered to counting as one; its plan’s monthly quota applies too.

A test can also put a message in an inbox over HTTPS, without sending any mail, which is useful where a network blocks port 25 or a fixture needs a message captured from real mail: see message injection.

CallScopeReturns
GET /v1/inboxesemail:readthe workspace’s inboxes, newest first; tag, q (name or domain contains) and paging with limit and offset
GET /v1/inboxes/{id}email:readone inbox
GET /v1/inboxes/{id}/messagesemail:readan inbox’s messages, newest first; filters since, subjectContains, from, to
GET /v1/messagesemail:readevery message of the workspace, newest first; filters inbox, tag, to, since, subjectContains, from
GET /v1/messages/searchemail:readmessages whose subject or sender contains q; filters inbox, tag, to, since
GET /v1/messages/{id}email:reada message with its text and HTML bodies, codes, links and attachment list
GET /v1/messages/{id}/rawemail:readthe message exactly as received
GET /v1/messages/{id}/attachments/{partIndex}email:readone attachment
POST /v1/inboxes/{id}/messagesemail:injectstores a raw message in the inbox as if it had arrived; see message injection
DELETE /v1/messages/{id}email:deletedeletes a message
DELETE /v1/inboxes/{id}inbox:deletedeletes an inbox and its messages

Most tests need none of these: wait returns the message they are waiting for.