curl --request GET \
--url https://zerodrop.dev/api/inbox/{name}/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://zerodrop.dev/api/inbox/{name}/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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)
req.Header.Add("Authorization", "Bearer <token>")
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")
.header("Authorization", "Bearer <token>")
.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)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body: connected
: keepalive
data: {"id":"...","from":"...","subject":"..."}
{
"error": "Inboxes named k7x2-… belong to a ZeroDrop account and can be read only with its API key (Authorization: Bearer zd_k7x2_…). Without that key, use a name that doesn't start with k7x2-."
}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 when it finds an email. 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).
curl --request GET \
--url https://zerodrop.dev/api/inbox/{name}/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://zerodrop.dev/api/inbox/{name}/stream"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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)
req.Header.Add("Authorization", "Bearer <token>")
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")
.header("Authorization", "Bearer <token>")
.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)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body: connected
: keepalive
data: {"id":"...","from":"...","subject":"..."}
{
"error": "Inboxes named k7x2-… belong to a ZeroDrop account and can be read only with its API key (Authorization: Bearer zd_k7x2_…). Without that key, use a name that doesn't start with k7x2-."
}Authorizations
Free API key from https://zerodrop.dev/keys, in the form zd_<prefix>_<32 letters and digits>. Needed only to read inboxes whose name starts with the key's prefix (k7x2-…); other inboxes need no authentication.
Path Parameters
The inbox name (without the domain). Names that start with a registered key prefix (k7x2-…) can be read only with that key.
"swift-x7k2m"
Response
SSE stream opened successfully
Server-Sent Events stream. Each event is separated by double newlines.
": connected\n\n: keepalive\n\ndata: {\"id\":\"...\",\"from\":\"...\",\"subject\":\"...\"}\n\n"