Stream emails via SSE
curl --request GET \
--url https://zerodrop.dev/api/inbox/{name}/streamimport requests
url = "https://zerodrop.dev/api/inbox/{name}/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://zerodrop.dev/api/inbox/{name}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://zerodrop.dev/api/inbox/{name}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://zerodrop.dev/api/inbox/{name}/stream"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://zerodrop.dev/api/inbox/{name}/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://zerodrop.dev/api/inbox/{name}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body": connected\n\n: keepalive\n\ndata: {\"id\":\"...\",\"from\":\"...\",\"subject\":\"...\"}\n\n"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
/
api
/
inbox
/
{name}
/
stream
Stream emails via SSE
curl --request GET \
--url https://zerodrop.dev/api/inbox/{name}/streamimport requests
url = "https://zerodrop.dev/api/inbox/{name}/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://zerodrop.dev/api/inbox/{name}/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://zerodrop.dev/api/inbox/{name}/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://zerodrop.dev/api/inbox/{name}/stream"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://zerodrop.dev/api/inbox/{name}/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://zerodrop.dev/api/inbox/{name}/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body": connected\n\n: keepalive\n\ndata: {\"id\":\"...\",\"from\":\"...\",\"subject\":\"...\"}\n\n"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"