-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
273 lines (273 loc) · 9.53 KB
/
Copy pathopenapi.json
File metadata and controls
273 lines (273 loc) · 9.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
{
"openapi": "3.1.0",
"info": {
"title": "ZeroDrop API",
"version": "1.0.0",
"description": "Disposable email inboxes for CI pipelines. No signup. No Docker. No SMTP config.\n\nBase URL: `https://zerodrop.dev`\n\nThe ZeroDrop API is a REST API that allows you to fetch emails from disposable inboxes. Inboxes are generated client-side — no API call needed to create one. Emails are stored for 30 minutes then automatically deleted.\n\nFor most use cases, use the [zerodrop-client SDK](https://npmjs.com/package/zerodrop-client) which handles polling, SSE, and OTP extraction automatically.",
"contact": {
"email": "support@zerodrop.dev",
"url": "https://zerodrop.dev/contact"
},
"license": {
"name": "MIT",
"url": "https://github.com/zerodrop-dev/zerodrop-sdk/blob/master/LICENSE"
}
},
"servers": [
{
"url": "https://zerodrop.dev",
"description": "Production"
}
],
"paths": {
"/api/inbox/{name}": {
"get": {
"summary": "Fetch emails for an inbox",
"description": "Returns all emails currently stored for the given inbox name. Emails expire after 30 minutes. Returns an empty array if the inbox has no emails or has expired.",
"operationId": "getInbox",
"tags": ["Inbox"],
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"description": "The inbox name (without the domain). Example: `swift-x7k2m` for `swift-x7k2m@zerodrop-sandbox.online`",
"schema": {
"type": "string",
"example": "swift-x7k2m"
}
},
{
"name": "source",
"in": "query",
"required": false,
"description": "Identifies the client making the request. Use `sdk` for programmatic access.",
"schema": {
"type": "string",
"enum": ["browser", "sdk"],
"default": "browser"
}
}
],
"responses": {
"200": {
"description": "Emails fetched successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InboxResponse"
},
"example": {
"emails": [
{
"id": "<CALMkwzNSLxzko58@mail.gmail.com>",
"from": "noreply@yourapp.com",
"to": "swift-x7k2m@zerodrop-sandbox.online",
"subject": "Verify your email",
"body": "Click here to verify your email: https://yourapp.com/verify?token=abc123",
"rawBody": "...",
"receivedAt": "2026-06-17T10:23:30.356Z",
"otp": null,
"magicLink": "https://yourapp.com/verify?token=abc123"
}
],
"count": 1
}
}
}
},
"429": {
"description": "Rate limit exceeded. Free tier allows 20 requests per 10 seconds per IP.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"error": "Too many requests. Slow down."
}
}
}
}
}
}
},
"/api/inbox/{name}/stream": {
"get": {
"summary": "Stream emails via SSE",
"description": "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).\n\n**Backoff strategy:**\n- 0–2s: polls every 500ms\n- 2–10s: polls every 1000ms\n- 10s+: polls every 2000ms\n\n**Events:**\n- `: connected` — connection established\n- `: keepalive` — heartbeat every 10s to prevent proxy timeout\n- `data: {email JSON}` — email arrived\n- `data: __timeout__` — no email within 30s, connection closing\n\nFor Node.js environments, use `fetch()` with `ReadableStream` rather than `EventSource` (which is browser-only).",
"operationId": "streamInbox",
"tags": ["Inbox"],
"parameters": [
{
"name": "name",
"in": "path",
"required": true,
"description": "The inbox name (without the domain).",
"schema": {
"type": "string",
"example": "swift-x7k2m"
}
}
],
"responses": {
"200": {
"description": "SSE stream opened successfully",
"content": {
"text/event-stream": {
"schema": {
"type": "string",
"description": "Server-Sent Events stream. Each event is separated by double newlines.",
"example": ": connected\n\n: keepalive\n\ndata: {\"id\":\"...\",\"from\":\"...\",\"subject\":\"...\"}\n\n"
}
}
}
}
}
}
},
"/api/waitlist": {
"post": {
"summary": "Join the Workspaces waitlist",
"description": "Adds an email address to the Workspaces waitlist. You will be contacted when Workspaces launches.",
"operationId": "joinWaitlist",
"tags": ["Waitlist"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["email"],
"properties": {
"email": {
"type": "string",
"format": "email",
"example": "developer@yourcompany.com"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully added to waitlist",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Email": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique message ID from the email headers (Message-ID).",
"example": "<CALMkwzNSLxzko58@mail.gmail.com>"
},
"from": {
"type": "string",
"description": "Sender email address.",
"example": "noreply@yourapp.com"
},
"to": {
"type": "string",
"description": "Recipient email address (the disposable inbox).",
"example": "swift-x7k2m@zerodrop-sandbox.online"
},
"subject": {
"type": "string",
"description": "Email subject line.",
"example": "Verify your email"
},
"body": {
"type": "string",
"description": "Parsed plain-text body (first 5000 characters).",
"example": "Click here to verify: https://yourapp.com/verify?token=abc123"
},
"rawBody": {
"type": "string",
"description": "Full raw MIME message."
},
"receivedAt": {
"type": "string",
"format": "date-time",
"description": "UTC timestamp when the email was received.",
"example": "2026-06-17T10:23:30.356Z"
},
"otp": {
"type": "string",
"nullable": true,
"description": "Auto-extracted OTP code (4-8 digits). Extracted at the edge before the email is stored. null if not detected.",
"example": "123456"
},
"magicLink": {
"type": "string",
"nullable": true,
"description": "Auto-extracted verification or reset URL. Detected for URLs containing verify, confirm, reset, token, activate, or auth. null if not detected.",
"example": "https://yourapp.com/verify?token=abc123"
}
}
},
"InboxResponse": {
"type": "object",
"properties": {
"emails": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Email"
},
"description": "Array of emails, sorted by most recent first."
},
"count": {
"type": "integer",
"description": "Total number of emails in the inbox.",
"example": 1
}
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Too many requests. Slow down."
}
}
}
},
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "API key for Workspaces tier. Free tier does not require authentication."
}
}
},
"tags": [
{
"name": "Inbox",
"description": "Fetch and stream emails from disposable inboxes."
},
{
"name": "Waitlist",
"description": "Join the Workspaces waitlist."
}
]
}