Stream emails via SSE
Inbox
Stream emails via SSE
Opens a Server-Sent Events stream for the given inbox. The server polls Redis with an exponential backoff strategy and pushes an event the moment an email arrives. The connection closes automatically after the first email or after 30 seconds (timeout).
Backoff strategy:
- 0–2s: polls every 500ms
- 2–10s: polls every 1000ms
- 10s+: polls every 2000ms
Events:
: connected— connection established: keepalive— heartbeat every 10s to prevent proxy timeoutdata: {email JSON}— email arriveddata: __timeout__— no email within 30s, connection closing
For Node.js environments, use fetch() with ReadableStream rather than EventSource (which is browser-only).
GET
Stream emails via SSE
Path Parameters
The inbox name (without the domain).
Example:
"swift-x7k2m"
Response
200 - text/event-stream
SSE stream opened successfully
Server-Sent Events stream. Each event is separated by double newlines.
Example:
": connected\n\n: keepalive\n\ndata: {\"id\":\"...\",\"from\":\"...\",\"subject\":\"...\"}\n\n"