@primitivedotdev/sdk 0.2.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -2
- package/bin/run.js +5 -0
- package/dist/api/generated/client/client.gen.js +235 -0
- package/dist/api/generated/client/index.js +6 -0
- package/dist/api/generated/client/types.gen.js +2 -0
- package/dist/api/generated/client/utils.gen.js +228 -0
- package/dist/api/generated/client.gen.js +3 -0
- package/dist/api/generated/core/auth.gen.js +14 -0
- package/dist/api/generated/core/bodySerializer.gen.js +57 -0
- package/dist/api/generated/core/params.gen.js +100 -0
- package/dist/api/generated/core/pathSerializer.gen.js +106 -0
- package/dist/api/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/api/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/api/generated/core/types.gen.js +2 -0
- package/dist/api/generated/core/utils.gen.js +87 -0
- package/dist/api/generated/index.js +2 -0
- package/dist/api/generated/sdk.gen.js +347 -0
- package/dist/api/generated/types.gen.js +2 -0
- package/dist/api/index.d.ts +1877 -0
- package/dist/api/index.js +39 -0
- package/dist/chunk-Cl8Af3a2.js +11 -0
- package/dist/contract/index.d.ts +3 -3
- package/dist/contract/index.js +2 -2
- package/dist/{index-BdRIHaXz.d.ts → index-D2OuDGVz.d.ts} +81 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/oclif/api-command.js +218 -0
- package/dist/oclif/fish-completion.js +87 -0
- package/dist/oclif/index.js +42 -0
- package/dist/openapi/index.d.ts +42 -0
- package/dist/openapi/index.js +8 -0
- package/dist/openapi/openapi.generated.js +2715 -0
- package/dist/openapi/operations.generated.js +671 -0
- package/dist/parser/index.d.ts +1 -1
- package/dist/parser/index.js +40 -25
- package/dist/{types-B5IgP-Zx.d.ts → types-C3ms4R0d.d.ts} +4 -0
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-Be2vM0F-.js → webhook-uSco6pyX.js} +176 -11
- package/oclif.manifest.json +1267 -0
- package/package.json +81 -13
|
@@ -0,0 +1,2715 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI document for the Primitive API.
|
|
3
|
+
*
|
|
4
|
+
* AUTO-GENERATED - DO NOT EDIT
|
|
5
|
+
* Run `pnpm generate:openapi` to regenerate.
|
|
6
|
+
*/
|
|
7
|
+
export const openapiDocument = {
|
|
8
|
+
"openapi": "3.1.0",
|
|
9
|
+
"info": {
|
|
10
|
+
"title": "Primitive API",
|
|
11
|
+
"version": "1.0.0",
|
|
12
|
+
"description": "The Primitive API lets you manage domains, emails, webhook endpoints,\nfilters, and account settings programmatically.\n\n## Authentication\n\nAll endpoints require a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer prim_<your_api_key>\n```\n\nAPI keys are org-scoped. Create and manage them in your dashboard\nunder Settings > API Keys.\n\n## Rate Limiting\n\nThe API enforces a sliding window rate limit of **120 requests per\n60 seconds** per organization. When exceeded, the API returns `429`\nwith a `Retry-After` header indicating how many seconds to wait.\n\n## Pagination\n\nList endpoints use cursor-based pagination. Responses include a\n`meta` object with `total`, `limit`, and `cursor` fields. Pass the\n`cursor` value as a query parameter to fetch the next page. When\n`cursor` is `null`, there are no more results.\n\n## Response Format\n\nAll responses use a consistent envelope:\n\n```json\n{\n \"success\": true,\n \"data\": { ... },\n \"meta\": { \"total\": 42, \"limit\": 50, \"cursor\": \"...\" }\n}\n```\n\nErrors follow the same pattern:\n\n```json\n{\n \"success\": false,\n \"error\": { \"code\": \"not_found\", \"message\": \"Email not found\" }\n}\n```\n",
|
|
13
|
+
"contact": {
|
|
14
|
+
"name": "Primitive",
|
|
15
|
+
"url": "https://primitive.dev"
|
|
16
|
+
},
|
|
17
|
+
"license": {
|
|
18
|
+
"name": "Proprietary",
|
|
19
|
+
"url": "https://primitive.dev/terms"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"servers": [
|
|
23
|
+
{
|
|
24
|
+
"url": "https://www.primitive.dev/api/v1",
|
|
25
|
+
"description": "Production"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"security": [
|
|
29
|
+
{
|
|
30
|
+
"BearerAuth": []
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"tags": [
|
|
34
|
+
{
|
|
35
|
+
"name": "Account",
|
|
36
|
+
"description": "Manage your account settings, storage, and webhook secret"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Domains",
|
|
40
|
+
"description": "Claim, verify, and manage email domains"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "Emails",
|
|
44
|
+
"description": "List, inspect, and manage received emails"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "Endpoints",
|
|
48
|
+
"description": "Manage webhook endpoints that receive email events"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "Filters",
|
|
52
|
+
"description": "Manage whitelist and blocklist filter rules"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "Webhook Deliveries",
|
|
56
|
+
"description": "View and replay webhook delivery attempts"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"paths": {
|
|
60
|
+
"/account": {
|
|
61
|
+
"get": {
|
|
62
|
+
"operationId": "getAccount",
|
|
63
|
+
"summary": "Get account info",
|
|
64
|
+
"tags": [
|
|
65
|
+
"Account"
|
|
66
|
+
],
|
|
67
|
+
"responses": {
|
|
68
|
+
"200": {
|
|
69
|
+
"description": "Account details",
|
|
70
|
+
"content": {
|
|
71
|
+
"application/json": {
|
|
72
|
+
"schema": {
|
|
73
|
+
"allOf": [
|
|
74
|
+
{
|
|
75
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"type": "object",
|
|
79
|
+
"properties": {
|
|
80
|
+
"data": {
|
|
81
|
+
"$ref": "#/components/schemas/Account"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"401": {
|
|
91
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
92
|
+
},
|
|
93
|
+
"404": {
|
|
94
|
+
"$ref": "#/components/responses/NotFound"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"patch": {
|
|
99
|
+
"operationId": "updateAccount",
|
|
100
|
+
"summary": "Update account settings",
|
|
101
|
+
"tags": [
|
|
102
|
+
"Account"
|
|
103
|
+
],
|
|
104
|
+
"requestBody": {
|
|
105
|
+
"required": true,
|
|
106
|
+
"content": {
|
|
107
|
+
"application/json": {
|
|
108
|
+
"schema": {
|
|
109
|
+
"$ref": "#/components/schemas/UpdateAccountInput"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"responses": {
|
|
115
|
+
"200": {
|
|
116
|
+
"description": "Updated account",
|
|
117
|
+
"content": {
|
|
118
|
+
"application/json": {
|
|
119
|
+
"schema": {
|
|
120
|
+
"allOf": [
|
|
121
|
+
{
|
|
122
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"data": {
|
|
128
|
+
"$ref": "#/components/schemas/AccountUpdated"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"400": {
|
|
138
|
+
"$ref": "#/components/responses/ValidationError"
|
|
139
|
+
},
|
|
140
|
+
"401": {
|
|
141
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
142
|
+
},
|
|
143
|
+
"404": {
|
|
144
|
+
"$ref": "#/components/responses/NotFound"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"/account/storage": {
|
|
150
|
+
"get": {
|
|
151
|
+
"operationId": "getStorageStats",
|
|
152
|
+
"summary": "Get storage usage",
|
|
153
|
+
"tags": [
|
|
154
|
+
"Account"
|
|
155
|
+
],
|
|
156
|
+
"responses": {
|
|
157
|
+
"200": {
|
|
158
|
+
"description": "Storage statistics",
|
|
159
|
+
"content": {
|
|
160
|
+
"application/json": {
|
|
161
|
+
"schema": {
|
|
162
|
+
"allOf": [
|
|
163
|
+
{
|
|
164
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"type": "object",
|
|
168
|
+
"properties": {
|
|
169
|
+
"data": {
|
|
170
|
+
"$ref": "#/components/schemas/StorageStats"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"401": {
|
|
180
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
181
|
+
},
|
|
182
|
+
"404": {
|
|
183
|
+
"$ref": "#/components/responses/NotFound"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"/account/webhook-secret": {
|
|
189
|
+
"get": {
|
|
190
|
+
"operationId": "getWebhookSecret",
|
|
191
|
+
"summary": "Get webhook signing secret",
|
|
192
|
+
"description": "Returns the webhook signing secret for your account. If no secret\nexists yet, one is generated automatically on first access.\n",
|
|
193
|
+
"tags": [
|
|
194
|
+
"Account"
|
|
195
|
+
],
|
|
196
|
+
"responses": {
|
|
197
|
+
"200": {
|
|
198
|
+
"description": "Webhook secret",
|
|
199
|
+
"content": {
|
|
200
|
+
"application/json": {
|
|
201
|
+
"schema": {
|
|
202
|
+
"allOf": [
|
|
203
|
+
{
|
|
204
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"type": "object",
|
|
208
|
+
"properties": {
|
|
209
|
+
"data": {
|
|
210
|
+
"$ref": "#/components/schemas/WebhookSecret"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"401": {
|
|
220
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
221
|
+
},
|
|
222
|
+
"404": {
|
|
223
|
+
"$ref": "#/components/responses/NotFound"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"/account/webhook-secret/rotate": {
|
|
229
|
+
"post": {
|
|
230
|
+
"operationId": "rotateWebhookSecret",
|
|
231
|
+
"summary": "Rotate webhook signing secret",
|
|
232
|
+
"description": "Generates a new webhook signing secret, replacing the current one.\nRate limited to once per 60 minutes.\n",
|
|
233
|
+
"tags": [
|
|
234
|
+
"Account"
|
|
235
|
+
],
|
|
236
|
+
"responses": {
|
|
237
|
+
"200": {
|
|
238
|
+
"description": "New webhook secret",
|
|
239
|
+
"content": {
|
|
240
|
+
"application/json": {
|
|
241
|
+
"schema": {
|
|
242
|
+
"allOf": [
|
|
243
|
+
{
|
|
244
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"data": {
|
|
250
|
+
"$ref": "#/components/schemas/WebhookSecret"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"400": {
|
|
260
|
+
"$ref": "#/components/responses/ValidationError"
|
|
261
|
+
},
|
|
262
|
+
"401": {
|
|
263
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
264
|
+
},
|
|
265
|
+
"404": {
|
|
266
|
+
"$ref": "#/components/responses/NotFound"
|
|
267
|
+
},
|
|
268
|
+
"429": {
|
|
269
|
+
"$ref": "#/components/responses/RateLimited"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"/domains": {
|
|
275
|
+
"get": {
|
|
276
|
+
"operationId": "listDomains",
|
|
277
|
+
"summary": "List all domains",
|
|
278
|
+
"description": "Returns all verified and unverified domains for your organization,\nsorted by creation date (newest first). Each domain includes a\n`verified` boolean to distinguish between the two states.\n",
|
|
279
|
+
"tags": [
|
|
280
|
+
"Domains"
|
|
281
|
+
],
|
|
282
|
+
"responses": {
|
|
283
|
+
"200": {
|
|
284
|
+
"description": "List of domains",
|
|
285
|
+
"content": {
|
|
286
|
+
"application/json": {
|
|
287
|
+
"schema": {
|
|
288
|
+
"allOf": [
|
|
289
|
+
{
|
|
290
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"type": "object",
|
|
294
|
+
"properties": {
|
|
295
|
+
"data": {
|
|
296
|
+
"type": "array",
|
|
297
|
+
"items": {
|
|
298
|
+
"$ref": "#/components/schemas/Domain"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"401": {
|
|
309
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"post": {
|
|
314
|
+
"operationId": "addDomain",
|
|
315
|
+
"summary": "Claim a new domain",
|
|
316
|
+
"description": "Creates an unverified domain claim. You will receive a\n`verification_token` to add as a DNS TXT record before\ncalling the verify endpoint.\n",
|
|
317
|
+
"tags": [
|
|
318
|
+
"Domains"
|
|
319
|
+
],
|
|
320
|
+
"requestBody": {
|
|
321
|
+
"required": true,
|
|
322
|
+
"content": {
|
|
323
|
+
"application/json": {
|
|
324
|
+
"schema": {
|
|
325
|
+
"$ref": "#/components/schemas/AddDomainInput"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"responses": {
|
|
331
|
+
"201": {
|
|
332
|
+
"description": "Domain claim created",
|
|
333
|
+
"content": {
|
|
334
|
+
"application/json": {
|
|
335
|
+
"schema": {
|
|
336
|
+
"allOf": [
|
|
337
|
+
{
|
|
338
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"type": "object",
|
|
342
|
+
"properties": {
|
|
343
|
+
"data": {
|
|
344
|
+
"$ref": "#/components/schemas/UnverifiedDomain"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"400": {
|
|
354
|
+
"$ref": "#/components/responses/ValidationError"
|
|
355
|
+
},
|
|
356
|
+
"401": {
|
|
357
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
358
|
+
},
|
|
359
|
+
"409": {
|
|
360
|
+
"description": "Domain claim conflicts with existing state. Two error codes\nare possible:\n * `mx_conflict`: the domain's current MX records point at\n another mailbox provider. The response includes\n `error.details.mx_conflict` with the detected provider\n and a suggested subdomain.\n * `conflict`: the domain is already claimed by another\n org, or a pending claim exists for another user.\n",
|
|
361
|
+
"content": {
|
|
362
|
+
"application/json": {
|
|
363
|
+
"schema": {
|
|
364
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
365
|
+
},
|
|
366
|
+
"examples": {
|
|
367
|
+
"mx_conflict": {
|
|
368
|
+
"summary": "Domain has MX records on another provider",
|
|
369
|
+
"value": {
|
|
370
|
+
"success": false,
|
|
371
|
+
"error": {
|
|
372
|
+
"code": "mx_conflict",
|
|
373
|
+
"message": "Domain is currently receiving mail via another provider",
|
|
374
|
+
"details": {
|
|
375
|
+
"mx_conflict": {
|
|
376
|
+
"provider_name": "Google Workspace",
|
|
377
|
+
"suggested_subdomain": "mail"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"already_claimed": {
|
|
384
|
+
"summary": "Domain already claimed by another org",
|
|
385
|
+
"value": {
|
|
386
|
+
"success": false,
|
|
387
|
+
"error": {
|
|
388
|
+
"code": "conflict",
|
|
389
|
+
"message": "Domain is already claimed by another organization"
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"/domains/{id}": {
|
|
401
|
+
"parameters": [
|
|
402
|
+
{
|
|
403
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"patch": {
|
|
407
|
+
"operationId": "updateDomain",
|
|
408
|
+
"summary": "Update domain settings",
|
|
409
|
+
"description": "Update a verified domain's settings. Only verified domains can be\nupdated. Per-domain spam thresholds require a Pro plan.\n",
|
|
410
|
+
"tags": [
|
|
411
|
+
"Domains"
|
|
412
|
+
],
|
|
413
|
+
"requestBody": {
|
|
414
|
+
"required": true,
|
|
415
|
+
"content": {
|
|
416
|
+
"application/json": {
|
|
417
|
+
"schema": {
|
|
418
|
+
"$ref": "#/components/schemas/UpdateDomainInput"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
"responses": {
|
|
424
|
+
"200": {
|
|
425
|
+
"description": "Updated domain",
|
|
426
|
+
"content": {
|
|
427
|
+
"application/json": {
|
|
428
|
+
"schema": {
|
|
429
|
+
"allOf": [
|
|
430
|
+
{
|
|
431
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "object",
|
|
435
|
+
"properties": {
|
|
436
|
+
"data": {
|
|
437
|
+
"$ref": "#/components/schemas/VerifiedDomain"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
"400": {
|
|
447
|
+
"$ref": "#/components/responses/ValidationError"
|
|
448
|
+
},
|
|
449
|
+
"401": {
|
|
450
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
451
|
+
},
|
|
452
|
+
"404": {
|
|
453
|
+
"$ref": "#/components/responses/NotFound"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"delete": {
|
|
458
|
+
"operationId": "deleteDomain",
|
|
459
|
+
"summary": "Delete a domain",
|
|
460
|
+
"description": "Deletes a verified or unverified domain claim.",
|
|
461
|
+
"tags": [
|
|
462
|
+
"Domains"
|
|
463
|
+
],
|
|
464
|
+
"responses": {
|
|
465
|
+
"200": {
|
|
466
|
+
"$ref": "#/components/responses/Deleted"
|
|
467
|
+
},
|
|
468
|
+
"400": {
|
|
469
|
+
"$ref": "#/components/responses/ValidationError"
|
|
470
|
+
},
|
|
471
|
+
"401": {
|
|
472
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
473
|
+
},
|
|
474
|
+
"404": {
|
|
475
|
+
"$ref": "#/components/responses/NotFound"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"/domains/{id}/verify": {
|
|
481
|
+
"parameters": [
|
|
482
|
+
{
|
|
483
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
484
|
+
}
|
|
485
|
+
],
|
|
486
|
+
"post": {
|
|
487
|
+
"operationId": "verifyDomain",
|
|
488
|
+
"summary": "Verify domain ownership",
|
|
489
|
+
"description": "Checks DNS records (MX and TXT) to verify domain ownership.\nOn success, the domain is promoted from unverified to verified.\nOn failure, returns which checks passed and which failed.\n",
|
|
490
|
+
"tags": [
|
|
491
|
+
"Domains"
|
|
492
|
+
],
|
|
493
|
+
"responses": {
|
|
494
|
+
"200": {
|
|
495
|
+
"description": "Verification result",
|
|
496
|
+
"content": {
|
|
497
|
+
"application/json": {
|
|
498
|
+
"schema": {
|
|
499
|
+
"allOf": [
|
|
500
|
+
{
|
|
501
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"type": "object",
|
|
505
|
+
"properties": {
|
|
506
|
+
"data": {
|
|
507
|
+
"$ref": "#/components/schemas/DomainVerifyResult"
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"400": {
|
|
517
|
+
"$ref": "#/components/responses/ValidationError"
|
|
518
|
+
},
|
|
519
|
+
"401": {
|
|
520
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
521
|
+
},
|
|
522
|
+
"404": {
|
|
523
|
+
"$ref": "#/components/responses/NotFound"
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"/emails": {
|
|
529
|
+
"get": {
|
|
530
|
+
"operationId": "listEmails",
|
|
531
|
+
"summary": "List emails",
|
|
532
|
+
"description": "Returns a paginated list of received emails. Supports filtering by\ndomain, status, date range, and free-text search across subject,\nsender, and recipient fields.\n",
|
|
533
|
+
"tags": [
|
|
534
|
+
"Emails"
|
|
535
|
+
],
|
|
536
|
+
"parameters": [
|
|
537
|
+
{
|
|
538
|
+
"$ref": "#/components/parameters/Cursor"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"$ref": "#/components/parameters/Limit"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"name": "domain_id",
|
|
545
|
+
"in": "query",
|
|
546
|
+
"schema": {
|
|
547
|
+
"type": "string",
|
|
548
|
+
"format": "uuid"
|
|
549
|
+
},
|
|
550
|
+
"description": "Filter by domain ID"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "status",
|
|
554
|
+
"in": "query",
|
|
555
|
+
"schema": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"enum": [
|
|
558
|
+
"pending",
|
|
559
|
+
"accepted",
|
|
560
|
+
"completed",
|
|
561
|
+
"rejected"
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
"description": "Filter by email status"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"name": "search",
|
|
568
|
+
"in": "query",
|
|
569
|
+
"schema": {
|
|
570
|
+
"type": "string",
|
|
571
|
+
"maxLength": 500
|
|
572
|
+
},
|
|
573
|
+
"description": "Search subject, sender, and recipient (case-insensitive)"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"name": "date_from",
|
|
577
|
+
"in": "query",
|
|
578
|
+
"schema": {
|
|
579
|
+
"type": "string",
|
|
580
|
+
"format": "date-time"
|
|
581
|
+
},
|
|
582
|
+
"description": "Filter emails created on or after this timestamp"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"name": "date_to",
|
|
586
|
+
"in": "query",
|
|
587
|
+
"schema": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"format": "date-time"
|
|
590
|
+
},
|
|
591
|
+
"description": "Filter emails created on or before this timestamp"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
"responses": {
|
|
595
|
+
"200": {
|
|
596
|
+
"description": "Paginated list of emails",
|
|
597
|
+
"content": {
|
|
598
|
+
"application/json": {
|
|
599
|
+
"schema": {
|
|
600
|
+
"allOf": [
|
|
601
|
+
{
|
|
602
|
+
"$ref": "#/components/schemas/ListEnvelope"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"type": "object",
|
|
606
|
+
"properties": {
|
|
607
|
+
"data": {
|
|
608
|
+
"type": "array",
|
|
609
|
+
"items": {
|
|
610
|
+
"$ref": "#/components/schemas/EmailSummary"
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
"400": {
|
|
621
|
+
"$ref": "#/components/responses/ValidationError"
|
|
622
|
+
},
|
|
623
|
+
"401": {
|
|
624
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
"/emails/{id}": {
|
|
630
|
+
"parameters": [
|
|
631
|
+
{
|
|
632
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
"get": {
|
|
636
|
+
"operationId": "getEmail",
|
|
637
|
+
"summary": "Get email details",
|
|
638
|
+
"tags": [
|
|
639
|
+
"Emails"
|
|
640
|
+
],
|
|
641
|
+
"responses": {
|
|
642
|
+
"200": {
|
|
643
|
+
"description": "Email details",
|
|
644
|
+
"content": {
|
|
645
|
+
"application/json": {
|
|
646
|
+
"schema": {
|
|
647
|
+
"allOf": [
|
|
648
|
+
{
|
|
649
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"type": "object",
|
|
653
|
+
"properties": {
|
|
654
|
+
"data": {
|
|
655
|
+
"$ref": "#/components/schemas/EmailDetail"
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"400": {
|
|
665
|
+
"$ref": "#/components/responses/ValidationError"
|
|
666
|
+
},
|
|
667
|
+
"401": {
|
|
668
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
669
|
+
},
|
|
670
|
+
"404": {
|
|
671
|
+
"$ref": "#/components/responses/NotFound"
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
"delete": {
|
|
676
|
+
"operationId": "deleteEmail",
|
|
677
|
+
"summary": "Delete an email",
|
|
678
|
+
"tags": [
|
|
679
|
+
"Emails"
|
|
680
|
+
],
|
|
681
|
+
"responses": {
|
|
682
|
+
"200": {
|
|
683
|
+
"$ref": "#/components/responses/Deleted"
|
|
684
|
+
},
|
|
685
|
+
"400": {
|
|
686
|
+
"$ref": "#/components/responses/ValidationError"
|
|
687
|
+
},
|
|
688
|
+
"401": {
|
|
689
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
690
|
+
},
|
|
691
|
+
"404": {
|
|
692
|
+
"$ref": "#/components/responses/NotFound"
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
"/emails/{id}/raw": {
|
|
698
|
+
"parameters": [
|
|
699
|
+
{
|
|
700
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
701
|
+
}
|
|
702
|
+
],
|
|
703
|
+
"get": {
|
|
704
|
+
"operationId": "downloadRawEmail",
|
|
705
|
+
"summary": "Download raw email",
|
|
706
|
+
"description": "Downloads the raw RFC 822 email file (.eml). Authenticates via\na signed download token (provided in webhook payloads) or a\nvalid session.\n",
|
|
707
|
+
"tags": [
|
|
708
|
+
"Emails"
|
|
709
|
+
],
|
|
710
|
+
"security": [
|
|
711
|
+
{
|
|
712
|
+
"BearerAuth": []
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"DownloadToken": []
|
|
716
|
+
}
|
|
717
|
+
],
|
|
718
|
+
"parameters": [
|
|
719
|
+
{
|
|
720
|
+
"name": "token",
|
|
721
|
+
"in": "query",
|
|
722
|
+
"schema": {
|
|
723
|
+
"type": "string"
|
|
724
|
+
},
|
|
725
|
+
"description": "Signed download token from webhook payload"
|
|
726
|
+
}
|
|
727
|
+
],
|
|
728
|
+
"responses": {
|
|
729
|
+
"200": {
|
|
730
|
+
"description": "Raw email file",
|
|
731
|
+
"content": {
|
|
732
|
+
"message/rfc822": {
|
|
733
|
+
"schema": {
|
|
734
|
+
"type": "string",
|
|
735
|
+
"format": "binary"
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
"headers": {
|
|
740
|
+
"Content-Disposition": {
|
|
741
|
+
"schema": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"example": "attachment; filename=\"email-id.eml\""
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"X-Content-SHA256": {
|
|
747
|
+
"schema": {
|
|
748
|
+
"type": "string"
|
|
749
|
+
},
|
|
750
|
+
"description": "SHA-256 hex digest of the file"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
"400": {
|
|
755
|
+
"$ref": "#/components/responses/ValidationError"
|
|
756
|
+
},
|
|
757
|
+
"401": {
|
|
758
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
759
|
+
},
|
|
760
|
+
"404": {
|
|
761
|
+
"$ref": "#/components/responses/NotFound"
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
"/emails/{id}/attachments.tar.gz": {
|
|
767
|
+
"parameters": [
|
|
768
|
+
{
|
|
769
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
770
|
+
}
|
|
771
|
+
],
|
|
772
|
+
"get": {
|
|
773
|
+
"operationId": "downloadAttachments",
|
|
774
|
+
"summary": "Download email attachments",
|
|
775
|
+
"description": "Downloads all attachments as a gzip-compressed tar archive.\nAuthenticates via a signed download token (provided in webhook\npayloads) or a valid session.\n",
|
|
776
|
+
"tags": [
|
|
777
|
+
"Emails"
|
|
778
|
+
],
|
|
779
|
+
"security": [
|
|
780
|
+
{
|
|
781
|
+
"BearerAuth": []
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"DownloadToken": []
|
|
785
|
+
}
|
|
786
|
+
],
|
|
787
|
+
"parameters": [
|
|
788
|
+
{
|
|
789
|
+
"name": "token",
|
|
790
|
+
"in": "query",
|
|
791
|
+
"schema": {
|
|
792
|
+
"type": "string"
|
|
793
|
+
},
|
|
794
|
+
"description": "Signed download token from webhook payload"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"responses": {
|
|
798
|
+
"200": {
|
|
799
|
+
"description": "Attachments archive",
|
|
800
|
+
"content": {
|
|
801
|
+
"application/gzip": {
|
|
802
|
+
"schema": {
|
|
803
|
+
"type": "string",
|
|
804
|
+
"format": "binary"
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
"headers": {
|
|
809
|
+
"Content-Disposition": {
|
|
810
|
+
"schema": {
|
|
811
|
+
"type": "string",
|
|
812
|
+
"example": "attachment; filename=\"email-id_attachments.tar.gz\""
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
"X-Content-SHA256": {
|
|
816
|
+
"schema": {
|
|
817
|
+
"type": "string"
|
|
818
|
+
},
|
|
819
|
+
"description": "SHA-256 hex digest of the archive"
|
|
820
|
+
},
|
|
821
|
+
"X-Attachment-Count": {
|
|
822
|
+
"schema": {
|
|
823
|
+
"type": "string"
|
|
824
|
+
},
|
|
825
|
+
"description": "Number of attachments in the archive"
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
"400": {
|
|
830
|
+
"$ref": "#/components/responses/ValidationError"
|
|
831
|
+
},
|
|
832
|
+
"401": {
|
|
833
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
834
|
+
},
|
|
835
|
+
"404": {
|
|
836
|
+
"$ref": "#/components/responses/NotFound"
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
"/emails/{id}/replay": {
|
|
842
|
+
"parameters": [
|
|
843
|
+
{
|
|
844
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
"post": {
|
|
848
|
+
"operationId": "replayEmailWebhooks",
|
|
849
|
+
"summary": "Replay email webhooks",
|
|
850
|
+
"description": "Re-delivers the webhook payload for this email to all active\nendpoints matching the email's domain. Rate limited per-email\n(short cooldown between successive replays of the same email)\nand per-org (burst + sustained windows), sharing an org-wide\nbudget with delivery replays.\n",
|
|
851
|
+
"tags": [
|
|
852
|
+
"Emails"
|
|
853
|
+
],
|
|
854
|
+
"responses": {
|
|
855
|
+
"200": {
|
|
856
|
+
"description": "Replay result",
|
|
857
|
+
"content": {
|
|
858
|
+
"application/json": {
|
|
859
|
+
"schema": {
|
|
860
|
+
"allOf": [
|
|
861
|
+
{
|
|
862
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"type": "object",
|
|
866
|
+
"properties": {
|
|
867
|
+
"data": {
|
|
868
|
+
"$ref": "#/components/schemas/ReplayResult"
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
]
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
"400": {
|
|
878
|
+
"$ref": "#/components/responses/ValidationError"
|
|
879
|
+
},
|
|
880
|
+
"401": {
|
|
881
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
882
|
+
},
|
|
883
|
+
"404": {
|
|
884
|
+
"$ref": "#/components/responses/NotFound"
|
|
885
|
+
},
|
|
886
|
+
"429": {
|
|
887
|
+
"$ref": "#/components/responses/RateLimited"
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
"/endpoints": {
|
|
893
|
+
"get": {
|
|
894
|
+
"operationId": "listEndpoints",
|
|
895
|
+
"summary": "List webhook endpoints",
|
|
896
|
+
"description": "Returns all active (non-deleted) webhook endpoints.",
|
|
897
|
+
"tags": [
|
|
898
|
+
"Endpoints"
|
|
899
|
+
],
|
|
900
|
+
"responses": {
|
|
901
|
+
"200": {
|
|
902
|
+
"description": "List of endpoints",
|
|
903
|
+
"content": {
|
|
904
|
+
"application/json": {
|
|
905
|
+
"schema": {
|
|
906
|
+
"allOf": [
|
|
907
|
+
{
|
|
908
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"type": "object",
|
|
912
|
+
"properties": {
|
|
913
|
+
"data": {
|
|
914
|
+
"type": "array",
|
|
915
|
+
"items": {
|
|
916
|
+
"$ref": "#/components/schemas/Endpoint"
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
]
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"401": {
|
|
927
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
"post": {
|
|
932
|
+
"operationId": "createEndpoint",
|
|
933
|
+
"summary": "Create a webhook endpoint",
|
|
934
|
+
"description": "Creates a new webhook endpoint. If a deactivated endpoint with the\nsame URL and domain exists, it is reactivated instead.\nSubject to plan limits on the number of active endpoints.\n",
|
|
935
|
+
"tags": [
|
|
936
|
+
"Endpoints"
|
|
937
|
+
],
|
|
938
|
+
"requestBody": {
|
|
939
|
+
"required": true,
|
|
940
|
+
"content": {
|
|
941
|
+
"application/json": {
|
|
942
|
+
"schema": {
|
|
943
|
+
"$ref": "#/components/schemas/CreateEndpointInput"
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
"responses": {
|
|
949
|
+
"201": {
|
|
950
|
+
"description": "Endpoint created (or reactivated)",
|
|
951
|
+
"content": {
|
|
952
|
+
"application/json": {
|
|
953
|
+
"schema": {
|
|
954
|
+
"allOf": [
|
|
955
|
+
{
|
|
956
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"type": "object",
|
|
960
|
+
"properties": {
|
|
961
|
+
"data": {
|
|
962
|
+
"$ref": "#/components/schemas/Endpoint"
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
]
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
"400": {
|
|
972
|
+
"$ref": "#/components/responses/ValidationError"
|
|
973
|
+
},
|
|
974
|
+
"401": {
|
|
975
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
"/endpoints/{id}": {
|
|
981
|
+
"parameters": [
|
|
982
|
+
{
|
|
983
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
984
|
+
}
|
|
985
|
+
],
|
|
986
|
+
"patch": {
|
|
987
|
+
"operationId": "updateEndpoint",
|
|
988
|
+
"summary": "Update a webhook endpoint",
|
|
989
|
+
"description": "Updates an active webhook endpoint. If the URL is changed, the old\nendpoint is deactivated and a new one is created (or an existing\ndeactivated endpoint with the new URL is reactivated).\n",
|
|
990
|
+
"tags": [
|
|
991
|
+
"Endpoints"
|
|
992
|
+
],
|
|
993
|
+
"requestBody": {
|
|
994
|
+
"required": true,
|
|
995
|
+
"content": {
|
|
996
|
+
"application/json": {
|
|
997
|
+
"schema": {
|
|
998
|
+
"$ref": "#/components/schemas/UpdateEndpointInput"
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
"responses": {
|
|
1004
|
+
"200": {
|
|
1005
|
+
"description": "Updated endpoint",
|
|
1006
|
+
"content": {
|
|
1007
|
+
"application/json": {
|
|
1008
|
+
"schema": {
|
|
1009
|
+
"allOf": [
|
|
1010
|
+
{
|
|
1011
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"type": "object",
|
|
1015
|
+
"properties": {
|
|
1016
|
+
"data": {
|
|
1017
|
+
"$ref": "#/components/schemas/Endpoint"
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
]
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
"400": {
|
|
1027
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1028
|
+
},
|
|
1029
|
+
"401": {
|
|
1030
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1031
|
+
},
|
|
1032
|
+
"404": {
|
|
1033
|
+
"$ref": "#/components/responses/NotFound"
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
"delete": {
|
|
1038
|
+
"operationId": "deleteEndpoint",
|
|
1039
|
+
"summary": "Delete a webhook endpoint",
|
|
1040
|
+
"description": "Soft-deletes a webhook endpoint. The endpoint will no longer\nreceive webhook deliveries.\n",
|
|
1041
|
+
"tags": [
|
|
1042
|
+
"Endpoints"
|
|
1043
|
+
],
|
|
1044
|
+
"responses": {
|
|
1045
|
+
"200": {
|
|
1046
|
+
"$ref": "#/components/responses/Deleted"
|
|
1047
|
+
},
|
|
1048
|
+
"400": {
|
|
1049
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1050
|
+
},
|
|
1051
|
+
"401": {
|
|
1052
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1053
|
+
},
|
|
1054
|
+
"404": {
|
|
1055
|
+
"$ref": "#/components/responses/NotFound"
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
},
|
|
1060
|
+
"/endpoints/{id}/test": {
|
|
1061
|
+
"parameters": [
|
|
1062
|
+
{
|
|
1063
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
1064
|
+
}
|
|
1065
|
+
],
|
|
1066
|
+
"post": {
|
|
1067
|
+
"operationId": "testEndpoint",
|
|
1068
|
+
"summary": "Send a test webhook",
|
|
1069
|
+
"description": "Sends a sample `email.received` event to the endpoint. The request\nincludes SSRF protection (private IP rejection and DNS pinning).\nRate limited to 4 per minute and 30 per hour (non-exempt).\nSuccessful deliveries and verified-domain endpoints are exempt\nfrom the rate limit.\n",
|
|
1070
|
+
"tags": [
|
|
1071
|
+
"Endpoints"
|
|
1072
|
+
],
|
|
1073
|
+
"responses": {
|
|
1074
|
+
"200": {
|
|
1075
|
+
"description": "Test result",
|
|
1076
|
+
"content": {
|
|
1077
|
+
"application/json": {
|
|
1078
|
+
"schema": {
|
|
1079
|
+
"allOf": [
|
|
1080
|
+
{
|
|
1081
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"type": "object",
|
|
1085
|
+
"properties": {
|
|
1086
|
+
"data": {
|
|
1087
|
+
"$ref": "#/components/schemas/TestResult"
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
]
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
"400": {
|
|
1097
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1098
|
+
},
|
|
1099
|
+
"401": {
|
|
1100
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1101
|
+
},
|
|
1102
|
+
"404": {
|
|
1103
|
+
"$ref": "#/components/responses/NotFound"
|
|
1104
|
+
},
|
|
1105
|
+
"429": {
|
|
1106
|
+
"$ref": "#/components/responses/RateLimited"
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1111
|
+
"/filters": {
|
|
1112
|
+
"get": {
|
|
1113
|
+
"operationId": "listFilters",
|
|
1114
|
+
"summary": "List filter rules",
|
|
1115
|
+
"description": "Returns all whitelist and blocklist filter rules.",
|
|
1116
|
+
"tags": [
|
|
1117
|
+
"Filters"
|
|
1118
|
+
],
|
|
1119
|
+
"responses": {
|
|
1120
|
+
"200": {
|
|
1121
|
+
"description": "List of filters",
|
|
1122
|
+
"content": {
|
|
1123
|
+
"application/json": {
|
|
1124
|
+
"schema": {
|
|
1125
|
+
"allOf": [
|
|
1126
|
+
{
|
|
1127
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"type": "object",
|
|
1131
|
+
"properties": {
|
|
1132
|
+
"data": {
|
|
1133
|
+
"type": "array",
|
|
1134
|
+
"items": {
|
|
1135
|
+
"$ref": "#/components/schemas/Filter"
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
]
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
"401": {
|
|
1146
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
"post": {
|
|
1151
|
+
"operationId": "createFilter",
|
|
1152
|
+
"summary": "Create a filter rule",
|
|
1153
|
+
"description": "Creates a new whitelist or blocklist filter. Per-domain filters\nrequire a Pro plan. Patterns are stored as lowercase.\n",
|
|
1154
|
+
"tags": [
|
|
1155
|
+
"Filters"
|
|
1156
|
+
],
|
|
1157
|
+
"requestBody": {
|
|
1158
|
+
"required": true,
|
|
1159
|
+
"content": {
|
|
1160
|
+
"application/json": {
|
|
1161
|
+
"schema": {
|
|
1162
|
+
"$ref": "#/components/schemas/CreateFilterInput"
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
"responses": {
|
|
1168
|
+
"201": {
|
|
1169
|
+
"description": "Filter created",
|
|
1170
|
+
"content": {
|
|
1171
|
+
"application/json": {
|
|
1172
|
+
"schema": {
|
|
1173
|
+
"allOf": [
|
|
1174
|
+
{
|
|
1175
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
"type": "object",
|
|
1179
|
+
"properties": {
|
|
1180
|
+
"data": {
|
|
1181
|
+
"$ref": "#/components/schemas/Filter"
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
]
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
"400": {
|
|
1191
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1192
|
+
},
|
|
1193
|
+
"401": {
|
|
1194
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1195
|
+
},
|
|
1196
|
+
"404": {
|
|
1197
|
+
"$ref": "#/components/responses/NotFound"
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
"/filters/{id}": {
|
|
1203
|
+
"parameters": [
|
|
1204
|
+
{
|
|
1205
|
+
"$ref": "#/components/parameters/ResourceId"
|
|
1206
|
+
}
|
|
1207
|
+
],
|
|
1208
|
+
"patch": {
|
|
1209
|
+
"operationId": "updateFilter",
|
|
1210
|
+
"summary": "Update a filter rule",
|
|
1211
|
+
"description": "Toggle a filter's enabled state.",
|
|
1212
|
+
"tags": [
|
|
1213
|
+
"Filters"
|
|
1214
|
+
],
|
|
1215
|
+
"requestBody": {
|
|
1216
|
+
"required": true,
|
|
1217
|
+
"content": {
|
|
1218
|
+
"application/json": {
|
|
1219
|
+
"schema": {
|
|
1220
|
+
"$ref": "#/components/schemas/UpdateFilterInput"
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
"responses": {
|
|
1226
|
+
"200": {
|
|
1227
|
+
"description": "Updated filter",
|
|
1228
|
+
"content": {
|
|
1229
|
+
"application/json": {
|
|
1230
|
+
"schema": {
|
|
1231
|
+
"allOf": [
|
|
1232
|
+
{
|
|
1233
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"type": "object",
|
|
1237
|
+
"properties": {
|
|
1238
|
+
"data": {
|
|
1239
|
+
"$ref": "#/components/schemas/Filter"
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
]
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
"400": {
|
|
1249
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1250
|
+
},
|
|
1251
|
+
"401": {
|
|
1252
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1253
|
+
},
|
|
1254
|
+
"404": {
|
|
1255
|
+
"$ref": "#/components/responses/NotFound"
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
"delete": {
|
|
1260
|
+
"operationId": "deleteFilter",
|
|
1261
|
+
"summary": "Delete a filter rule",
|
|
1262
|
+
"tags": [
|
|
1263
|
+
"Filters"
|
|
1264
|
+
],
|
|
1265
|
+
"responses": {
|
|
1266
|
+
"200": {
|
|
1267
|
+
"$ref": "#/components/responses/Deleted"
|
|
1268
|
+
},
|
|
1269
|
+
"400": {
|
|
1270
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1271
|
+
},
|
|
1272
|
+
"401": {
|
|
1273
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1274
|
+
},
|
|
1275
|
+
"404": {
|
|
1276
|
+
"$ref": "#/components/responses/NotFound"
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
},
|
|
1281
|
+
"/webhooks/deliveries": {
|
|
1282
|
+
"get": {
|
|
1283
|
+
"operationId": "listDeliveries",
|
|
1284
|
+
"summary": "List webhook deliveries",
|
|
1285
|
+
"description": "Returns a paginated list of webhook delivery attempts. Each delivery\nincludes a nested `email` object with sender, recipient, and subject.\n",
|
|
1286
|
+
"tags": [
|
|
1287
|
+
"Webhook Deliveries"
|
|
1288
|
+
],
|
|
1289
|
+
"parameters": [
|
|
1290
|
+
{
|
|
1291
|
+
"$ref": "#/components/parameters/Cursor"
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"$ref": "#/components/parameters/Limit"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"name": "email_id",
|
|
1298
|
+
"in": "query",
|
|
1299
|
+
"schema": {
|
|
1300
|
+
"type": "string",
|
|
1301
|
+
"format": "uuid"
|
|
1302
|
+
},
|
|
1303
|
+
"description": "Filter by email ID"
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
"name": "status",
|
|
1307
|
+
"in": "query",
|
|
1308
|
+
"schema": {
|
|
1309
|
+
"type": "string",
|
|
1310
|
+
"enum": [
|
|
1311
|
+
"pending",
|
|
1312
|
+
"delivered",
|
|
1313
|
+
"header_confirmed",
|
|
1314
|
+
"failed"
|
|
1315
|
+
]
|
|
1316
|
+
},
|
|
1317
|
+
"description": "Filter by delivery status"
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
"name": "date_from",
|
|
1321
|
+
"in": "query",
|
|
1322
|
+
"schema": {
|
|
1323
|
+
"type": "string",
|
|
1324
|
+
"format": "date-time"
|
|
1325
|
+
},
|
|
1326
|
+
"description": "Filter deliveries created on or after this timestamp"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
"name": "date_to",
|
|
1330
|
+
"in": "query",
|
|
1331
|
+
"schema": {
|
|
1332
|
+
"type": "string",
|
|
1333
|
+
"format": "date-time"
|
|
1334
|
+
},
|
|
1335
|
+
"description": "Filter deliveries created on or before this timestamp"
|
|
1336
|
+
}
|
|
1337
|
+
],
|
|
1338
|
+
"responses": {
|
|
1339
|
+
"200": {
|
|
1340
|
+
"description": "Paginated list of deliveries",
|
|
1341
|
+
"content": {
|
|
1342
|
+
"application/json": {
|
|
1343
|
+
"schema": {
|
|
1344
|
+
"allOf": [
|
|
1345
|
+
{
|
|
1346
|
+
"$ref": "#/components/schemas/ListEnvelope"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
"type": "object",
|
|
1350
|
+
"properties": {
|
|
1351
|
+
"data": {
|
|
1352
|
+
"type": "array",
|
|
1353
|
+
"items": {
|
|
1354
|
+
"$ref": "#/components/schemas/DeliverySummary"
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
"400": {
|
|
1365
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1366
|
+
},
|
|
1367
|
+
"401": {
|
|
1368
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
"/webhooks/deliveries/{id}/replay": {
|
|
1374
|
+
"parameters": [
|
|
1375
|
+
{
|
|
1376
|
+
"name": "id",
|
|
1377
|
+
"in": "path",
|
|
1378
|
+
"required": true,
|
|
1379
|
+
"schema": {
|
|
1380
|
+
"type": "string",
|
|
1381
|
+
"pattern": "^\\d+$"
|
|
1382
|
+
},
|
|
1383
|
+
"description": "Delivery ID (numeric)"
|
|
1384
|
+
}
|
|
1385
|
+
],
|
|
1386
|
+
"post": {
|
|
1387
|
+
"operationId": "replayDelivery",
|
|
1388
|
+
"summary": "Replay a webhook delivery",
|
|
1389
|
+
"description": "Re-sends the stored webhook payload from a previous delivery attempt.\nIf the original endpoint is still active, it is targeted. If the\noriginal endpoint was deleted, the oldest active endpoint is used.\nDeactivated endpoints cannot be replayed to. Rate limited per-org,\nsharing an org-wide budget with email replays.\n",
|
|
1390
|
+
"tags": [
|
|
1391
|
+
"Webhook Deliveries"
|
|
1392
|
+
],
|
|
1393
|
+
"responses": {
|
|
1394
|
+
"200": {
|
|
1395
|
+
"description": "Replay result",
|
|
1396
|
+
"content": {
|
|
1397
|
+
"application/json": {
|
|
1398
|
+
"schema": {
|
|
1399
|
+
"allOf": [
|
|
1400
|
+
{
|
|
1401
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"type": "object",
|
|
1405
|
+
"properties": {
|
|
1406
|
+
"data": {
|
|
1407
|
+
"$ref": "#/components/schemas/ReplayResult"
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
]
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
"400": {
|
|
1417
|
+
"$ref": "#/components/responses/ValidationError"
|
|
1418
|
+
},
|
|
1419
|
+
"401": {
|
|
1420
|
+
"$ref": "#/components/responses/Unauthorized"
|
|
1421
|
+
},
|
|
1422
|
+
"404": {
|
|
1423
|
+
"$ref": "#/components/responses/NotFound"
|
|
1424
|
+
},
|
|
1425
|
+
"429": {
|
|
1426
|
+
"$ref": "#/components/responses/RateLimited"
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
},
|
|
1432
|
+
"components": {
|
|
1433
|
+
"securitySchemes": {
|
|
1434
|
+
"BearerAuth": {
|
|
1435
|
+
"type": "http",
|
|
1436
|
+
"scheme": "bearer",
|
|
1437
|
+
"description": "API key with `prim_` prefix: `Authorization: Bearer prim_<key>`"
|
|
1438
|
+
},
|
|
1439
|
+
"DownloadToken": {
|
|
1440
|
+
"type": "apiKey",
|
|
1441
|
+
"in": "query",
|
|
1442
|
+
"name": "token",
|
|
1443
|
+
"description": "Signed download token provided in webhook payloads"
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
"parameters": {
|
|
1447
|
+
"ResourceId": {
|
|
1448
|
+
"name": "id",
|
|
1449
|
+
"in": "path",
|
|
1450
|
+
"required": true,
|
|
1451
|
+
"schema": {
|
|
1452
|
+
"type": "string",
|
|
1453
|
+
"format": "uuid"
|
|
1454
|
+
},
|
|
1455
|
+
"description": "Resource UUID"
|
|
1456
|
+
},
|
|
1457
|
+
"Cursor": {
|
|
1458
|
+
"name": "cursor",
|
|
1459
|
+
"in": "query",
|
|
1460
|
+
"schema": {
|
|
1461
|
+
"type": "string"
|
|
1462
|
+
},
|
|
1463
|
+
"description": "Pagination cursor from a previous response's `meta.cursor` field.\nFormat: `{ISO-datetime}|{id}`\n"
|
|
1464
|
+
},
|
|
1465
|
+
"Limit": {
|
|
1466
|
+
"name": "limit",
|
|
1467
|
+
"in": "query",
|
|
1468
|
+
"schema": {
|
|
1469
|
+
"type": "integer",
|
|
1470
|
+
"minimum": 1,
|
|
1471
|
+
"maximum": 100,
|
|
1472
|
+
"default": 50
|
|
1473
|
+
},
|
|
1474
|
+
"description": "Number of results per page"
|
|
1475
|
+
}
|
|
1476
|
+
},
|
|
1477
|
+
"responses": {
|
|
1478
|
+
"Unauthorized": {
|
|
1479
|
+
"description": "Invalid or missing API key",
|
|
1480
|
+
"content": {
|
|
1481
|
+
"application/json": {
|
|
1482
|
+
"schema": {
|
|
1483
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
1484
|
+
},
|
|
1485
|
+
"example": {
|
|
1486
|
+
"success": false,
|
|
1487
|
+
"error": {
|
|
1488
|
+
"code": "unauthorized",
|
|
1489
|
+
"message": "Invalid or missing API key"
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
},
|
|
1495
|
+
"NotFound": {
|
|
1496
|
+
"description": "Resource not found",
|
|
1497
|
+
"content": {
|
|
1498
|
+
"application/json": {
|
|
1499
|
+
"schema": {
|
|
1500
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
1501
|
+
},
|
|
1502
|
+
"example": {
|
|
1503
|
+
"success": false,
|
|
1504
|
+
"error": {
|
|
1505
|
+
"code": "not_found",
|
|
1506
|
+
"message": "Resource not found"
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
"ValidationError": {
|
|
1513
|
+
"description": "Invalid request parameters",
|
|
1514
|
+
"content": {
|
|
1515
|
+
"application/json": {
|
|
1516
|
+
"schema": {
|
|
1517
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
1518
|
+
},
|
|
1519
|
+
"example": {
|
|
1520
|
+
"success": false,
|
|
1521
|
+
"error": {
|
|
1522
|
+
"code": "validation_error",
|
|
1523
|
+
"message": "Invalid domain format"
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
"RateLimited": {
|
|
1530
|
+
"description": "Rate limit exceeded",
|
|
1531
|
+
"headers": {
|
|
1532
|
+
"Retry-After": {
|
|
1533
|
+
"schema": {
|
|
1534
|
+
"type": "integer"
|
|
1535
|
+
},
|
|
1536
|
+
"description": "Seconds to wait before retrying"
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
"content": {
|
|
1540
|
+
"application/json": {
|
|
1541
|
+
"schema": {
|
|
1542
|
+
"$ref": "#/components/schemas/ErrorResponse"
|
|
1543
|
+
},
|
|
1544
|
+
"example": {
|
|
1545
|
+
"success": false,
|
|
1546
|
+
"error": {
|
|
1547
|
+
"code": "rate_limit_exceeded",
|
|
1548
|
+
"message": "Rate limit exceeded"
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1554
|
+
"Deleted": {
|
|
1555
|
+
"description": "Resource deleted",
|
|
1556
|
+
"content": {
|
|
1557
|
+
"application/json": {
|
|
1558
|
+
"schema": {
|
|
1559
|
+
"allOf": [
|
|
1560
|
+
{
|
|
1561
|
+
"$ref": "#/components/schemas/SuccessEnvelope"
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
"type": "object",
|
|
1565
|
+
"properties": {
|
|
1566
|
+
"data": {
|
|
1567
|
+
"type": "object",
|
|
1568
|
+
"properties": {
|
|
1569
|
+
"deleted": {
|
|
1570
|
+
"type": "boolean",
|
|
1571
|
+
"const": true
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
"required": [
|
|
1575
|
+
"deleted"
|
|
1576
|
+
]
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
]
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
"schemas": {
|
|
1587
|
+
"SuccessEnvelope": {
|
|
1588
|
+
"type": "object",
|
|
1589
|
+
"properties": {
|
|
1590
|
+
"success": {
|
|
1591
|
+
"type": "boolean",
|
|
1592
|
+
"const": true
|
|
1593
|
+
}
|
|
1594
|
+
},
|
|
1595
|
+
"required": [
|
|
1596
|
+
"success",
|
|
1597
|
+
"data"
|
|
1598
|
+
]
|
|
1599
|
+
},
|
|
1600
|
+
"ListEnvelope": {
|
|
1601
|
+
"type": "object",
|
|
1602
|
+
"properties": {
|
|
1603
|
+
"success": {
|
|
1604
|
+
"type": "boolean",
|
|
1605
|
+
"const": true
|
|
1606
|
+
},
|
|
1607
|
+
"meta": {
|
|
1608
|
+
"$ref": "#/components/schemas/PaginationMeta"
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
"required": [
|
|
1612
|
+
"success",
|
|
1613
|
+
"data",
|
|
1614
|
+
"meta"
|
|
1615
|
+
]
|
|
1616
|
+
},
|
|
1617
|
+
"PaginationMeta": {
|
|
1618
|
+
"type": "object",
|
|
1619
|
+
"properties": {
|
|
1620
|
+
"total": {
|
|
1621
|
+
"type": "integer",
|
|
1622
|
+
"description": "Total number of matching records"
|
|
1623
|
+
},
|
|
1624
|
+
"limit": {
|
|
1625
|
+
"type": "integer",
|
|
1626
|
+
"description": "Page size used for this request"
|
|
1627
|
+
},
|
|
1628
|
+
"cursor": {
|
|
1629
|
+
"type": [
|
|
1630
|
+
"string",
|
|
1631
|
+
"null"
|
|
1632
|
+
],
|
|
1633
|
+
"description": "Cursor for the next page, or null if no more results"
|
|
1634
|
+
}
|
|
1635
|
+
},
|
|
1636
|
+
"required": [
|
|
1637
|
+
"total",
|
|
1638
|
+
"limit",
|
|
1639
|
+
"cursor"
|
|
1640
|
+
]
|
|
1641
|
+
},
|
|
1642
|
+
"ErrorResponse": {
|
|
1643
|
+
"type": "object",
|
|
1644
|
+
"properties": {
|
|
1645
|
+
"success": {
|
|
1646
|
+
"type": "boolean",
|
|
1647
|
+
"const": false
|
|
1648
|
+
},
|
|
1649
|
+
"error": {
|
|
1650
|
+
"type": "object",
|
|
1651
|
+
"properties": {
|
|
1652
|
+
"code": {
|
|
1653
|
+
"type": "string",
|
|
1654
|
+
"enum": [
|
|
1655
|
+
"unauthorized",
|
|
1656
|
+
"forbidden",
|
|
1657
|
+
"not_found",
|
|
1658
|
+
"validation_error",
|
|
1659
|
+
"rate_limit_exceeded",
|
|
1660
|
+
"internal_error",
|
|
1661
|
+
"conflict",
|
|
1662
|
+
"mx_conflict"
|
|
1663
|
+
]
|
|
1664
|
+
},
|
|
1665
|
+
"message": {
|
|
1666
|
+
"type": "string"
|
|
1667
|
+
},
|
|
1668
|
+
"details": {
|
|
1669
|
+
"type": "object",
|
|
1670
|
+
"description": "Optional structured data that callers can inspect to recover\nfrom the error. The fields present depend on `code`. Additional\nkeys may be added over time without a major-version bump.\n",
|
|
1671
|
+
"additionalProperties": true,
|
|
1672
|
+
"properties": {
|
|
1673
|
+
"mx_conflict": {
|
|
1674
|
+
"type": "object",
|
|
1675
|
+
"description": "Present when `code == mx_conflict`.",
|
|
1676
|
+
"required": [
|
|
1677
|
+
"provider_name",
|
|
1678
|
+
"suggested_subdomain"
|
|
1679
|
+
],
|
|
1680
|
+
"properties": {
|
|
1681
|
+
"provider_name": {
|
|
1682
|
+
"type": "string",
|
|
1683
|
+
"description": "Human-readable name of the detected mailbox provider (e.g. \"Google Workspace\")."
|
|
1684
|
+
},
|
|
1685
|
+
"suggested_subdomain": {
|
|
1686
|
+
"type": "string",
|
|
1687
|
+
"description": "Subdomain to try instead (e.g. \"mail\" for `mail.example.com`)."
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
"required": [
|
|
1695
|
+
"code",
|
|
1696
|
+
"message"
|
|
1697
|
+
]
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
"required": [
|
|
1701
|
+
"success",
|
|
1702
|
+
"error"
|
|
1703
|
+
]
|
|
1704
|
+
},
|
|
1705
|
+
"Account": {
|
|
1706
|
+
"type": "object",
|
|
1707
|
+
"properties": {
|
|
1708
|
+
"id": {
|
|
1709
|
+
"type": "string",
|
|
1710
|
+
"format": "uuid"
|
|
1711
|
+
},
|
|
1712
|
+
"email": {
|
|
1713
|
+
"type": "string"
|
|
1714
|
+
},
|
|
1715
|
+
"plan": {
|
|
1716
|
+
"type": "string"
|
|
1717
|
+
},
|
|
1718
|
+
"created_at": {
|
|
1719
|
+
"type": "string",
|
|
1720
|
+
"format": "date-time"
|
|
1721
|
+
},
|
|
1722
|
+
"onboarding_completed": {
|
|
1723
|
+
"type": "boolean"
|
|
1724
|
+
},
|
|
1725
|
+
"onboarding_step": {
|
|
1726
|
+
"type": [
|
|
1727
|
+
"string",
|
|
1728
|
+
"null"
|
|
1729
|
+
]
|
|
1730
|
+
},
|
|
1731
|
+
"stripe_subscription_status": {
|
|
1732
|
+
"type": [
|
|
1733
|
+
"string",
|
|
1734
|
+
"null"
|
|
1735
|
+
]
|
|
1736
|
+
},
|
|
1737
|
+
"subscription_current_period_end": {
|
|
1738
|
+
"type": [
|
|
1739
|
+
"string",
|
|
1740
|
+
"null"
|
|
1741
|
+
],
|
|
1742
|
+
"format": "date-time"
|
|
1743
|
+
},
|
|
1744
|
+
"subscription_cancel_at_period_end": {
|
|
1745
|
+
"type": [
|
|
1746
|
+
"boolean",
|
|
1747
|
+
"null"
|
|
1748
|
+
]
|
|
1749
|
+
},
|
|
1750
|
+
"spam_threshold": {
|
|
1751
|
+
"type": [
|
|
1752
|
+
"number",
|
|
1753
|
+
"null"
|
|
1754
|
+
],
|
|
1755
|
+
"minimum": 0,
|
|
1756
|
+
"maximum": 15
|
|
1757
|
+
},
|
|
1758
|
+
"discard_content_on_webhook_confirmed": {
|
|
1759
|
+
"type": "boolean"
|
|
1760
|
+
},
|
|
1761
|
+
"webhook_secret_rotated_at": {
|
|
1762
|
+
"type": [
|
|
1763
|
+
"string",
|
|
1764
|
+
"null"
|
|
1765
|
+
],
|
|
1766
|
+
"format": "date-time"
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
"required": [
|
|
1770
|
+
"id",
|
|
1771
|
+
"email",
|
|
1772
|
+
"plan",
|
|
1773
|
+
"created_at",
|
|
1774
|
+
"discard_content_on_webhook_confirmed"
|
|
1775
|
+
]
|
|
1776
|
+
},
|
|
1777
|
+
"AccountUpdated": {
|
|
1778
|
+
"type": "object",
|
|
1779
|
+
"properties": {
|
|
1780
|
+
"id": {
|
|
1781
|
+
"type": "string",
|
|
1782
|
+
"format": "uuid"
|
|
1783
|
+
},
|
|
1784
|
+
"email": {
|
|
1785
|
+
"type": "string"
|
|
1786
|
+
},
|
|
1787
|
+
"plan": {
|
|
1788
|
+
"type": "string"
|
|
1789
|
+
},
|
|
1790
|
+
"spam_threshold": {
|
|
1791
|
+
"type": [
|
|
1792
|
+
"number",
|
|
1793
|
+
"null"
|
|
1794
|
+
],
|
|
1795
|
+
"minimum": 0,
|
|
1796
|
+
"maximum": 15
|
|
1797
|
+
},
|
|
1798
|
+
"discard_content_on_webhook_confirmed": {
|
|
1799
|
+
"type": "boolean"
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
"required": [
|
|
1803
|
+
"id",
|
|
1804
|
+
"email",
|
|
1805
|
+
"plan",
|
|
1806
|
+
"discard_content_on_webhook_confirmed"
|
|
1807
|
+
]
|
|
1808
|
+
},
|
|
1809
|
+
"UpdateAccountInput": {
|
|
1810
|
+
"type": "object",
|
|
1811
|
+
"additionalProperties": false,
|
|
1812
|
+
"properties": {
|
|
1813
|
+
"spam_threshold": {
|
|
1814
|
+
"type": [
|
|
1815
|
+
"number",
|
|
1816
|
+
"null"
|
|
1817
|
+
],
|
|
1818
|
+
"minimum": 0,
|
|
1819
|
+
"maximum": 15,
|
|
1820
|
+
"description": "Global spam score threshold (0-15). Emails scoring above this are rejected. Set to null to disable."
|
|
1821
|
+
},
|
|
1822
|
+
"discard_content_on_webhook_confirmed": {
|
|
1823
|
+
"type": "boolean",
|
|
1824
|
+
"description": "Whether to discard email content after the webhook endpoint confirms receipt."
|
|
1825
|
+
}
|
|
1826
|
+
},
|
|
1827
|
+
"minProperties": 1
|
|
1828
|
+
},
|
|
1829
|
+
"StorageStats": {
|
|
1830
|
+
"type": "object",
|
|
1831
|
+
"properties": {
|
|
1832
|
+
"used_bytes": {
|
|
1833
|
+
"type": "integer",
|
|
1834
|
+
"description": "Total storage used in bytes"
|
|
1835
|
+
},
|
|
1836
|
+
"used_kb": {
|
|
1837
|
+
"type": "number",
|
|
1838
|
+
"description": "Total storage used in kilobytes (1 decimal)"
|
|
1839
|
+
},
|
|
1840
|
+
"used_mb": {
|
|
1841
|
+
"type": "number",
|
|
1842
|
+
"description": "Total storage used in megabytes (2 decimals)"
|
|
1843
|
+
},
|
|
1844
|
+
"quota_mb": {
|
|
1845
|
+
"type": "number",
|
|
1846
|
+
"description": "Storage quota in megabytes (based on plan)"
|
|
1847
|
+
},
|
|
1848
|
+
"percentage": {
|
|
1849
|
+
"type": "number",
|
|
1850
|
+
"description": "Percentage of quota used (1 decimal)"
|
|
1851
|
+
},
|
|
1852
|
+
"emails_count": {
|
|
1853
|
+
"type": "integer",
|
|
1854
|
+
"description": "Number of stored emails"
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
"required": [
|
|
1858
|
+
"used_bytes",
|
|
1859
|
+
"used_kb",
|
|
1860
|
+
"used_mb",
|
|
1861
|
+
"quota_mb",
|
|
1862
|
+
"percentage",
|
|
1863
|
+
"emails_count"
|
|
1864
|
+
]
|
|
1865
|
+
},
|
|
1866
|
+
"WebhookSecret": {
|
|
1867
|
+
"type": "object",
|
|
1868
|
+
"properties": {
|
|
1869
|
+
"secret": {
|
|
1870
|
+
"type": "string",
|
|
1871
|
+
"description": "The webhook signing secret value"
|
|
1872
|
+
}
|
|
1873
|
+
},
|
|
1874
|
+
"required": [
|
|
1875
|
+
"secret"
|
|
1876
|
+
]
|
|
1877
|
+
},
|
|
1878
|
+
"Domain": {
|
|
1879
|
+
"description": "A domain can be either verified or unverified. Verified domains have\n`is_active` and `spam_threshold` fields. Unverified domains have a\n`verification_token` for DNS verification.\n",
|
|
1880
|
+
"oneOf": [
|
|
1881
|
+
{
|
|
1882
|
+
"$ref": "#/components/schemas/VerifiedDomain"
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
"$ref": "#/components/schemas/UnverifiedDomain"
|
|
1886
|
+
}
|
|
1887
|
+
]
|
|
1888
|
+
},
|
|
1889
|
+
"VerifiedDomain": {
|
|
1890
|
+
"type": "object",
|
|
1891
|
+
"properties": {
|
|
1892
|
+
"id": {
|
|
1893
|
+
"type": "string",
|
|
1894
|
+
"format": "uuid"
|
|
1895
|
+
},
|
|
1896
|
+
"org_id": {
|
|
1897
|
+
"type": "string",
|
|
1898
|
+
"format": "uuid"
|
|
1899
|
+
},
|
|
1900
|
+
"domain": {
|
|
1901
|
+
"type": "string"
|
|
1902
|
+
},
|
|
1903
|
+
"verified": {
|
|
1904
|
+
"type": "boolean",
|
|
1905
|
+
"const": true
|
|
1906
|
+
},
|
|
1907
|
+
"is_active": {
|
|
1908
|
+
"type": "boolean"
|
|
1909
|
+
},
|
|
1910
|
+
"spam_threshold": {
|
|
1911
|
+
"type": [
|
|
1912
|
+
"number",
|
|
1913
|
+
"null"
|
|
1914
|
+
],
|
|
1915
|
+
"minimum": 0,
|
|
1916
|
+
"maximum": 15
|
|
1917
|
+
},
|
|
1918
|
+
"verification_token": {
|
|
1919
|
+
"type": [
|
|
1920
|
+
"string",
|
|
1921
|
+
"null"
|
|
1922
|
+
]
|
|
1923
|
+
},
|
|
1924
|
+
"created_at": {
|
|
1925
|
+
"type": "string",
|
|
1926
|
+
"format": "date-time"
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
"required": [
|
|
1930
|
+
"id",
|
|
1931
|
+
"org_id",
|
|
1932
|
+
"domain",
|
|
1933
|
+
"verified",
|
|
1934
|
+
"is_active",
|
|
1935
|
+
"created_at"
|
|
1936
|
+
]
|
|
1937
|
+
},
|
|
1938
|
+
"UnverifiedDomain": {
|
|
1939
|
+
"type": "object",
|
|
1940
|
+
"properties": {
|
|
1941
|
+
"id": {
|
|
1942
|
+
"type": "string",
|
|
1943
|
+
"format": "uuid"
|
|
1944
|
+
},
|
|
1945
|
+
"org_id": {
|
|
1946
|
+
"type": "string",
|
|
1947
|
+
"format": "uuid"
|
|
1948
|
+
},
|
|
1949
|
+
"domain": {
|
|
1950
|
+
"type": "string"
|
|
1951
|
+
},
|
|
1952
|
+
"verified": {
|
|
1953
|
+
"type": "boolean",
|
|
1954
|
+
"const": false
|
|
1955
|
+
},
|
|
1956
|
+
"verification_token": {
|
|
1957
|
+
"type": "string",
|
|
1958
|
+
"description": "Add this value as a TXT record to verify ownership"
|
|
1959
|
+
},
|
|
1960
|
+
"created_at": {
|
|
1961
|
+
"type": "string",
|
|
1962
|
+
"format": "date-time"
|
|
1963
|
+
}
|
|
1964
|
+
},
|
|
1965
|
+
"required": [
|
|
1966
|
+
"id",
|
|
1967
|
+
"org_id",
|
|
1968
|
+
"domain",
|
|
1969
|
+
"verified",
|
|
1970
|
+
"verification_token",
|
|
1971
|
+
"created_at"
|
|
1972
|
+
]
|
|
1973
|
+
},
|
|
1974
|
+
"AddDomainInput": {
|
|
1975
|
+
"type": "object",
|
|
1976
|
+
"additionalProperties": false,
|
|
1977
|
+
"properties": {
|
|
1978
|
+
"domain": {
|
|
1979
|
+
"type": "string",
|
|
1980
|
+
"minLength": 1,
|
|
1981
|
+
"maxLength": 253,
|
|
1982
|
+
"description": "The domain name to claim (e.g. \"example.com\")"
|
|
1983
|
+
}
|
|
1984
|
+
},
|
|
1985
|
+
"required": [
|
|
1986
|
+
"domain"
|
|
1987
|
+
]
|
|
1988
|
+
},
|
|
1989
|
+
"UpdateDomainInput": {
|
|
1990
|
+
"type": "object",
|
|
1991
|
+
"additionalProperties": false,
|
|
1992
|
+
"properties": {
|
|
1993
|
+
"is_active": {
|
|
1994
|
+
"type": "boolean",
|
|
1995
|
+
"description": "Whether the domain accepts incoming emails"
|
|
1996
|
+
},
|
|
1997
|
+
"spam_threshold": {
|
|
1998
|
+
"type": [
|
|
1999
|
+
"number",
|
|
2000
|
+
"null"
|
|
2001
|
+
],
|
|
2002
|
+
"minimum": 0,
|
|
2003
|
+
"maximum": 15,
|
|
2004
|
+
"description": "Per-domain spam threshold override (Pro plan required)"
|
|
2005
|
+
}
|
|
2006
|
+
},
|
|
2007
|
+
"minProperties": 1
|
|
2008
|
+
},
|
|
2009
|
+
"DomainVerifyResult": {
|
|
2010
|
+
"oneOf": [
|
|
2011
|
+
{
|
|
2012
|
+
"type": "object",
|
|
2013
|
+
"properties": {
|
|
2014
|
+
"verified": {
|
|
2015
|
+
"type": "boolean",
|
|
2016
|
+
"const": true
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
"required": [
|
|
2020
|
+
"verified"
|
|
2021
|
+
]
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
"type": "object",
|
|
2025
|
+
"properties": {
|
|
2026
|
+
"verified": {
|
|
2027
|
+
"type": "boolean",
|
|
2028
|
+
"const": false
|
|
2029
|
+
},
|
|
2030
|
+
"mxFound": {
|
|
2031
|
+
"type": "boolean",
|
|
2032
|
+
"description": "Whether MX records point to Primitive"
|
|
2033
|
+
},
|
|
2034
|
+
"txtFound": {
|
|
2035
|
+
"type": "boolean",
|
|
2036
|
+
"description": "Whether the TXT verification record was found"
|
|
2037
|
+
},
|
|
2038
|
+
"error": {
|
|
2039
|
+
"type": "string",
|
|
2040
|
+
"description": "Human-readable verification failure reason"
|
|
2041
|
+
}
|
|
2042
|
+
},
|
|
2043
|
+
"required": [
|
|
2044
|
+
"verified",
|
|
2045
|
+
"mxFound",
|
|
2046
|
+
"txtFound",
|
|
2047
|
+
"error"
|
|
2048
|
+
]
|
|
2049
|
+
}
|
|
2050
|
+
]
|
|
2051
|
+
},
|
|
2052
|
+
"EmailSummary": {
|
|
2053
|
+
"type": "object",
|
|
2054
|
+
"properties": {
|
|
2055
|
+
"id": {
|
|
2056
|
+
"type": "string",
|
|
2057
|
+
"format": "uuid"
|
|
2058
|
+
},
|
|
2059
|
+
"message_id": {
|
|
2060
|
+
"type": [
|
|
2061
|
+
"string",
|
|
2062
|
+
"null"
|
|
2063
|
+
]
|
|
2064
|
+
},
|
|
2065
|
+
"domain_id": {
|
|
2066
|
+
"type": [
|
|
2067
|
+
"string",
|
|
2068
|
+
"null"
|
|
2069
|
+
],
|
|
2070
|
+
"format": "uuid"
|
|
2071
|
+
},
|
|
2072
|
+
"org_id": {
|
|
2073
|
+
"type": [
|
|
2074
|
+
"string",
|
|
2075
|
+
"null"
|
|
2076
|
+
],
|
|
2077
|
+
"format": "uuid"
|
|
2078
|
+
},
|
|
2079
|
+
"status": {
|
|
2080
|
+
"type": "string",
|
|
2081
|
+
"enum": [
|
|
2082
|
+
"pending",
|
|
2083
|
+
"accepted",
|
|
2084
|
+
"completed",
|
|
2085
|
+
"rejected"
|
|
2086
|
+
]
|
|
2087
|
+
},
|
|
2088
|
+
"sender": {
|
|
2089
|
+
"type": "string"
|
|
2090
|
+
},
|
|
2091
|
+
"recipient": {
|
|
2092
|
+
"type": "string"
|
|
2093
|
+
},
|
|
2094
|
+
"subject": {
|
|
2095
|
+
"type": [
|
|
2096
|
+
"string",
|
|
2097
|
+
"null"
|
|
2098
|
+
]
|
|
2099
|
+
},
|
|
2100
|
+
"domain": {
|
|
2101
|
+
"type": "string"
|
|
2102
|
+
},
|
|
2103
|
+
"spam_score": {
|
|
2104
|
+
"type": [
|
|
2105
|
+
"number",
|
|
2106
|
+
"null"
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
"created_at": {
|
|
2110
|
+
"type": "string",
|
|
2111
|
+
"format": "date-time"
|
|
2112
|
+
},
|
|
2113
|
+
"received_at": {
|
|
2114
|
+
"type": "string",
|
|
2115
|
+
"format": "date-time"
|
|
2116
|
+
},
|
|
2117
|
+
"raw_size_bytes": {
|
|
2118
|
+
"type": [
|
|
2119
|
+
"integer",
|
|
2120
|
+
"null"
|
|
2121
|
+
]
|
|
2122
|
+
},
|
|
2123
|
+
"webhook_status": {
|
|
2124
|
+
"type": [
|
|
2125
|
+
"string",
|
|
2126
|
+
"null"
|
|
2127
|
+
],
|
|
2128
|
+
"enum": [
|
|
2129
|
+
"pending",
|
|
2130
|
+
"in_flight",
|
|
2131
|
+
"fired",
|
|
2132
|
+
"failed",
|
|
2133
|
+
"exhausted",
|
|
2134
|
+
null
|
|
2135
|
+
]
|
|
2136
|
+
},
|
|
2137
|
+
"webhook_attempt_count": {
|
|
2138
|
+
"type": "integer"
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
"required": [
|
|
2142
|
+
"id",
|
|
2143
|
+
"status",
|
|
2144
|
+
"sender",
|
|
2145
|
+
"recipient",
|
|
2146
|
+
"domain",
|
|
2147
|
+
"created_at",
|
|
2148
|
+
"received_at",
|
|
2149
|
+
"webhook_attempt_count"
|
|
2150
|
+
]
|
|
2151
|
+
},
|
|
2152
|
+
"EmailDetail": {
|
|
2153
|
+
"type": "object",
|
|
2154
|
+
"properties": {
|
|
2155
|
+
"id": {
|
|
2156
|
+
"type": "string",
|
|
2157
|
+
"format": "uuid"
|
|
2158
|
+
},
|
|
2159
|
+
"message_id": {
|
|
2160
|
+
"type": [
|
|
2161
|
+
"string",
|
|
2162
|
+
"null"
|
|
2163
|
+
]
|
|
2164
|
+
},
|
|
2165
|
+
"domain_id": {
|
|
2166
|
+
"type": [
|
|
2167
|
+
"string",
|
|
2168
|
+
"null"
|
|
2169
|
+
],
|
|
2170
|
+
"format": "uuid"
|
|
2171
|
+
},
|
|
2172
|
+
"org_id": {
|
|
2173
|
+
"type": [
|
|
2174
|
+
"string",
|
|
2175
|
+
"null"
|
|
2176
|
+
],
|
|
2177
|
+
"format": "uuid"
|
|
2178
|
+
},
|
|
2179
|
+
"sender": {
|
|
2180
|
+
"type": "string"
|
|
2181
|
+
},
|
|
2182
|
+
"recipient": {
|
|
2183
|
+
"type": "string"
|
|
2184
|
+
},
|
|
2185
|
+
"subject": {
|
|
2186
|
+
"type": [
|
|
2187
|
+
"string",
|
|
2188
|
+
"null"
|
|
2189
|
+
]
|
|
2190
|
+
},
|
|
2191
|
+
"status": {
|
|
2192
|
+
"type": "string",
|
|
2193
|
+
"enum": [
|
|
2194
|
+
"pending",
|
|
2195
|
+
"accepted",
|
|
2196
|
+
"completed",
|
|
2197
|
+
"rejected"
|
|
2198
|
+
]
|
|
2199
|
+
},
|
|
2200
|
+
"domain": {
|
|
2201
|
+
"type": "string"
|
|
2202
|
+
},
|
|
2203
|
+
"spam_score": {
|
|
2204
|
+
"type": [
|
|
2205
|
+
"number",
|
|
2206
|
+
"null"
|
|
2207
|
+
]
|
|
2208
|
+
},
|
|
2209
|
+
"raw_size_bytes": {
|
|
2210
|
+
"type": [
|
|
2211
|
+
"integer",
|
|
2212
|
+
"null"
|
|
2213
|
+
]
|
|
2214
|
+
},
|
|
2215
|
+
"raw_sha256": {
|
|
2216
|
+
"type": [
|
|
2217
|
+
"string",
|
|
2218
|
+
"null"
|
|
2219
|
+
]
|
|
2220
|
+
},
|
|
2221
|
+
"created_at": {
|
|
2222
|
+
"type": "string",
|
|
2223
|
+
"format": "date-time"
|
|
2224
|
+
},
|
|
2225
|
+
"received_at": {
|
|
2226
|
+
"type": "string",
|
|
2227
|
+
"format": "date-time"
|
|
2228
|
+
},
|
|
2229
|
+
"rejection_reason": {
|
|
2230
|
+
"type": [
|
|
2231
|
+
"string",
|
|
2232
|
+
"null"
|
|
2233
|
+
]
|
|
2234
|
+
},
|
|
2235
|
+
"webhook_status": {
|
|
2236
|
+
"type": [
|
|
2237
|
+
"string",
|
|
2238
|
+
"null"
|
|
2239
|
+
],
|
|
2240
|
+
"enum": [
|
|
2241
|
+
"pending",
|
|
2242
|
+
"in_flight",
|
|
2243
|
+
"fired",
|
|
2244
|
+
"failed",
|
|
2245
|
+
"exhausted",
|
|
2246
|
+
null
|
|
2247
|
+
]
|
|
2248
|
+
},
|
|
2249
|
+
"webhook_attempt_count": {
|
|
2250
|
+
"type": "integer"
|
|
2251
|
+
},
|
|
2252
|
+
"webhook_last_attempt_at": {
|
|
2253
|
+
"type": [
|
|
2254
|
+
"string",
|
|
2255
|
+
"null"
|
|
2256
|
+
],
|
|
2257
|
+
"format": "date-time"
|
|
2258
|
+
},
|
|
2259
|
+
"webhook_last_status_code": {
|
|
2260
|
+
"type": [
|
|
2261
|
+
"integer",
|
|
2262
|
+
"null"
|
|
2263
|
+
]
|
|
2264
|
+
},
|
|
2265
|
+
"webhook_last_error": {
|
|
2266
|
+
"type": [
|
|
2267
|
+
"string",
|
|
2268
|
+
"null"
|
|
2269
|
+
]
|
|
2270
|
+
},
|
|
2271
|
+
"webhook_fired_at": {
|
|
2272
|
+
"type": [
|
|
2273
|
+
"string",
|
|
2274
|
+
"null"
|
|
2275
|
+
],
|
|
2276
|
+
"format": "date-time"
|
|
2277
|
+
},
|
|
2278
|
+
"smtp_helo": {
|
|
2279
|
+
"type": [
|
|
2280
|
+
"string",
|
|
2281
|
+
"null"
|
|
2282
|
+
]
|
|
2283
|
+
},
|
|
2284
|
+
"smtp_mail_from": {
|
|
2285
|
+
"type": [
|
|
2286
|
+
"string",
|
|
2287
|
+
"null"
|
|
2288
|
+
]
|
|
2289
|
+
},
|
|
2290
|
+
"smtp_rcpt_to": {
|
|
2291
|
+
"type": [
|
|
2292
|
+
"array",
|
|
2293
|
+
"null"
|
|
2294
|
+
],
|
|
2295
|
+
"items": {
|
|
2296
|
+
"type": "string"
|
|
2297
|
+
}
|
|
2298
|
+
},
|
|
2299
|
+
"from_header": {
|
|
2300
|
+
"type": [
|
|
2301
|
+
"string",
|
|
2302
|
+
"null"
|
|
2303
|
+
]
|
|
2304
|
+
},
|
|
2305
|
+
"content_discarded_at": {
|
|
2306
|
+
"type": [
|
|
2307
|
+
"string",
|
|
2308
|
+
"null"
|
|
2309
|
+
],
|
|
2310
|
+
"format": "date-time"
|
|
2311
|
+
},
|
|
2312
|
+
"content_discarded_by_delivery_id": {
|
|
2313
|
+
"type": [
|
|
2314
|
+
"string",
|
|
2315
|
+
"null"
|
|
2316
|
+
]
|
|
2317
|
+
},
|
|
2318
|
+
"from_email": {
|
|
2319
|
+
"type": "string",
|
|
2320
|
+
"description": "Parsed from address (from_header or sender fallback)"
|
|
2321
|
+
},
|
|
2322
|
+
"to_email": {
|
|
2323
|
+
"type": "string",
|
|
2324
|
+
"description": "Parsed to address (same as recipient)"
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
"required": [
|
|
2328
|
+
"id",
|
|
2329
|
+
"sender",
|
|
2330
|
+
"recipient",
|
|
2331
|
+
"status",
|
|
2332
|
+
"domain",
|
|
2333
|
+
"created_at",
|
|
2334
|
+
"received_at",
|
|
2335
|
+
"webhook_attempt_count",
|
|
2336
|
+
"from_email",
|
|
2337
|
+
"to_email"
|
|
2338
|
+
]
|
|
2339
|
+
},
|
|
2340
|
+
"Endpoint": {
|
|
2341
|
+
"type": "object",
|
|
2342
|
+
"properties": {
|
|
2343
|
+
"id": {
|
|
2344
|
+
"type": "string",
|
|
2345
|
+
"format": "uuid"
|
|
2346
|
+
},
|
|
2347
|
+
"org_id": {
|
|
2348
|
+
"type": "string",
|
|
2349
|
+
"format": "uuid"
|
|
2350
|
+
},
|
|
2351
|
+
"url": {
|
|
2352
|
+
"type": [
|
|
2353
|
+
"string",
|
|
2354
|
+
"null"
|
|
2355
|
+
]
|
|
2356
|
+
},
|
|
2357
|
+
"enabled": {
|
|
2358
|
+
"type": "boolean"
|
|
2359
|
+
},
|
|
2360
|
+
"domain_id": {
|
|
2361
|
+
"type": [
|
|
2362
|
+
"string",
|
|
2363
|
+
"null"
|
|
2364
|
+
],
|
|
2365
|
+
"format": "uuid",
|
|
2366
|
+
"description": "Restrict this endpoint to emails from a specific domain"
|
|
2367
|
+
},
|
|
2368
|
+
"rules": {
|
|
2369
|
+
"type": "object",
|
|
2370
|
+
"description": "Endpoint-specific filtering rules"
|
|
2371
|
+
},
|
|
2372
|
+
"created_at": {
|
|
2373
|
+
"type": "string",
|
|
2374
|
+
"format": "date-time"
|
|
2375
|
+
},
|
|
2376
|
+
"updated_at": {
|
|
2377
|
+
"type": "string",
|
|
2378
|
+
"format": "date-time"
|
|
2379
|
+
},
|
|
2380
|
+
"delivery_count": {
|
|
2381
|
+
"type": "integer",
|
|
2382
|
+
"description": "Total webhook deliveries attempted"
|
|
2383
|
+
},
|
|
2384
|
+
"success_count": {
|
|
2385
|
+
"type": "integer",
|
|
2386
|
+
"description": "Successful deliveries"
|
|
2387
|
+
},
|
|
2388
|
+
"failure_count": {
|
|
2389
|
+
"type": "integer",
|
|
2390
|
+
"description": "Failed deliveries"
|
|
2391
|
+
},
|
|
2392
|
+
"consecutive_fails": {
|
|
2393
|
+
"type": "integer",
|
|
2394
|
+
"description": "Current streak of consecutive failures"
|
|
2395
|
+
},
|
|
2396
|
+
"last_delivery_at": {
|
|
2397
|
+
"type": [
|
|
2398
|
+
"string",
|
|
2399
|
+
"null"
|
|
2400
|
+
],
|
|
2401
|
+
"format": "date-time"
|
|
2402
|
+
},
|
|
2403
|
+
"last_success_at": {
|
|
2404
|
+
"type": [
|
|
2405
|
+
"string",
|
|
2406
|
+
"null"
|
|
2407
|
+
],
|
|
2408
|
+
"format": "date-time"
|
|
2409
|
+
},
|
|
2410
|
+
"last_failure_at": {
|
|
2411
|
+
"type": [
|
|
2412
|
+
"string",
|
|
2413
|
+
"null"
|
|
2414
|
+
],
|
|
2415
|
+
"format": "date-time"
|
|
2416
|
+
},
|
|
2417
|
+
"deactivated_at": {
|
|
2418
|
+
"type": [
|
|
2419
|
+
"string",
|
|
2420
|
+
"null"
|
|
2421
|
+
],
|
|
2422
|
+
"format": "date-time"
|
|
2423
|
+
}
|
|
2424
|
+
},
|
|
2425
|
+
"required": [
|
|
2426
|
+
"id",
|
|
2427
|
+
"org_id",
|
|
2428
|
+
"enabled",
|
|
2429
|
+
"rules",
|
|
2430
|
+
"created_at",
|
|
2431
|
+
"updated_at",
|
|
2432
|
+
"delivery_count",
|
|
2433
|
+
"success_count",
|
|
2434
|
+
"failure_count",
|
|
2435
|
+
"consecutive_fails"
|
|
2436
|
+
]
|
|
2437
|
+
},
|
|
2438
|
+
"CreateEndpointInput": {
|
|
2439
|
+
"type": "object",
|
|
2440
|
+
"additionalProperties": false,
|
|
2441
|
+
"properties": {
|
|
2442
|
+
"url": {
|
|
2443
|
+
"type": "string",
|
|
2444
|
+
"minLength": 1,
|
|
2445
|
+
"description": "The webhook URL to deliver events to"
|
|
2446
|
+
},
|
|
2447
|
+
"enabled": {
|
|
2448
|
+
"type": "boolean",
|
|
2449
|
+
"default": true,
|
|
2450
|
+
"description": "Whether the endpoint is active"
|
|
2451
|
+
},
|
|
2452
|
+
"domain_id": {
|
|
2453
|
+
"type": [
|
|
2454
|
+
"string",
|
|
2455
|
+
"null"
|
|
2456
|
+
],
|
|
2457
|
+
"format": "uuid",
|
|
2458
|
+
"description": "Restrict to emails from a specific domain"
|
|
2459
|
+
},
|
|
2460
|
+
"rules": {
|
|
2461
|
+
"type": "object",
|
|
2462
|
+
"description": "Endpoint-specific filtering rules"
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
"required": [
|
|
2466
|
+
"url"
|
|
2467
|
+
]
|
|
2468
|
+
},
|
|
2469
|
+
"UpdateEndpointInput": {
|
|
2470
|
+
"type": "object",
|
|
2471
|
+
"additionalProperties": false,
|
|
2472
|
+
"properties": {
|
|
2473
|
+
"url": {
|
|
2474
|
+
"type": "string",
|
|
2475
|
+
"minLength": 1,
|
|
2476
|
+
"description": "New webhook URL (triggers endpoint rotation)"
|
|
2477
|
+
},
|
|
2478
|
+
"enabled": {
|
|
2479
|
+
"type": "boolean"
|
|
2480
|
+
},
|
|
2481
|
+
"domain_id": {
|
|
2482
|
+
"type": [
|
|
2483
|
+
"string",
|
|
2484
|
+
"null"
|
|
2485
|
+
],
|
|
2486
|
+
"format": "uuid"
|
|
2487
|
+
},
|
|
2488
|
+
"rules": {
|
|
2489
|
+
"type": "object"
|
|
2490
|
+
}
|
|
2491
|
+
},
|
|
2492
|
+
"minProperties": 1
|
|
2493
|
+
},
|
|
2494
|
+
"TestResult": {
|
|
2495
|
+
"type": "object",
|
|
2496
|
+
"properties": {
|
|
2497
|
+
"status": {
|
|
2498
|
+
"type": "integer",
|
|
2499
|
+
"description": "HTTP status code returned by the endpoint"
|
|
2500
|
+
},
|
|
2501
|
+
"body": {
|
|
2502
|
+
"type": "string",
|
|
2503
|
+
"description": "Response body (truncated to 1000 characters)"
|
|
2504
|
+
},
|
|
2505
|
+
"signature": {
|
|
2506
|
+
"type": "string",
|
|
2507
|
+
"description": "The signature header value sent (if webhook secret is configured)"
|
|
2508
|
+
}
|
|
2509
|
+
},
|
|
2510
|
+
"required": [
|
|
2511
|
+
"status",
|
|
2512
|
+
"body"
|
|
2513
|
+
]
|
|
2514
|
+
},
|
|
2515
|
+
"Filter": {
|
|
2516
|
+
"type": "object",
|
|
2517
|
+
"properties": {
|
|
2518
|
+
"id": {
|
|
2519
|
+
"type": "string",
|
|
2520
|
+
"format": "uuid"
|
|
2521
|
+
},
|
|
2522
|
+
"org_id": {
|
|
2523
|
+
"type": "string",
|
|
2524
|
+
"format": "uuid"
|
|
2525
|
+
},
|
|
2526
|
+
"domain_id": {
|
|
2527
|
+
"type": [
|
|
2528
|
+
"string",
|
|
2529
|
+
"null"
|
|
2530
|
+
],
|
|
2531
|
+
"format": "uuid",
|
|
2532
|
+
"description": "If set, filter applies only to this domain"
|
|
2533
|
+
},
|
|
2534
|
+
"type": {
|
|
2535
|
+
"type": "string",
|
|
2536
|
+
"enum": [
|
|
2537
|
+
"whitelist",
|
|
2538
|
+
"blocklist"
|
|
2539
|
+
]
|
|
2540
|
+
},
|
|
2541
|
+
"pattern": {
|
|
2542
|
+
"type": "string",
|
|
2543
|
+
"description": "Email address or pattern to match (stored lowercase)"
|
|
2544
|
+
},
|
|
2545
|
+
"enabled": {
|
|
2546
|
+
"type": "boolean"
|
|
2547
|
+
},
|
|
2548
|
+
"created_at": {
|
|
2549
|
+
"type": "string",
|
|
2550
|
+
"format": "date-time"
|
|
2551
|
+
}
|
|
2552
|
+
},
|
|
2553
|
+
"required": [
|
|
2554
|
+
"id",
|
|
2555
|
+
"org_id",
|
|
2556
|
+
"type",
|
|
2557
|
+
"pattern",
|
|
2558
|
+
"enabled",
|
|
2559
|
+
"created_at"
|
|
2560
|
+
]
|
|
2561
|
+
},
|
|
2562
|
+
"CreateFilterInput": {
|
|
2563
|
+
"type": "object",
|
|
2564
|
+
"additionalProperties": false,
|
|
2565
|
+
"properties": {
|
|
2566
|
+
"type": {
|
|
2567
|
+
"type": "string",
|
|
2568
|
+
"enum": [
|
|
2569
|
+
"whitelist",
|
|
2570
|
+
"blocklist"
|
|
2571
|
+
]
|
|
2572
|
+
},
|
|
2573
|
+
"pattern": {
|
|
2574
|
+
"type": "string",
|
|
2575
|
+
"minLength": 1,
|
|
2576
|
+
"maxLength": 500,
|
|
2577
|
+
"description": "Email address or pattern to filter"
|
|
2578
|
+
},
|
|
2579
|
+
"domain_id": {
|
|
2580
|
+
"type": [
|
|
2581
|
+
"string",
|
|
2582
|
+
"null"
|
|
2583
|
+
],
|
|
2584
|
+
"format": "uuid",
|
|
2585
|
+
"description": "Restrict filter to a specific domain (Pro plan required)"
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
"required": [
|
|
2589
|
+
"type",
|
|
2590
|
+
"pattern"
|
|
2591
|
+
]
|
|
2592
|
+
},
|
|
2593
|
+
"UpdateFilterInput": {
|
|
2594
|
+
"type": "object",
|
|
2595
|
+
"additionalProperties": false,
|
|
2596
|
+
"properties": {
|
|
2597
|
+
"enabled": {
|
|
2598
|
+
"type": "boolean"
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
"required": [
|
|
2602
|
+
"enabled"
|
|
2603
|
+
]
|
|
2604
|
+
},
|
|
2605
|
+
"DeliverySummary": {
|
|
2606
|
+
"type": "object",
|
|
2607
|
+
"properties": {
|
|
2608
|
+
"id": {
|
|
2609
|
+
"type": "string",
|
|
2610
|
+
"description": "Delivery ID (numeric string)"
|
|
2611
|
+
},
|
|
2612
|
+
"email_id": {
|
|
2613
|
+
"type": "string",
|
|
2614
|
+
"format": "uuid"
|
|
2615
|
+
},
|
|
2616
|
+
"org_id": {
|
|
2617
|
+
"type": "string",
|
|
2618
|
+
"format": "uuid"
|
|
2619
|
+
},
|
|
2620
|
+
"endpoint_id": {
|
|
2621
|
+
"type": "string",
|
|
2622
|
+
"format": "uuid"
|
|
2623
|
+
},
|
|
2624
|
+
"endpoint_url": {
|
|
2625
|
+
"type": "string"
|
|
2626
|
+
},
|
|
2627
|
+
"status": {
|
|
2628
|
+
"type": "string",
|
|
2629
|
+
"enum": [
|
|
2630
|
+
"pending",
|
|
2631
|
+
"delivered",
|
|
2632
|
+
"header_confirmed",
|
|
2633
|
+
"failed"
|
|
2634
|
+
]
|
|
2635
|
+
},
|
|
2636
|
+
"attempt_count": {
|
|
2637
|
+
"type": "integer"
|
|
2638
|
+
},
|
|
2639
|
+
"duration_ms": {
|
|
2640
|
+
"type": [
|
|
2641
|
+
"integer",
|
|
2642
|
+
"null"
|
|
2643
|
+
]
|
|
2644
|
+
},
|
|
2645
|
+
"last_error": {
|
|
2646
|
+
"type": [
|
|
2647
|
+
"string",
|
|
2648
|
+
"null"
|
|
2649
|
+
]
|
|
2650
|
+
},
|
|
2651
|
+
"created_at": {
|
|
2652
|
+
"type": "string",
|
|
2653
|
+
"format": "date-time"
|
|
2654
|
+
},
|
|
2655
|
+
"updated_at": {
|
|
2656
|
+
"type": "string",
|
|
2657
|
+
"format": "date-time"
|
|
2658
|
+
},
|
|
2659
|
+
"email": {
|
|
2660
|
+
"type": [
|
|
2661
|
+
"object",
|
|
2662
|
+
"null"
|
|
2663
|
+
],
|
|
2664
|
+
"properties": {
|
|
2665
|
+
"sender": {
|
|
2666
|
+
"type": "string"
|
|
2667
|
+
},
|
|
2668
|
+
"recipient": {
|
|
2669
|
+
"type": "string"
|
|
2670
|
+
},
|
|
2671
|
+
"subject": {
|
|
2672
|
+
"type": [
|
|
2673
|
+
"string",
|
|
2674
|
+
"null"
|
|
2675
|
+
]
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
"required": [
|
|
2679
|
+
"sender",
|
|
2680
|
+
"recipient"
|
|
2681
|
+
]
|
|
2682
|
+
}
|
|
2683
|
+
},
|
|
2684
|
+
"required": [
|
|
2685
|
+
"id",
|
|
2686
|
+
"email_id",
|
|
2687
|
+
"org_id",
|
|
2688
|
+
"endpoint_id",
|
|
2689
|
+
"endpoint_url",
|
|
2690
|
+
"status",
|
|
2691
|
+
"attempt_count",
|
|
2692
|
+
"created_at",
|
|
2693
|
+
"updated_at"
|
|
2694
|
+
]
|
|
2695
|
+
},
|
|
2696
|
+
"ReplayResult": {
|
|
2697
|
+
"type": "object",
|
|
2698
|
+
"properties": {
|
|
2699
|
+
"delivered": {
|
|
2700
|
+
"type": "integer",
|
|
2701
|
+
"description": "Number of successful deliveries"
|
|
2702
|
+
},
|
|
2703
|
+
"failed": {
|
|
2704
|
+
"type": "integer",
|
|
2705
|
+
"description": "Number of failed deliveries"
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2708
|
+
"required": [
|
|
2709
|
+
"delivered",
|
|
2710
|
+
"failed"
|
|
2711
|
+
]
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
};
|