Once an inbox exists, every message sent to that address is stored and queryable through the MailSlurp API. This guide focuses on receive-side patterns that work in application backends and CI tests.
Receive strategies
Choose the strategy by workload:
- Dashboard viewing: useful for manual QA and support triage.
APIs: best for deterministic automated tests.- Webhooks: best for event-driven applications and higher throughput.
Fetching known emails
If you already have an email ID, fetch the full payload directly:
This is useful when your prior step already produced the ID (for example from a list query or webhook event).
WaitFor APIs (recommended for tests)
endpoints hold the request until conditions are met. They reduce flaky polling loops and make assertions predictable.
Wait for latest email
Wait for target count
Wait for matching emails
Wait for nth email
Listing emails in an inbox
Use list methods to inspect current state or backfill history:
List endpoints return previews. Fetch full content with when you need body, headers, or attachment IDs.
Webhook-driven receiving
Webhooks are ideal when your system should react immediately to inbound mail without long polling:
- Configure a webhook target on the inbox.
- Receive HTTP POST events when messages arrive.
- Process idempotently (retries are normal in distributed systems).
See webhook guide and webhook testing.
Attachments
Attachments are stored separately from message previews. Retrieve metadata and content via attachment endpoints.
Reliable receive-side test pattern
- Create a fresh inbox at test start.
- Trigger app behavior that sends an email.
- Wait for matching message criteria.
- Fetch full message.
- Assert links, codes, and payload structure.
- Cleanup inbox resources.
For end-to-end examples, see Cypress testing guide and Playwright OTP testing.

